From: Dan Carpenter <error27@gmail.com>
To: netdev@vger.kernel.org
Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
kernel-janitors@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>
Subject: [patch] caif: cleanup: remove duplicate checks
Date: Sat, 22 May 2010 20:45:19 +0000 [thread overview]
Message-ID: <20100522204519.GW22515@bicker> (raw)
These checks merely duplicate the things we've asserted already. In the
case of the checks for null we've already dereferenced those variables
as well.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
index df43f26..cc2f072 100644
--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -313,14 +313,10 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv,
caif_assert(phyinfo->phy_layer != NULL);
caif_assert(phyinfo->phy_layer->id = phyid);
- if (phyinfo != NULL &&
- phyinfo->phy_ref_count++ = 0 &&
- phyinfo->phy_layer != NULL &&
+ if (phyinfo->phy_ref_count++ = 0 &&
phyinfo->phy_layer->modemcmd != NULL) {
- caif_assert(phyinfo->phy_layer->id = phyid);
phyinfo->phy_layer->modemcmd(phyinfo->phy_layer,
_CAIF_MODEMCMD_PHYIF_USEFULL);
-
}
adapt_layer->id = channel_id;
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: netdev@vger.kernel.org
Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
kernel-janitors@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>
Subject: [patch] caif: cleanup: remove duplicate checks
Date: Sat, 22 May 2010 22:45:19 +0200 [thread overview]
Message-ID: <20100522204519.GW22515@bicker> (raw)
These checks merely duplicate the things we've asserted already. In the
case of the checks for null we've already dereferenced those variables
as well.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c
index df43f26..cc2f072 100644
--- a/net/caif/cfcnfg.c
+++ b/net/caif/cfcnfg.c
@@ -313,14 +313,10 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv,
caif_assert(phyinfo->phy_layer != NULL);
caif_assert(phyinfo->phy_layer->id == phyid);
- if (phyinfo != NULL &&
- phyinfo->phy_ref_count++ == 0 &&
- phyinfo->phy_layer != NULL &&
+ if (phyinfo->phy_ref_count++ == 0 &&
phyinfo->phy_layer->modemcmd != NULL) {
- caif_assert(phyinfo->phy_layer->id == phyid);
phyinfo->phy_layer->modemcmd(phyinfo->phy_layer,
_CAIF_MODEMCMD_PHYIF_USEFULL);
-
}
adapt_layer->id = channel_id;
next reply other threads:[~2010-05-22 20:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-22 20:45 Dan Carpenter [this message]
2010-05-22 20:45 ` [patch] caif: cleanup: remove duplicate checks Dan Carpenter
2010-05-23 8:27 ` walter harms
2010-05-23 8:27 ` walter harms
2010-05-24 16:29 ` [patch v2] " Dan Carpenter
2010-05-24 16:29 ` Dan Carpenter
2010-05-24 20:47 ` Sjur Brændeland
2010-05-24 20:47 ` Sjur Brændeland
2010-05-31 7:32 ` David Miller
2010-05-31 7:32 ` David Miller
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=20100522204519.GW22515@bicker \
--to=error27@gmail.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=sjur.brandeland@stericsson.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 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.