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]

 



Dear Dan,

Dan Carpenter wrote:
On Thu, May 14, 2015 at 12:08:49AM +0200, Luca Ceresoli wrote:
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 reviewed this patch, but I missed this question until Larry responded
to it.

@@ -1003,7 +1003,7 @@ static int _netdev_open(struct net_device *pnetdev)
  		pr_info("MAC Address = %pM\n", pnetdev->dev_addr);

  		status = rtw_start_drv_threads(padapter);
-		if (status == _FAIL) {
+		if (status != 0) {

This patch is fine as-is but actually, status is an unsigned int and
we're storing negatives and error codes so that's a bit unfortunate.

You're right. The "status" variable should become an int, and perhaps be
renamed to err.

Thanks for pointing out.

Overall I understand you agree on the principle, correct?
--
Luca
_______________________________________________
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