netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] caif: cleanup: remove duplicate checks
@ 2010-05-22 20:45 Dan Carpenter
  2010-05-23  8:27 ` walter harms
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2010-05-22 20:45 UTC (permalink / raw)
  To: netdev; +Cc: Sjur Braendeland, Stephen Rothwell, kernel-janitors,
	David S. Miller

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;
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-31  7:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-22 20:45 [patch] caif: cleanup: remove duplicate checks Dan Carpenter
2010-05-23  8:27 ` walter harms
2010-05-24 16:29   ` [patch v2] " Dan Carpenter
2010-05-24 20:47     ` Sjur Brændeland
2010-05-31  7:32       ` David Miller

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).