Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1412129
| From | Yisen Zhuang <Yisen.zhuang@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 net-next 03/13] net: hisilicon: cleanup to prepare for other cases |
| Date | 2016-06-02 13:10 +0200 |
| Message-ID | <rFyFI-5bR-11@gated-at.bofh.it> (permalink) |
| References | <rEukN-44d-7@gated-at.bofh.it> <rEukO-44d-23@gated-at.bofh.it> <rFnqV-6zm-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 <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.
>
> .
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v3 net-next 03/13] net: hisilicon: cleanup to prepare for other cases David Miller <davem@davemloft.net> - 2016-06-02 01:10 +0200 Re: [PATCH v3 net-next 03/13] net: hisilicon: cleanup to prepare for other cases Yisen Zhuang <Yisen.zhuang@huawei.com> - 2016-06-02 13:10 +0200
csiph-web