All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] staging: comedi: das16: remove a duplicate condition
Date: Thu, 30 Jul 2015 07:18:56 +0000	[thread overview]
Message-ID: <55B9CFE0.4010508@bfs.de> (raw)
In-Reply-To: <20150729213632.GE21784@mwanda>



Am 29.07.2015 23:36, schrieb Dan Carpenter:
> We checked that "it->options[3]" was non-zero on the line before so
> there is no need to check again.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c
> index d7cf4b1..056bca9 100644
> --- a/drivers/staging/comedi/drivers/das16.c
> +++ b/drivers/staging/comedi/drivers/das16.c
> @@ -1032,8 +1032,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  
>  	/*  check that clock setting is valid */
>  	if (it->options[3]) {
> -		if (it->options[3] != 0 &&
> -		    it->options[3] != 1 && it->options[3] != 10) {
> +		if (it->options[3] != 1 && it->options[3] != 10) {
>  			dev_err(dev->class_dev,
>  				"Invalid option. Master clock must be set to 1 or 10 (MHz)\n");
>  			return -EINVAL;

mmh, acording to the error messages 1 or 10 is allowed, obviously 0 is/was also valid.
I would suggest to put that into one if () to make things more obvious.
It 0 is also valid a minor tweak to the error msg would be nice.


re,
 wh


  parent reply	other threads:[~2015-07-30  7:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29 21:36 [patch] staging: comedi: das16: remove a duplicate condition Dan Carpenter
2015-07-29 23:06 ` Hartley Sweeten
2015-07-30  7:18 ` walter harms [this message]
2015-07-30  8:30 ` Dan Carpenter
2015-07-30  9:31 ` Ian Abbott

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=55B9CFE0.4010508@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@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.