Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1575073
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices |
| Date | 2017-02-06 20:10 +0100 |
| Message-ID | <t7WPM-DN-13@gated-at.bofh.it> (permalink) |
| References | <t7fKN-6bt-3@gated-at.bofh.it> <t7fKN-6bt-15@gated-at.bofh.it> <t7RQ8-5AW-65@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 02/06/2017 05:48 AM, Andrew Lunn wrote:
>> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
>> index 8a57f0b1242d..8850fcaf50db 100644
>> --- a/include/linux/mod_devicetable.h
>> +++ b/include/linux/mod_devicetable.h
>> @@ -501,6 +501,7 @@ struct platform_device_id {
>> kernel_ulong_t driver_data;
>> };
>>
>> +#define MDIO_NAME_SIZE 32
>
> ...
>
>> +struct mdio_board_info {
>> + const char *bus_id;
>> + char modalias[MDIO_NAME_SIZE];
>> +
>
> I think it might be better to use MII_BUS_ID_SIZE. These are all
> related, so using one define should avoid surprise buffer overruns,
> truncation's.
I considered doing that, but left it that way because I valued the
"const" qualifier more than running out of buffer space. What I could do
though, is change the strcmp() in drivers/net/phy/mdio-boardinfo.c to be
bound by MII_BUS_ID_SIZE.
--
Florian
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next v5 0/4] net: dsa: Support for pdata in dsa2 Florian Fainelli <f.fainelli@gmail.com> - 2017-02-04 22:10 +0100
[PATCH net-next v5 2/4] net: dsa: Add support for platform data Florian Fainelli <f.fainelli@gmail.com> - 2017-02-04 22:10 +0100
[PATCH net-next v5 4/4] ARM: orion: Register DSA switch as a MDIO device Florian Fainelli <f.fainelli@gmail.com> - 2017-02-04 22:10 +0100
[PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices Florian Fainelli <f.fainelli@gmail.com> - 2017-02-04 22:10 +0100
Re: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices Andrew Lunn <andrew@lunn.ch> - 2017-02-06 14:50 +0100
Re: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices Florian Fainelli <f.fainelli@gmail.com> - 2017-02-06 20:10 +0100
Re: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices Andrew Lunn <andrew@lunn.ch> - 2017-02-06 15:10 +0100
Re: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices Florian Fainelli <f.fainelli@gmail.com> - 2017-02-06 20:20 +0100
[PATCH net-next v5 1/4] net: dsa: Rename and export dev_to_net_device() Florian Fainelli <f.fainelli@gmail.com> - 2017-02-04 22:10 +0100
csiph-web