Re: [patch] staging: comedi: das16: remove a duplicate condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxx>
> 
> 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux