Re: [PATCH 10/10] staging: rtl8188eu: return an error code, not a boolean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/13/2015 05:08 PM, Luca Ceresoli wrote:
Several functions in this driver return a boolean: _SUCCESS = 1 on success,
_FAIL = 0 on error, defined in
drivers/staging/rtl8188eu/include/osdep_service.h.

The common practice in the Linux kernel is to return 0 on success, a negative
error code otherwise. This has the advantage that the return value also
describes the kind of error that happened, while a boolean squashes all errors
down a unique value.

Change rtw_start_drv_threads() to return a proper 0-or-error value.

Signed-off-by: Luca Ceresoli <luca@xxxxxxxxxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxx>
Cc: Larry Finger <Larry.Finger@xxxxxxxxxxxx>

---

I think _SUCCESS and _FAIL should be totally eradicated and replaced with
proper error codes and my intent is to do it all over the codebase.
However, since that would be a massive change, I'm sending this small
patch to get some feedback. Should the idea be accepted, I'd go on.

I have no objections to the major change from those macros to simple 1 and 0. Such changes would be more acceptable if you have the hardware and can test as well to eliminate any subtle side effects..

Larry

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux