From patchwork Tue Aug 24 16:52:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 62613 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 0392EB6F11 for ; Wed, 25 Aug 2010 02:53:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755751Ab0HXQxW (ORCPT ); Tue, 24 Aug 2010 12:53:22 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:57235 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143Ab0HXQxU (ORCPT ); Tue, 24 Aug 2010 12:53:20 -0400 Received: by wyb35 with SMTP id 35so674859wyb.19 for ; Tue, 24 Aug 2010 09:53:19 -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=1o0D8uryOnD5NM2GEU7aQM/50CXpEpZnCtQvEbp/NXM=; b=m9JYCnjYY/jSjh4jjdHZzTIYsaG0uCSfzMQ0NGUJzOmKJDpMQi8Oin7f15GPTehvGG MPNktrN+SgT+MqQ9g6YKSKJItQXRCGh+OkUQnyKhaYMySzlRnt3k5O2cSfHIc7gUfR8a 2iud+ERxjQiQH/78Q1ZwEEdPkR/QCxJ6DoGCM= 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=bJYKKX5ft2xNUIULBuU8GNrhrwLJ4RbyOKaf+uEJRhWsV2S+wgm0jXsnERAQiViT/A v1A8br5NzJQoUWvkMt9dIbil9J2zQgx0iB/YSsVH5UYyAEp7uCa/AXL8GE/rH9Ukocfk 6WhntEw9GvycaVnvEW1CogKrXfpphMBSeeI84= Received: by 10.227.147.211 with SMTP id m19mr4120952wbv.200.1282668798374; Tue, 24 Aug 2010 09:53:18 -0700 (PDT) Received: from bicker ([41.205.146.22]) by mx.google.com with ESMTPS id u11sm210384weq.7.2010.08.24.09.53.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 24 Aug 2010 09:53:17 -0700 (PDT) Date: Tue, 24 Aug 2010 18:52:46 +0200 From: Dan Carpenter To: Sachin Sanap Cc: "David S. Miller" , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch 1/4] pxa168_eth: remove unneeded null check Message-ID: <20100824165150.GH29330@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 "pep->pd" isn't checked consistently in this function. For example it's dereferenced unconditionally on the next line after the end of the if condition. This function is only called from pxa168_eth_probe() and pep->pd is always non-NULL so I removed the check. 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/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c index ecc64d7..857a681 100644 --- a/drivers/net/pxa168_eth.c +++ b/drivers/net/pxa168_eth.c @@ -1414,10 +1414,8 @@ static int ethernet_phy_setup(struct net_device *dev) { struct pxa168_eth_private *pep = netdev_priv(dev); - if (pep->pd != NULL) { - if (pep->pd->init) - pep->pd->init(); - } + if (pep->pd->init) + pep->pd->init(); pep->phy = phy_scan(pep, pep->pd->phy_addr & 0x1f); if (pep->phy != NULL) phy_init(pep, pep->pd->speed, pep->pd->duplex);