From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932650AbcFBLFs (ORCPT ); Thu, 2 Jun 2016 07:05:48 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:60896 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932576AbcFBLFq (ORCPT ); Thu, 2 Jun 2016 07:05:46 -0400 Subject: Re: [PATCH v3 net-next 03/13] net: hisilicon: cleanup to prepare for other cases To: David Miller References: <1464611664-93775-1-git-send-email-Yisen.Zhuang@huawei.com> <1464611664-93775-4-git-send-email-Yisen.Zhuang@huawei.com> <20160601.160706.1959937095056503271.davem@davemloft.net> CC: , , , , , , , , , , , , From: Yisen Zhuang Message-ID: <575012CF.9090306@huawei.com> Date: Thu, 2 Jun 2016 19:04:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160601.160706.1959937095056503271.davem@davemloft.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.157.38] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.575012E0.0147,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4f76b000fc7a46e83cd0e3b3d016732c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, Thanks for your comment, i will use dev name of this mdio bus instead of address. Thanks, Yisen 在 2016/6/2 7:07, David Miller 写道: > From: Yisen Zhuang > Date: Mon, 30 May 2016 20:34:14 +0800 > >> -static void hns_mdio_bus_name(char *name, struct device_node *np) >> +static void hns_mdio_bus_name(char *name, phys_addr_t addr) >> { >> - const u32 *addr; >> - u64 taddr = OF_BAD_ADDR; >> - >> - addr = of_get_address(np, 0, NULL, NULL); >> - if (addr) >> - taddr = of_translate_address(np, addr); >> - >> - snprintf(name, MII_BUS_ID_SIZE, "%s@%llx", np->name, >> - (unsigned long long)taddr); >> + snprintf(name, MII_BUS_ID_SIZE, >> + "hns-mdio@%llx", (unsigned long long)addr); > > This is a really bad idea. > > You're passing in the resource address in here, which can be a bus > address. > > And on a machine with multiple bus domains, the same address can be > used multiple times. They are not unique at all in a multi-domain > system. > > . >