From: Tobin C. Harding Date: Mon, 13 Mar 2017 22:54:08 +0000 (+1100) Subject: staging: ks7010: fix checkpatch memset warning X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f0b7d3a67bce75bc1e5910e30c3890ae01e3be04;p=linux.git staging: ks7010: fix checkpatch memset warning 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 9fa1ee7255cae..d07b724a3442d 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -2431,7 +2431,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; }