linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: christophe.ricard@gmail.com
Cc: linux-wireless@vger.kernel.org
Subject: re: NFC: nci: Create pipe on specific gate in nci_hci_connect_gate
Date: Tue, 3 Nov 2015 17:29:44 +0300	[thread overview]
Message-ID: <20151103142944.GE28591@mwanda> (raw)

Hello Christophe Ricard,

The patch a1b0b9415817: "NFC: nci: Create pipe on specific gate in
nci_hci_connect_gate" from Oct 25, 2015, leads to the following
static checker warning:

	net/nfc/nci/hci.c:679 nci_hci_connect_gate()
	warn: impossible condition '(pipe < 0) => (0-255 < 0)'

net/nfc/nci/hci.c
   655  int nci_hci_connect_gate(struct nci_dev *ndev,
   656                           u8 dest_host, u8 dest_gate, u8 pipe)
   657  {
   658          bool pipe_created = false;
   659          int r;
   660  
   661          if (pipe == NCI_HCI_DO_NOT_OPEN_PIPE)
   662                  return 0;
   663  
   664          if (ndev->hci_dev->gate2pipe[dest_gate] != NCI_HCI_INVALID_PIPE)
   665                  return -EADDRINUSE;
   666  
   667          if (pipe != NCI_HCI_INVALID_PIPE)
   668                  goto open_pipe;
   669  
   670          switch (dest_gate) {
   671          case NCI_HCI_LINK_MGMT_GATE:
   672                  pipe = NCI_HCI_LINK_MGMT_PIPE;
   673          break;
   674          case NCI_HCI_ADMIN_GATE:
   675                  pipe = NCI_HCI_ADMIN_PIPE;
   676          break;
   677          default:
   678                  pipe = nci_hci_create_pipe(ndev, dest_host, dest_gate, &r);
   679                  if (pipe < 0)
                            ^^^^^^^^
Unsigned never less than zero.

   680                          return r;
   681                  pipe_created = true;
   682                  break;
   683          }
   684  
   685  open_pipe:
   686          r = nci_hci_open_pipe(ndev, pipe);


regards,
dan carpenter

                 reply	other threads:[~2015-11-03 14:29 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=20151103142944.GE28591@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=christophe.ricard@gmail.com \
    --cc=linux-wireless@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 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).