linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Rakhi Sharma <rakhish1994@gmail.com>
Cc: knaack.h@gmx.de, lars@metafoo.de, michal.simek@xilinx.com,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/2] drivers: iio: adc: xilinx-xadc-events: Fixed a coding style warning.
Date: Sat, 6 Feb 2016 22:02:02 +0000	[thread overview]
Message-ID: <56B66D5A.1010609@kernel.org> (raw)
In-Reply-To: <1454788835-11707-1-git-send-email-rakhish1994@gmail.com>

On 06/02/16 20:00, Rakhi Sharma wrote:
> Fixed a warning.
> WARNING: else is not generally useful after a break or return
> 
> Signed-off-by: Rakhi Sharma <rakhish1994@gmail.com>
A worthwhile aim, though sometimes such an else statement can reflect
a 'balance' in the code acting as a simple two element case statement.

However...
Please think through the results of your patches.  You've just removed
and open bracket without finding and removing the close bracket.
Also an open bracket removal means that the code indentation of the next
block is now wrong.

So, please revisit this patch, but next time make sure to at compile
test it before posting the patch - you would have had both errors
and warnings about the indenting from the result of this patch.

Jonathan
> ---
>  drivers/iio/adc/xilinx-xadc-events.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/xilinx-xadc-events.c b/drivers/iio/adc/xilinx-xadc-events.c
> index edcf3aa..61309b3 100644
> --- a/drivers/iio/adc/xilinx-xadc-events.c
> +++ b/drivers/iio/adc/xilinx-xadc-events.c
> @@ -92,7 +92,7 @@ static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan)
>  {
>  	if (chan->type == IIO_TEMP) {
>  		return XADC_ALARM_OT_MASK;
> -	} else {
> +	}
>  		switch (chan->channel) {
>  		case 0:
>  			return XADC_ALARM_VCCINT_MASK;
> 


      reply	other threads:[~2016-02-06 22:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06 20:00 [PATCH 2/2] drivers: iio: adc: xilinx-xadc-events: Fixed a coding style warning Rakhi Sharma
2016-02-06 22:02 ` Jonathan Cameron [this message]

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=56B66D5A.1010609@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=rakhish1994@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).