linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Chao Xie <chao.xie@marvell.com>, Rob Herring <robh@kernel.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	Pramod Gurav <pramod.gurav@smartplayin.com>,
	linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] Input: pxa27x_keypad - remove an unneeded NULL check
Date: Wed, 11 Feb 2015 09:36:34 -0800	[thread overview]
Message-ID: <20150211173634.GA29440@dtor-ws> (raw)
In-Reply-To: <20150211102802.GD18515@mwanda>

On Wed, Feb 11, 2015 at 01:28:02PM +0300, Dan Carpenter wrote:
> Static checkers complain about this NULL check because we dereference it
> without checking a couple lines later.  This function is only called
> when "keypad->pdata" is non-NULL so we can just delete the NULL test.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied in a modified form - removed the temp altogether.

> 
> diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
> index a89488a..385abf8 100644
> --- a/drivers/input/keyboard/pxa27x_keypad.c
> +++ b/drivers/input/keyboard/pxa27x_keypad.c
> @@ -346,7 +346,7 @@ static int pxa27x_keypad_build_keycode(struct pxa27x_keypad *keypad)
>  	const struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
>  	struct input_dev *input_dev = keypad->input_dev;
>  	const struct matrix_keymap_data *keymap_data =
> -				pdata ? pdata->matrix_keymap_data : NULL;
> +						pdata->matrix_keymap_data;
>  	unsigned short keycode;
>  	int i;
>  	int error;

Thanks.

-- 
Dmitry

      reply	other threads:[~2015-02-11 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 10:28 [patch] Input: pxa27x_keypad - remove an unneeded NULL check Dan Carpenter
2015-02-11 17:36 ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150211173634.GA29440@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=chao.xie@marvell.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=pramod.gurav@smartplayin.com \
    --cc=robh@kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).