[net-next,v7,1/4] net: phy: make addr type u8 in phy_package_shared struct

Message ID 20231214121026.4340-2-ansuelsmth@gmail.com
State New
Headers
Series net: phy: add PHY package base addr + mmd APIs |

Commit Message

Christian Marangi Dec. 14, 2023, 12:10 p.m. UTC
  Switch addr type in phy_package_shared struct to u8.

The value is already checked to be non negative and to be less than
PHY_MAX_ADDR, hence u8 is better suited than using int.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
Changes v7:
- Add this patch

 include/linux/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Russell King (Oracle) Dec. 14, 2023, 4:56 p.m. UTC | #1
On Thu, Dec 14, 2023 at 01:10:23PM +0100, Christian Marangi wrote:
> Switch addr type in phy_package_shared struct to u8.
> 
> The value is already checked to be non negative and to be less than
> PHY_MAX_ADDR, hence u8 is better suited than using int.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!
  

Patch

diff --git a/include/linux/phy.h b/include/linux/phy.h
index e5f1f41e399c..e5e29fca4d17 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -338,7 +338,7 @@  struct mdio_bus_stats {
  * phy_package_leave().
  */
 struct phy_package_shared {
-	int addr;
+	u8 addr;
 	refcount_t refcnt;
 	unsigned long flags;
 	size_t priv_size;