Changeset b7fd2a0 in mainline for uspace/drv/nic/ar9271/ath_usb.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/ath_usb.c

    r36f0738 rb7fd2a0  
    3939#include "ath_usb.h"
    4040
    41 static int ath_usb_send_ctrl_message(ath_t *, void *, size_t);
    42 static int ath_usb_read_ctrl_message(ath_t *, void *, size_t, size_t *);
    43 static int ath_usb_send_data_message(ath_t *, void *, size_t);
    44 static int ath_usb_read_data_message(ath_t *, void *, size_t, size_t *);
     41static errno_t ath_usb_send_ctrl_message(ath_t *, void *, size_t);
     42static errno_t ath_usb_read_ctrl_message(ath_t *, void *, size_t, size_t *);
     43static errno_t ath_usb_send_data_message(ath_t *, void *, size_t);
     44static errno_t ath_usb_read_data_message(ath_t *, void *, size_t, size_t *);
    4545
    4646static ath_ops_t ath_usb_ops = {
     
    5959 *
    6060 */
    61 int ath_usb_init(ath_t *ath, usb_device_t *usb_device)
     61errno_t ath_usb_init(ath_t *ath, usb_device_t *usb_device)
    6262{
    6363        ath_usb_t *ath_usb = malloc(sizeof(ath_usb_t));
     
    9494 *
    9595 */
    96 static int ath_usb_send_ctrl_message(ath_t *ath, void *buffer,
     96static errno_t ath_usb_send_ctrl_message(ath_t *ath, void *buffer,
    9797    size_t buffer_size)
    9898{
     
    114114 *
    115115 */
    116 static int ath_usb_read_ctrl_message(ath_t *ath, void *buffer,
     116static errno_t ath_usb_read_ctrl_message(ath_t *ath, void *buffer,
    117117    size_t buffer_size, size_t *transferred_size)
    118118{
     
    133133 *
    134134 */
    135 static int ath_usb_send_data_message(ath_t *ath, void *buffer,
     135static errno_t ath_usb_send_data_message(ath_t *ath, void *buffer,
    136136    size_t buffer_size)
    137137{
     
    151151            ath_usb->usb_device, ath_usb->output_data_pipe_number)->pipe;
    152152       
    153         int ret_val = usb_pipe_write(pipe, complete_buffer,
     153        errno_t ret_val = usb_pipe_write(pipe, complete_buffer,
    154154            complete_buffer_size);
    155155       
     
    169169 *
    170170 */
    171 static int ath_usb_read_data_message(ath_t *ath, void *buffer,
     171static errno_t ath_usb_read_data_message(ath_t *ath, void *buffer,
    172172    size_t buffer_size, size_t *transferred_size)
    173173{
Note: See TracChangeset for help on using the changeset viewer.