Re: [PATCH net-next 3/3] net: phy: microchip_rds_ptp : Add PEROUT feature library for RDS PTP supported phys

From: Dan Carpenter
Date: Tue Jan 07 2025 - 02:10:57 EST


Hi Divya,

kernel test robot noticed the following build warnings:

url: https://github.com/intel-lab-lkp/linux/commits/Divya-Koppera/net-phy-microchip_rds_ptp-Header-file-library-changes-for-PEROUT/20250103-171126
base: net-next/main
patch link: https://lore.kernel.org/r/20250103090731.1355-4-divya.koppera%40microchip.com
patch subject: [PATCH net-next 3/3] net: phy: microchip_rds_ptp : Add PEROUT feature library for RDS PTP supported phys
config: arm64-randconfig-r072-20250107 (https://download.01.org/0day-ci/archive/20250107/202501071428.F9gIQY3T-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 096551537b2a747a3387726ca618ceeb3950e9bc)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202501071428.F9gIQY3T-lkp@xxxxxxxxx/

smatch warnings:
drivers/net/phy/microchip_rds_ptp.c:247 mchp_rds_ptp_perout_off() error: uninitialized symbol 'event'.

vim +/event +247 drivers/net/phy/microchip_rds_ptp.c

568c86a861124f Divya Koppera 2025-01-03 228 static int mchp_rds_ptp_perout_off(struct mchp_rds_ptp_clock *clock,
568c86a861124f Divya Koppera 2025-01-03 229 s8 gpio_pin)
568c86a861124f Divya Koppera 2025-01-03 230 {
568c86a861124f Divya Koppera 2025-01-03 231 u16 general_config;
568c86a861124f Divya Koppera 2025-01-03 232 int event;
568c86a861124f Divya Koppera 2025-01-03 233 int rc;
568c86a861124f Divya Koppera 2025-01-03 234
568c86a861124f Divya Koppera 2025-01-03 235 if (clock->mchp_rds_ptp_event_a == gpio_pin)
568c86a861124f Divya Koppera 2025-01-03 236 event = MCHP_RDS_PTP_EVT_A;
568c86a861124f Divya Koppera 2025-01-03 237 else if (clock->mchp_rds_ptp_event_b == gpio_pin)
568c86a861124f Divya Koppera 2025-01-03 238 event = MCHP_RDS_PTP_EVT_B;

What about: else return -EINVAL;?

568c86a861124f Divya Koppera 2025-01-03 239
568c86a861124f Divya Koppera 2025-01-03 240 /* Set target to too far in the future, effectively disabling it */
568c86a861124f Divya Koppera 2025-01-03 241 rc = mchp_set_clock_target(clock, gpio_pin, 0xFFFFFFFF, 0);
568c86a861124f Divya Koppera 2025-01-03 242 if (rc < 0)
568c86a861124f Divya Koppera 2025-01-03 243 return rc;
568c86a861124f Divya Koppera 2025-01-03 244
568c86a861124f Divya Koppera 2025-01-03 245 general_config = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_GEN_CFG,
568c86a861124f Divya Koppera 2025-01-03 246 MCHP_RDS_PTP_CLOCK);
568c86a861124f Divya Koppera 2025-01-03 @247 general_config |= MCHP_RDS_PTP_GEN_CFG_RELOAD_ADD_X_(event);
568c86a861124f Divya Koppera 2025-01-03 248 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_GEN_CFG,
568c86a861124f Divya Koppera 2025-01-03 249 MCHP_RDS_PTP_CLOCK, general_config);
568c86a861124f Divya Koppera 2025-01-03 250 if (rc < 0)
568c86a861124f Divya Koppera 2025-01-03 251 return rc;
568c86a861124f Divya Koppera 2025-01-03 252
568c86a861124f Divya Koppera 2025-01-03 253 if (event == MCHP_RDS_PTP_EVT_A)
568c86a861124f Divya Koppera 2025-01-03 254 clock->mchp_rds_ptp_event_a = -1;
568c86a861124f Divya Koppera 2025-01-03 255
568c86a861124f Divya Koppera 2025-01-03 256 if (event == MCHP_RDS_PTP_EVT_B)
568c86a861124f Divya Koppera 2025-01-03 257 clock->mchp_rds_ptp_event_b = -1;
568c86a861124f Divya Koppera 2025-01-03 258
568c86a861124f Divya Koppera 2025-01-03 259 return 0;
568c86a861124f Divya Koppera 2025-01-03 260 }

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki