From patchwork Sat May 22 20:45:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 53288 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 05720B7D45 for ; Sun, 23 May 2010 06:46:02 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758356Ab0EVUp6 (ORCPT ); Sat, 22 May 2010 16:45:58 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:42349 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758238Ab0EVUp4 (ORCPT ); Sat, 22 May 2010 16:45:56 -0400 Received: by vws9 with SMTP id 9so1658423vws.19 for ; Sat, 22 May 2010 13:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=YQasVWKzaBzN9SmoB3/cBoigZw8kfF3e7WaCa0OGjJw=; b=QAyOcGw4D7GP3ceHs0pWgHtLEgTRKSLIDemuiXhqRBjYQFC7glSPbZnMWDaB/he4WW xIUjgYW4WRgRHxtwq55jmJDqJBv/j9Lv+AUqOlKEYgQQlY/kXPB+M8SMdsZBnl4geC9N sBeV+9G/H4Tk1pTtoBeYWZbVofliB7c8aHSNE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=hO9wFMykJ6rqyTrA7XzlznRjgYZBgTBOq/15SEmerGx3D1CDSbwzFYFs2Srr+gk/dt ACs4FVO94PifX9Q9dXt+iRBc4fGoCC403wNZlsNHPQaYIBaBvWI08Rgo6ltST3IpGitS ke9JQ29Z+ABVI3lYTN2dI/KDuvlbC/fMHV1Ro= Received: by 10.220.60.199 with SMTP id q7mr2275886vch.64.1274561155893; Sat, 22 May 2010 13:45:55 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id z17sm10813109vco.5.2010.05.22.13.45.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 22 May 2010 13:45:55 -0700 (PDT) Date: Sat, 22 May 2010 22:45:19 +0200 From: Dan Carpenter To: netdev@vger.kernel.org Cc: Sjur Braendeland , Stephen Rothwell , kernel-janitors@vger.kernel.org, "David S. Miller" Subject: [patch] caif: cleanup: remove duplicate checks Message-ID: <20100522204519.GW22515@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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;