All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: extcon: sm5502: Add support new SM5502 extcon device driver
Date: Thu, 31 Jul 2014 09:44:22 +0000	[thread overview]
Message-ID: <20140731094422.GA30971@mwanda> (raw)

Hello Chanwoo Choi,

The patch 914b881f9452: "extcon: sm5502: Add support new SM5502
extcon device driver" from May 22, 2014, leads to the following
static checker warning:

	drivers/extcon/extcon-sm5502.c:398 sm5502_muic_cable_handler()
	warn: we tested 'attached' before and it was 'false'

drivers/extcon/extcon-sm5502.c
   381  static int sm5502_muic_cable_handler(struct sm5502_muic_info *info,
   382                                       bool attached)
   383  {
   384          static unsigned int prev_cable_type = SM5502_MUIC_ADC_GROUND;
   385          const char **cable_names = info->edev->supported_cable;
   386          unsigned int cable_type = SM5502_MUIC_ADC_GROUND;
   387          unsigned int con_sw = DM_DP_SWITCH_OPEN;
   388          unsigned int vbus_sw = VBUSIN_SWITCH_OPEN;
   389          unsigned int idx = 0;
   390          int ret;
   391  
   392          if (!cable_names)
   393                  return 0;
   394  
   395          /* Get the type of attached or detached cable */
   396          if (attached)
                    ^^^^^^^^
   397                  cable_type = sm5502_muic_get_cable_type(info);
   398          else if (!attached)
                         ^^^^^^^^^
This is obviously implied.  It upsets the static checkers to check known
variables.

   399                  cable_type = prev_cable_type;
   400          prev_cable_type = cable_type;

regards,
dan carpenter

                 reply	other threads:[~2014-07-31  9:44 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=20140731094422.GA30971@mwanda \
    --to=dan.carpenter@oracle.com \
    --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.