lkml.org 
[lkml]   [2016]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 7/7] cfag12864b: Adjust two checks for null pointers in cfag12864b_init()
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sat, 10 Sep 2016 16:06:19 +0200
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit

    The script "checkpatch.pl" can point 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>
    ---
    drivers/auxdisplay/cfag12864b.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/auxdisplay/cfag12864b.c b/drivers/auxdisplay/cfag12864b.c
    index b2533e2..3956b9f 100644
    --- a/drivers/auxdisplay/cfag12864b.c
    +++ b/drivers/auxdisplay/cfag12864b.c
    @@ -338,7 +338,7 @@ static int __init cfag12864b_init(void)
    BUILD_BUG_ON(PAGE_SIZE < CFAG12864B_SIZE);

    cfag12864b_buffer = (unsigned char *) get_zeroed_page(GFP_KERNEL);
    - if (cfag12864b_buffer == NULL) {
    + if (!cfag12864b_buffer) {
    printk(KERN_ERR CFAG12864B_NAME ": ERROR: "
    "can't get a free page\n");
    return -ENOMEM;
    @@ -351,7 +351,7 @@ static int __init cfag12864b_init(void)
    goto free_buffer;

    cfag12864b_workqueue = create_singlethread_workqueue(CFAG12864B_NAME);
    - if (cfag12864b_workqueue == NULL)
    + if (!cfag12864b_workqueue)
    goto free_cache;

    cfag12864b_clear();
    --
    2.10.0
    \
     
     \ /
      Last update: 2016-09-17 09:59    [W:4.021 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site