From patchwork Thu Jun 11 02:22:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tony Breeds X-Patchwork-Id: 28540 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 49578B7228 for ; Thu, 11 Jun 2009 12:22:39 +1000 (EST) Received: by ozlabs.org (Postfix) id 3D74BDDD0C; Thu, 11 Jun 2009 12:22:39 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 3B808DDD0B for ; Thu, 11 Jun 2009 12:22:39 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4C660B757A for ; Thu, 11 Jun 2009 12:22:09 +1000 (EST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 81335B7222 for ; Thu, 11 Jun 2009 12:22:01 +1000 (EST) Received: by ozlabs.org (Postfix) id 75547DDD0C; Thu, 11 Jun 2009 12:22:01 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 70A60DDD0B for ; Thu, 11 Jun 2009 12:22:01 +1000 (EST) Received: by bilbo.ozlabs.org (Postfix, from userid 1026) id 604EDB7228; Thu, 11 Jun 2009 12:22:01 +1000 (EST) Date: Thu, 11 Jun 2009 12:22:01 +1000 From: Tony Breeds To: Subrata Modak Subject: Re: [PATCH] Re:[BUILD FAILURE 04/04] Next June 04:PPC64 randconfig [drivers/net/ucc_geth.o] Message-ID: <20090611022201.GI16602@bilbo.ozlabs.org> Mail-Followup-To: Subrata Modak , Stephen Rothwell , netdev@vger.kernel.org, Li Yang , Sachin P Sant , Linuxppc-dev , Linux-Next , Linux-Kernel , Balbir Singh References: <20090610174323.28045.70169.sendpatchset@subratamodak.linux.ibm.com> <20090611110523.1fd56a41.sfr@canb.auug.org.au> <1244685364.6494.14.camel@subratamodak.linux.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1244685364.6494.14.camel@subratamodak.linux.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Sachin P Sant , Stephen Rothwell , netdev@vger.kernel.org, Linux-Kernel , Linuxppc-dev , Linux-Next , Li Yang , Balbir Singh X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Thu, Jun 11, 2009 at 07:26:04AM +0530, Subrata Modak wrote: > On Thu, 2009-06-11 at 11:05 +1000, Stephen Rothwell wrote: > > Hi Subrata, > > > > On Wed, 10 Jun 2009 23:13:23 +0530 Subrata Modak wrote: > > > > > > /* Find the TBI PHY. If it's not there, we don't support SGMII */ > > > - ph = of_get_property(np, "tbi-handle", NULL); > > > + ph = (phandle *)of_get_property(np, "tbi-handle", NULL); > > > > You don't need this cast because of_get_property() returns "void *". > > Stephen, > > True. But without this gcc complains: > > CC [M] drivers/net/ucc_geth.o > drivers/net/ucc_geth.c: In function ‘ucc_geth_probe’: > drivers/net/ucc_geth.c:3824: warning: assignment discards qualifiers > from pointer target type > > Else gcc just builds fine: > > CC [M] drivers/net/ucc_geth.o > > This is an just an extra caution to fix both the build and warning > regression(s). ph needs to be const. I think the following untested (and hence un-signed-off-by) patch is closer, however I also think that the whole SGMII setup code could use the various OF helper functions better :) Yours Tony diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index e2f2e91..796253d 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -3603,6 +3603,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma struct resource res; struct device_node *phy; int err, ucc_num, max_speed = 0; + const phandle *ph; const u32 *fixed_link; const unsigned int *prop; const char *sprop; @@ -3821,7 +3822,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma /* Find the TBI PHY. If it's not there, we don't support SGMII */ ph = of_get_property(np, "tbi-handle", NULL); if (ph) { - struct device_node *tbi = of_find_node_by_phandle(*ph); + struct device_node *tbi = of_find_node_by_phandle(*ph), *mdio; struct of_device *ofdev; struct mii_bus *bus; const unsigned int *id;