public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Fred Akers <knivey@botops.net>
Cc: "greg@kroah.com" <greg@kroah.com>,
	Ian Abbott <ian.abbott@mev.co.uk>,
	"hsweeten@visionengravers.com" <hsweeten@visionengravers.com>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] Staging: comedi: range: remove unnecessary sanity check
Date: Thu, 6 Mar 2014 09:18:16 +0000	[thread overview]
Message-ID: <53183D58.4040507@mev.co.uk> (raw)
In-Reply-To: <1394089039-12408-2-git-send-email-knivey@botops.net>

On 06/03/14 06:57, Fred Akers wrote:
> This check is unnecessary because range_table will always be
> initialized to range_unknown by comedi_device_postconfig() for
> drivers that do not initialize range_table or range_table_list
>
> Signed-off-by: Fred Akers <knivey@botops.net>
> ---
>   drivers/staging/comedi/range.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c
> index c4bb13b..b684954 100644
> --- a/drivers/staging/comedi/range.c
> +++ b/drivers/staging/comedi/range.c
> @@ -143,10 +143,6 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n,
>   	unsigned int chanspec;
>   	int chan, range_len, i;
>
> -	if (!s->range_table && !s->range_table_list) {
> -		dev_err(dev->class_dev, "(bug) no range type list!\n");
> -		return -EINVAL;
> -	}
>   	for (i = 0; i < n; i++) {
>   		chanspec = chanlist[i];
>   		chan = CR_CHAN(chanspec);
>

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

(Further down this `for` loop, the NULL-ness test on 
`s->range_table_list` is also technically redundant, but I think the 
code is clearer with the check left in, and is safer in a defensive way.)

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

  reply	other threads:[~2014-03-06  9:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <53176DC0.9070503@mev.co.uk>
2014-03-06  6:07 ` [PATCH] Staging: comedi: range: remove unnecessary sanity check Fred Akers
2014-03-06  6:23   ` Greg KH
2014-03-06  6:57     ` [PATCH v2 1/2] Staging: comedi: range: tidy up comedi_check_chanlist() Fred Akers
2014-03-06  9:05       ` Ian Abbott
2014-03-06 16:43       ` Hartley Sweeten
2014-03-06  6:57     ` [PATCH v2 2/2] Staging: comedi: range: remove unnecessary sanity check Fred Akers
2014-03-06  9:18       ` Ian Abbott [this message]
2014-03-06  9:24       ` Dan Carpenter
2014-03-06 16:44       ` Hartley Sweeten

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=53183D58.4040507@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=hsweeten@visionengravers.com \
    --cc=ian.abbott@mev.co.uk \
    --cc=knivey@botops.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox