All of lore.kernel.org
 help / color / mirror / Atom feed
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 v2] staging: dgnc: remove redundant NULL check for brd
Date: Fri, 27 May 2016 10:19:47 +0000	[thread overview]
Message-ID: <57481F43.9030008@osg.samsung.com> (raw)
In-Reply-To: <20160527014142.GA32739@SEL-JYOUN-D1>

On 27/05/16 02:42, 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.
> 
> the dgnc_finalize_board_init() as a static function was called
> only from dgnc_found_board() function and brd->magic value
> was assigned once in dgnc_found_board(). So it doesn't need to
> check for DGNC_BOARD_MAGIC value.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> V2: Adds more comments to Change Log.
> 
>  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);
> 

Looks good.

Thanks for the fixes Daeseok :)

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: markh@compro.net, gregkh@linuxfoundation.org,
	driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/2 v2] staging: dgnc: remove redundant NULL check for brd
Date: Fri, 27 May 2016 11:19:47 +0100	[thread overview]
Message-ID: <57481F43.9030008@osg.samsung.com> (raw)
In-Reply-To: <20160527014142.GA32739@SEL-JYOUN-D1>

On 27/05/16 02:42, 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.
> 
> the dgnc_finalize_board_init() as a static function was called
> only from dgnc_found_board() function and brd->magic value
> was assigned once in dgnc_found_board(). So it doesn't need to
> check for DGNC_BOARD_MAGIC value.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> V2: Adds more comments to Change Log.
> 
>  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);
> 

Looks good.

Thanks for the fixes Daeseok :)

Luis

  reply	other threads:[~2016-05-27 10:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27  1:42 [PATCH 1/2 v2] staging: dgnc: remove redundant NULL check for brd Daeseok Youn
2016-05-27  1:42 ` Daeseok Youn
2016-05-27 10:19 ` Luis de Bethencourt [this message]
2016-05-27 10:19   ` Luis de Bethencourt

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=57481F43.9030008@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.