]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: ti: icss-iep: Fix incorrect type for return value in extts_enable()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 5 Aug 2025 14:23:18 +0000 (07:23 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Aug 2025 19:54:54 +0000 (12:54 -0700)
The variable ret in icss_iep_extts_enable() was incorrectly declared
as u32, while the function returns int and may return negative error
codes. This will cause sign extension issues and incorrect error
propagation. Update ret to be int to fix error handling.

This change corrects the declaration to avoid potential type mismatch.

Fixes: c1e0230eeaab ("net: ti: icss-iep: Add IEP driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250805142323.1949406-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/icssg/icss_iep.c

index 50bfbc2779e473975d9104b4b63d94a1b3055da1..d8c9fe1d98c475e546db2b34f2e794584fe2d650 100644 (file)
@@ -621,7 +621,8 @@ exit:
 
 static int icss_iep_extts_enable(struct icss_iep *iep, u32 index, int on)
 {
-       u32 val, cap, ret = 0;
+       u32 val, cap;
+       int ret = 0;
 
        mutex_lock(&iep->ptp_clk_mutex);