From: Markus Elfring <[email protected]>
Date: Mon, 16 Oct 2017 16:15:21 +0200

The script "checkpatch.pl" pointed information out like the following.

ERROR: do not use assignment in if condition

Thus fix the affected source code place.

Signed-off-by: Markus Elfring <[email protected]>
---
 drivers/char/snsc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 6aa32679fd58..f551a625686a 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -419,7 +419,8 @@ scdrv_init(void)
 
                        /* initialize sysctl device data fields */
                        scd->scd_nasid = cnodeid_to_nasid(cnode);
-                       if (!(salbuf = kmalloc(SCDRV_BUFSZ, GFP_KERNEL))) {
+                       salbuf = kmalloc(SCDRV_BUFSZ, GFP_KERNEL);
+                       if (!salbuf) {
                                printk("%s: failed to allocate driver buffer"
                                       "(%s%s)\n", __func__,
                                       SYSCTL_BASENAME, devname);
-- 
2.14.2

Reply via email to