From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew@lunn.ch (Andrew Lunn) Date: Mon, 6 Feb 2017 14:48:08 +0100 Subject: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices In-Reply-To: <20170204210245.14812-4-f.fainelli@gmail.com> References: <20170204210245.14812-1-f.fainelli@gmail.com> <20170204210245.14812-4-f.fainelli@gmail.com> Message-ID: <20170206134808.GG32506@lunn.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org > 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. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbdBFNsV (ORCPT ); Mon, 6 Feb 2017 08:48:21 -0500 Received: from vps0.lunn.ch ([178.209.37.122]:56715 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbdBFNsT (ORCPT ); Mon, 6 Feb 2017 08:48:19 -0500 Date: Mon, 6 Feb 2017 14:48:08 +0100 From: Andrew Lunn To: Florian Fainelli Cc: netdev@vger.kernel.org, Jason Cooper , Sebastian Hesselbarth , Gregory Clement , Russell King , Vivien Didelot , "David S. Miller" , "moderated list:ARM/Marvell Dove/MV78xx0/Orion SOC support" , open list Subject: Re: [PATCH net-next v5 3/4] net: phy: Allow pre-declaration of MDIO devices Message-ID: <20170206134808.GG32506@lunn.ch> References: <20170204210245.14812-1-f.fainelli@gmail.com> <20170204210245.14812-4-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170204210245.14812-4-f.fainelli@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. Andrew