From: Luis de Bethencourt <luisbg@osg.samsung.com>
To: Daeseok Youn <daeseok.youn@gmail.com>, lidza.louina@gmail.com
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
driverdev-devel@linuxdriverproject.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: dgnc: remove redundant NULL check for brd
Date: Wed, 25 May 2016 21:48:04 +0000 [thread overview]
Message-ID: <57461D94.1030403@osg.samsung.com> (raw)
In-Reply-To: <20160520095104.GA30075@SEL-JYOUN-D1>
On 20/05/16 10:51, Daeseok Youn wrote:
> the "brd" value cannot be NULL in dgnc_finalize_board_init().
> Because "brd" as a parameter of this function was already
> checked for NULL.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> drivers/staging/dgnc/dgnc_driver.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index af2e835..22257d2 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -579,9 +579,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
> {
> int rc = 0;
>
> - if (!brd || brd->magic != DGNC_BOARD_MAGIC)
> - return -ENODEV;
> -
> if (brd->irq) {
> rc = request_irq(brd->irq, brd->bd_ops->intr,
> IRQF_SHARED, "DGNC", brd);
>
This is partially correct, the check for brd being NULL is in line 371.
But there is a second check for brd->magic != DGNC_BOARD_MAGIC. Do you want
to keep that one?
Also, how did you find this patch. It is useful to mention this in the commit
message if it was through some static analysis tool. For people using these tools
in the future.
Thanks for the patch :)
Luis
WARNING: multiple messages have this Message-ID (diff)
From: Luis de Bethencourt <luisbg@osg.samsung.com>
To: Daeseok Youn <daeseok.youn@gmail.com>, lidza.louina@gmail.com
Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
driverdev-devel@linuxdriverproject.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: dgnc: remove redundant NULL check for brd
Date: Wed, 25 May 2016 22:48:04 +0100 [thread overview]
Message-ID: <57461D94.1030403@osg.samsung.com> (raw)
In-Reply-To: <20160520095104.GA30075@SEL-JYOUN-D1>
On 20/05/16 10:51, Daeseok Youn wrote:
> the "brd" value cannot be NULL in dgnc_finalize_board_init().
> Because "brd" as a parameter of this function was already
> checked for NULL.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> drivers/staging/dgnc/dgnc_driver.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index af2e835..22257d2 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -579,9 +579,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
> {
> int rc = 0;
>
> - if (!brd || brd->magic != DGNC_BOARD_MAGIC)
> - return -ENODEV;
> -
> if (brd->irq) {
> rc = request_irq(brd->irq, brd->bd_ops->intr,
> IRQF_SHARED, "DGNC", brd);
>
This is partially correct, the check for brd being NULL is in line 371.
But there is a second check for brd->magic != DGNC_BOARD_MAGIC. Do you want
to keep that one?
Also, how did you find this patch. It is useful to mention this in the commit
message if it was through some static analysis tool. For people using these tools
in the future.
Thanks for the patch :)
Luis
next prev parent reply other threads:[~2016-05-25 21:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 9:51 [PATCH 1/2] staging: dgnc: remove redundant NULL check for brd Daeseok Youn
2016-05-20 9:51 ` Daeseok Youn
2016-05-25 21:48 ` Luis de Bethencourt [this message]
2016-05-25 21:48 ` Luis de Bethencourt
2016-05-26 4:56 ` DaeSeok Youn
2016-05-26 4:56 ` DaeSeok Youn
2016-05-26 12:29 ` Luis de Bethencourt
2016-05-26 12:29 ` Luis de Bethencourt
2016-05-27 1:31 ` DaeSeok Youn
2016-05-27 1:31 ` DaeSeok Youn
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=57461D94.1030403@osg.samsung.com \
--to=luisbg@osg.samsung.com \
--cc=daeseok.youn@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.