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

    r36f0738 rb7fd2a0  
    7777 * @return Always EOK.
    7878 */
    79 static int polling_fibril(void *arg)
     79static errno_t polling_fibril(void *arg)
    8080{
    8181        assert(arg);
     
    102102        while (failed_attempts <= params->max_failures) {
    103103                size_t actual_size;
    104                 const int rc = usb_pipe_read(pipe, data->buffer,
     104                const errno_t rc = usb_pipe_read(pipe, data->buffer,
    105105                    data->request_size, &actual_size);
    106106
     
    206206 * @retval EOK New fibril polling the device was already started.
    207207 */
    208 static int usb_device_auto_polling_internal(usb_device_t *dev,
     208static errno_t usb_device_auto_polling_internal(usb_device_t *dev,
    209209    usb_endpoint_mapping_t *epm, const usb_device_auto_polling_t *polling,
    210210    size_t request_size)
     
    275275 * @retval EOK New fibril polling the device was already started.
    276276 */
    277 int usb_device_auto_polling(usb_device_t *usb_dev, usb_endpoint_t ep,
     277errno_t usb_device_auto_polling(usb_device_t *usb_dev, usb_endpoint_t ep,
    278278    const usb_device_auto_polling_t *polling, size_t req_size)
    279279{
     
    301301 * @retval EOK New fibril polling the device was already started.
    302302 */
    303 int usb_device_auto_poll(usb_device_t *dev, usb_endpoint_t ep,
     303errno_t usb_device_auto_poll(usb_device_t *dev, usb_endpoint_t ep,
    304304    usb_polling_callback_t callback, size_t request_size, int delay,
    305305    usb_polling_terminted_callback_t terminated_callback, void *arg)
     
    321321}
    322322
    323 int usb_device_auto_polling_desc(usb_device_t *usb_dev,
     323errno_t usb_device_auto_polling_desc(usb_device_t *usb_dev,
    324324    const usb_endpoint_description_t *desc,
    325325    const usb_device_auto_polling_t *polling, size_t req_size)
     
    330330}
    331331
    332 int usb_device_auto_poll_desc(usb_device_t * usb_dev,
     332errno_t usb_device_auto_poll_desc(usb_device_t * usb_dev,
    333333    const usb_endpoint_description_t *desc, usb_polling_callback_t callback,
    334334    size_t req_size, int delay,
Note: See TracChangeset for help on using the changeset viewer.