Changeset b7fd2a0 in mainline for uspace/drv/nic/ar9271/htc.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ar9271/htc.c

    r36f0738 rb7fd2a0  
    6666}
    6767
    68 int htc_init_new_vif(htc_device_t *htc_device)
     68errno_t htc_init_new_vif(htc_device_t *htc_device)
    6969{
    7070        htc_vif_msg_t vif_msg;
     
    153153 *
    154154 */
    155 int htc_send_control_message(htc_device_t *htc_device, void *buffer,
     155errno_t htc_send_control_message(htc_device_t *htc_device, void *buffer,
    156156    size_t buffer_size, uint8_t endpoint_id)
    157157{
     
    176176 *
    177177 */
    178 int htc_send_data_message(htc_device_t *htc_device, void *buffer,
     178errno_t htc_send_data_message(htc_device_t *htc_device, void *buffer,
    179179    size_t buffer_size, uint8_t endpoint_id)
    180180{
     
    199199 *
    200200 */
    201 int htc_read_data_message(htc_device_t *htc_device, void *buffer,
     201errno_t htc_read_data_message(htc_device_t *htc_device, void *buffer,
    202202    size_t buffer_size, size_t *transferred_size)
    203203{
     
    219219 *
    220220 */
    221 int htc_read_control_message(htc_device_t *htc_device, void *buffer,
     221errno_t htc_read_control_message(htc_device_t *htc_device, void *buffer,
    222222    size_t buffer_size, size_t *transferred_size)
    223223{
     
    239239 *
    240240 */
    241 static int htc_connect_service(htc_device_t *htc_device,
     241static errno_t htc_connect_service(htc_device_t *htc_device,
    242242    wmi_services_t service_id, int *response_endpoint_no)
    243243{
     
    261261       
    262262        /* Send HTC message. */
    263         int rc = htc_send_control_message(htc_device, buffer, buffer_size,
     263        errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
    264264            htc_device->endpoints.ctrl_endpoint);
    265265        if (rc != EOK) {
     
    312312 *
    313313 */
    314 static int htc_config_credits(htc_device_t *htc_device)
     314static errno_t htc_config_credits(htc_device_t *htc_device)
    315315{
    316316        size_t buffer_size = sizeof(htc_frame_header_t) +
     
    327327       
    328328        /* Send HTC message. */
    329         int rc = htc_send_control_message(htc_device, buffer, buffer_size,
     329        errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
    330330            htc_device->endpoints.ctrl_endpoint);
    331331        if (rc != EOK) {
     
    360360 *
    361361 */
    362 static int htc_complete_setup(htc_device_t *htc_device)
     362static errno_t htc_complete_setup(htc_device_t *htc_device)
    363363{
    364364        size_t buffer_size = sizeof(htc_frame_header_t) +
     
    373373       
    374374        /* Send HTC message. */
    375         int rc = htc_send_control_message(htc_device, buffer, buffer_size,
     375        errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
    376376            htc_device->endpoints.ctrl_endpoint);
    377377        if (rc != EOK)
     
    394394 *
    395395 */
    396 static int htc_check_ready(htc_device_t *htc_device)
     396static errno_t htc_check_ready(htc_device_t *htc_device)
    397397{
    398398        size_t buffer_size = htc_device->ath_device->ctrl_response_length;
     
    400400       
    401401        /* Read response from device. */
    402         int rc = htc_read_control_message(htc_device, buffer, buffer_size,
     402        errno_t rc = htc_read_control_message(htc_device, buffer, buffer_size,
    403403            NULL);
    404404        if (rc != EOK) {
     
    430430 *
    431431 */
    432 int htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,
     432errno_t htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,
    433433    htc_device_t *htc_device)
    434434{
     
    451451 *
    452452 */
    453 int htc_init(htc_device_t *htc_device)
     453errno_t htc_init(htc_device_t *htc_device)
    454454{
    455455        /* First check ready message in device. */
    456         int rc = htc_check_ready(htc_device);
     456        errno_t rc = htc_check_ready(htc_device);
    457457        if (rc != EOK) {
    458458                usb_log_error("Device is not in ready state after loading "
Note: See TracChangeset for help on using the changeset viewer.