All of lore.kernel.org
 help / color / mirror / Atom feed
From: <dan.carpenter@oracle.com>
To: kamel.bouhara@bootlin.com
Cc: linux-iio@vger.kernel.org
Subject: [bug report] counter: Add microchip TCB capture counter
Date: Mon, 27 Jul 2020 12:37:49 +0300	[thread overview]
Message-ID: <20200727093749.GA369722@mwanda> (raw)

Hello Kamel Bouhara,

The patch 106b104137fd: "counter: Add microchip TCB capture counter"
from Jul 6, 2020, leads to the following static checker warning:

	drivers/counter/microchip-tcb-capture.c:188 mchp_tc_count_action_get()
	warn: bitwise AND condition is false here

drivers/counter/microchip-tcb-capture.c
   176  static int mchp_tc_count_action_get(struct counter_device *counter,
   177                                      struct counter_count *count,
   178                                      struct counter_synapse *synapse,
   179                                      size_t *action)
   180  {
   181          struct mchp_tc_data *const priv = counter->priv;
   182          u32 cmr;
   183  
   184          regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
   185  
   186          *action = MCHP_TC_SYNAPSE_ACTION_NONE;
   187  
   188          if (cmr & ATMEL_TC_ETRGEDG_NONE)

ATMEL_TC_ETRGEDG_NONE is zero so this condition is impossible.

   189                  *action = MCHP_TC_SYNAPSE_ACTION_NONE;
   190          else if (cmr & ATMEL_TC_ETRGEDG_RISING)
   191                  *action = MCHP_TC_SYNAPSE_ACTION_RISING_EDGE;
   192          else if (cmr & ATMEL_TC_ETRGEDG_FALLING)
   193                  *action = MCHP_TC_SYNAPSE_ACTION_FALLING_EDGE;
   194          else if (cmr & ATMEL_TC_ETRGEDG_BOTH)
   195                  *action = MCHP_TC_SYNAPSE_ACTION_BOTH_EDGE;
   196  
   197          return 0;
   198  }

regards,
dan carpenter

                 reply	other threads:[~2020-07-27  9:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200727093749.GA369722@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kamel.bouhara@bootlin.com \
    --cc=linux-iio@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.