Changeset b7fd2a0 in mainline for uspace/drv/bus/usb/ohci/ohci_rh.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 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/bus/usb/ohci/ohci_rh.c

    r36f0738 rb7fd2a0  
    109109 * initializes internal virtual hub.
    110110 */
    111 int ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs, const char *name)
     111errno_t ohci_rh_init(ohci_rh_t *instance, ohci_regs_t *regs, const char *name)
    112112{
    113113        assert(instance);
     
    174174 * status change requests might be postponed until there is something to report.
    175175 */
    176 int ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch)
     176errno_t ohci_rh_schedule(ohci_rh_t *instance, usb_transfer_batch_t *batch)
    177177{
    178178        assert(instance);
     
    205205 * processing of a postponed request.
    206206 */
    207 int ohci_rh_interrupt(ohci_rh_t *instance)
     207errno_t ohci_rh_interrupt(ohci_rh_t *instance)
    208208{
    209209        //TODO atomic swap needed
     
    245245 * @return Error code.
    246246 */
    247 static int req_get_status(usbvirt_device_t *device,
     247static errno_t req_get_status(usbvirt_device_t *device,
    248248    const usb_device_request_setup_packet_t *setup_packet,
    249249    uint8_t *data, size_t *act_size)
     
    268268 * @return Error code.
    269269 */
    270 static int req_clear_hub_feature(usbvirt_device_t *device,
     270static errno_t req_clear_hub_feature(usbvirt_device_t *device,
    271271    const usb_device_request_setup_packet_t *setup_packet,
    272272    uint8_t *data, size_t *act_size)
     
    298298 * @return Error code.
    299299 */
    300 static int req_get_port_status(usbvirt_device_t *device,
     300static errno_t req_get_port_status(usbvirt_device_t *device,
    301301    const usb_device_request_setup_packet_t *setup_packet,
    302302    uint8_t *data, size_t *act_size)
     
    322322 * @return Error code.
    323323 */
    324 static int req_clear_port_feature(usbvirt_device_t *device,
     324static errno_t req_clear_port_feature(usbvirt_device_t *device,
    325325    const usb_device_request_setup_packet_t *setup_packet,
    326326    uint8_t *data, size_t *act_size)
     
    386386 * @return Error code.
    387387 */
    388 static int req_set_port_feature(usbvirt_device_t *device,
     388static errno_t req_set_port_feature(usbvirt_device_t *device,
    389389    const usb_device_request_setup_packet_t *setup_packet,
    390390    uint8_t *data, size_t *act_size)
     
    437437 * only need 1 byte.
    438438 */
    439 static int req_status_change_handler(usbvirt_device_t *device,
     439static errno_t req_status_change_handler(usbvirt_device_t *device,
    440440    usb_endpoint_t endpoint, usb_transfer_type_t tr_type,
    441441    void *buffer, size_t buffer_size, size_t *actual_size)
Note: See TracChangeset for help on using the changeset viewer.