diff mbox series

[u-boot-net,v3,01/14] net: mdio-uclass: fix type for phy_mode_str and phy_handle_str

Message ID 20220329200845.13435-2-kabel@kernel.org
State Superseded
Delegated to: Ramon Fried
Headers show
Series u-boot-net refactors, fixes, cleanups | expand

Commit Message

Marek Behún March 29, 2022, 8:08 p.m. UTC
From: Marek Behún <marek.behun@nic.cz>

These global variables should both have type
  static const char * const

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
---
 net/mdio-uclass.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Vladimir Oltean April 6, 2022, 1:12 p.m. UTC | #1
On Tue, Mar 29, 2022 at 10:08:32PM +0200, Marek Behún wrote:
> From: Marek Behún <marek.behun@nic.cz>
> 
> These global variables should both have type
>   static const char * const
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

>  net/mdio-uclass.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
> index e74e34f78f..5735afe49e 100644
> --- a/net/mdio-uclass.c
> +++ b/net/mdio-uclass.c
> @@ -17,13 +17,14 @@
>  
>  /* DT node properties for MAC-PHY interface */
>  #define PHY_MODE_STR_CNT	2
> -static const char *phy_mode_str[PHY_MODE_STR_CNT] = { "phy-mode",
> -						      "phy-connection-type" };
> +static const char * const phy_mode_str[PHY_MODE_STR_CNT] = {
> +	"phy-mode", "phy-connection-type"
> +};
>  /* DT node properties that reference a PHY node */
>  #define PHY_HANDLE_STR_CNT	3
> -const char *phy_handle_str[PHY_HANDLE_STR_CNT] = { "phy-handle",
> -						   "phy",
> -						   "phy-device" };
> +static const char * const phy_handle_str[PHY_HANDLE_STR_CNT] = {
> +	"phy-handle", "phy", "phy-device"
> +};
>  
>  void dm_mdio_probe_devices(void)
>  {
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
index e74e34f78f..5735afe49e 100644
--- a/net/mdio-uclass.c
+++ b/net/mdio-uclass.c
@@ -17,13 +17,14 @@ 
 
 /* DT node properties for MAC-PHY interface */
 #define PHY_MODE_STR_CNT	2
-static const char *phy_mode_str[PHY_MODE_STR_CNT] = { "phy-mode",
-						      "phy-connection-type" };
+static const char * const phy_mode_str[PHY_MODE_STR_CNT] = {
+	"phy-mode", "phy-connection-type"
+};
 /* DT node properties that reference a PHY node */
 #define PHY_HANDLE_STR_CNT	3
-const char *phy_handle_str[PHY_HANDLE_STR_CNT] = { "phy-handle",
-						   "phy",
-						   "phy-device" };
+static const char * const phy_handle_str[PHY_HANDLE_STR_CNT] = {
+	"phy-handle", "phy", "phy-device"
+};
 
 void dm_mdio_probe_devices(void)
 {