[PATCH 10/12] staging: ks7010: fix checkpatch memset warning

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

 



Checkpatch emits WARNING: single byte memset is suspicious. Swapped
2nd/3rd argument? Call site in question is correct but is an unusual
use of memset() to zero a single byte. The same can be achieved by
assigning 0 directly to the memory location.

Dereference pointer and assign 0 to that memory location. Use '\0' to
make explicit that it is a char pointer.

Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
---
 drivers/staging/ks7010/ks_wlan_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index e1e4a31..bb20bb9 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2595,7 +2595,7 @@ static int ks_wlan_data_read(struct net_device *dev,
 			return 0;
 		}
 		read_length = 0;
-		memset(extra, 0, 1);
+		*extra = '\0';
 		dwrq->length = 0;
 		return 0;
 	}
-- 
2.7.4

_______________________________________________
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