Skip to content

Commit 76ce37f

Browse files
elfringLinus Walleij
authored andcommitted
pinctrl: Adjust five checks for null pointers
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent de2eae2 commit 76ce37f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎drivers/pinctrl/pinconf.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static int pinconf_pins_show(struct seq_file *s, void *what)
319319
pin = pctldev->desc->pins[i].number;
320320
desc = pin_desc_get(pctldev, pin);
321321
/* Skip if we cannot search the pin */
322-
if (desc == NULL)
322+
if (!desc)
323323
continue;
324324

325325
seq_printf(s, "pin %d (%s): ", pin, desc->name);
@@ -524,31 +524,31 @@ static ssize_t pinconf_dbg_config_write(struct file *file,
524524

525525
/* get arg 'device_name' */
526526
token = strsep(&b, " ");
527-
if (token == NULL)
527+
if (!token)
528528
return -EINVAL;
529529
if (strlen(token) >= MAX_NAME_LEN)
530530
return -EINVAL;
531531
strncpy(dbg->dev_name, token, MAX_NAME_LEN);
532532

533533
/* get arg 'state_name' */
534534
token = strsep(&b, " ");
535-
if (token == NULL)
535+
if (!token)
536536
return -EINVAL;
537537
if (strlen(token) >= MAX_NAME_LEN)
538538
return -EINVAL;
539539
strncpy(dbg->state_name, token, MAX_NAME_LEN);
540540

541541
/* get arg 'pin_name' */
542542
token = strsep(&b, " ");
543-
if (token == NULL)
543+
if (!token)
544544
return -EINVAL;
545545
if (strlen(token) >= MAX_NAME_LEN)
546546
return -EINVAL;
547547
strncpy(dbg->pin_name, token, MAX_NAME_LEN);
548548

549549
/* get new_value of config' */
550550
token = strsep(&b, " ");
551-
if (token == NULL)
551+
if (!token)
552552
return -EINVAL;
553553
if (strlen(token) >= MAX_NAME_LEN)
554554
return -EINVAL;

0 commit comments

Comments
 (0)