From: David Miller <davem@davemloft.net>
To: Yisen.Zhuang@huawei.com
Cc: rjw@rjwysocki.net, lenb@kernel.org, fengguang.wu@intel.com,
	andriy.shevchenko@linux.intel.com, andrew@lunn.ch,
	ivecera@redhat.com, f.fainelli@gmail.com, haifeng.wei@huawei.com,
	charles.chenxin@huawei.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH v3 net-next 03/13] net: hisilicon: cleanup to prepare for other cases
Date: Wed, 01 Jun 2016 16:07:06 -0700 (PDT)	[thread overview]
Message-ID: <20160601.160706.1959937095056503271.davem@davemloft.net> (raw)
In-Reply-To: <1464611664-93775-4-git-send-email-Yisen.Zhuang@huawei.com>
From: Yisen Zhuang <Yisen.Zhuang@huawei.com>
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.
next prev parent reply	other threads:[~2016-06-01 23:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 12:34 [PATCH v3 net-next 00/13] net: hns: add support of ACPI Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 01/13] ACPI: bus: add stub acpi_dev_found() to linux/acpi.h Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 02/13] ACPI: bus: add stub acpi_evaluate_dsm() " Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 03/13] net: hisilicon: cleanup to prepare for other cases Yisen Zhuang
2016-06-01 23:07   ` David Miller [this message]
2016-06-02 11:04     ` Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 04/13] net: hisilicon: add support of acpi for hns-mdio Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 05/13] net: hns: use device_* APIs instead of of_* APIs Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 06/13] net: hns: use platform_get_irq instead of irq_of_parse_and_map Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 07/13] net: hns: enet specify a reference to dsaf by fwnode_handle Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 08/13] net: hns: add uniform interface for phy connection Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 09/13] net: hns: add dsaf misc operation method Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 10/13] net: hns: dsaf adds support of acpi Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 11/13] net: hns: register phy device in each mac initial sequence Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 12/13] net: hns: implement the miscellaneous operation by asl Yisen Zhuang
2016-05-30 12:34 ` [PATCH v3 net-next 13/13] net: hns: net: hns: enet adds support of acpi Yisen Zhuang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20160601.160706.1959937095056503271.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Yisen.Zhuang@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=charles.chenxin@huawei.com \
    --cc=f.fainelli@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=haifeng.wei@huawei.com \
    --cc=ivecera@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
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).