Changeset b7fd2a0 in mainline for uspace/lib/usbdev/src/pipesinit.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/lib/usbdev/src/pipesinit.c

    r36f0738 rb7fd2a0  
    152152 * @return Error code.
    153153 */
    154 static int process_endpoint(
     154static errno_t process_endpoint(
    155155    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    156156    usb_standard_interface_descriptor_t *interface,
     
    194194        }
    195195
    196         int rc = usb_pipe_initialize(&ep_mapping->pipe,
     196        errno_t rc = usb_pipe_initialize(&ep_mapping->pipe,
    197197            ep_no, description.transfer_type,
    198198            ED_MPS_PACKET_SIZE_GET(
     
    221221 * @return Error code.
    222222 */
    223 static int process_interface(
     223static errno_t process_interface(
    224224    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    225225    const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data,
     
    281281 * @return Error code.
    282282 */
    283 int usb_pipe_initialize_from_configuration(
     283errno_t usb_pipe_initialize_from_configuration(
    284284    usb_endpoint_mapping_t *mapping, size_t mapping_count,
    285285    const uint8_t *config_descriptor, size_t config_descriptor_size,
     
    338338 * @return Error code.
    339339 */
    340 int usb_pipe_probe_default_control(usb_pipe_t *pipe)
     340errno_t usb_pipe_probe_default_control(usb_pipe_t *pipe)
    341341{
    342342        assert(pipe);
     
    351351        uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE];
    352352        size_t transferred_size;
    353         int rc;
     353        errno_t rc;
    354354        for (size_t attempt_var = 0; attempt_var < 3; ++attempt_var) {
    355355                rc = usb_request_get_descriptor(pipe, USB_REQUEST_TYPE_STANDARD,
Note: See TracChangeset for help on using the changeset viewer.