staging: fbtft: fix NULL comparison checkpatch warning
authorCarlos Palminha <CARLOS.PALMINHA@synopsys.com>
Thu, 29 Sep 2016 12:03:30 +0000 (13:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 Oct 2016 15:18:38 +0000 (17:18 +0200)
Fixed the following checkpatch warnings (task #10 of eudyptula challenge):
- NULL comparison rewritten to use '!' operator

Signed-off-by: Carlos Palminha <palminha@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft_device.c

index e9f25ddebff03cef869b7d3780fe734ddc87ed4b..e9211831b6a1d8d696e8155737a04ea51bb8e7b4 100644 (file)
@@ -1418,14 +1418,14 @@ static int __init fbtft_device_init(void)
 
        /* parse module parameter: gpios */
        while ((p_gpio = strsep(&gpios, ","))) {
-               if (strchr(p_gpio, ':') == NULL) {
+               if (!strchr(p_gpio, ':')) {
                        pr_err("error: missing ':' in gpios parameter: %s\n",
                               p_gpio);
                        return -EINVAL;
                }
                p_num = p_gpio;
                p_name = strsep(&p_num, ":");
-               if (p_name == NULL || p_num == NULL) {
+               if (!p_name || !p_num) {
                        pr_err("something bad happened parsing gpios parameter: %s\n",
                               p_gpio);
                        return -EINVAL;