drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: sparse: incorrect type in argument 1 (different base types)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 86852175b016f0c6873dcbc24b93d12b7b246612 commit: 81b055205e8ba2d400c8fa5845ba540a4a880a3a igc: Add support for RX timestamping date: 5 months ago config: i386-randconfig-s002-20200531 (attached as .config) compiler: gcc-9 (Debian 9.3.0-13) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.1-243-gc100a7ab-dirty git checkout 81b055205e8ba2d400c8fa5845ba540a4a880a3a # save the attached .config to linux build tree make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) >> drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: sparse: incorrect >> type in argument 1 (different base types) @@ expected unsigned int val >> @@ got restricted __be16 [usertype] @@ drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: expected unsigned int val drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: got restricted __be16 [usertype] drivers/net/ethernet/intel/igc/igc_ptp.c:415:6: sparse: sparse: symbol 'igc_ptp_tx_hang' was not declared. Should it be static? drivers/net/ethernet/intel/igc/igc_ptp.c:445:6: sparse: sparse: symbol 'igc_ptp_tx_work' was not declared. Should it be static? drivers/net/ethernet/intel/igc/igc_ptp.c:549:6: sparse: sparse: symbol 'igc_ptp_suspend' was not declared. Should it be static? vim +397 drivers/net/ethernet/intel/igc/igc_ptp.c 281 282 /** 283 * igc_ptp_set_timestamp_mode - setup hardware for timestamping 284 * @adapter: networking device structure 285 * @config: hwtstamp configuration 286 * 287 * Incoming time stamping has to be configured via the hardware 288 * filters. Not all combinations are supported, in particular event 289 * type has to be specified. Matching the kind of event packet is 290 * not supported, with the exception of "all V2 events regardless of 291 * level 2 or 4". 292 * 293 */ 294 static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter, 295struct hwtstamp_config *config) 296 { 297 u32 tsync_rx_ctl = IGC_TSYNCRXCTL_ENABLED; 298 struct igc_hw *hw = >hw; 299 u32 tsync_rx_cfg = 0; 300 bool is_l4 = false; 301 bool is_l2 = false; 302 u32 regval; 303 304 /* reserved for future extensions */ 305 if (config->flags) 306 return -EINVAL; 307 308 switch (config->rx_filter) { 309 case HWTSTAMP_FILTER_NONE: 310 tsync_rx_ctl = 0; 311 break; 312 case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: 313 tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_L4_V1; 314 tsync_rx_cfg = IGC_TSYNCRXCFG_PTP_V1_SYNC_MESSAGE; 315 is_l4 = true; 316 break; 317 case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: 318 tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_L4_V1; 319 tsync_rx_cfg = IGC_TSYNCRXCFG_PTP_V1_DELAY_REQ_MESSAGE; 320 is_l4 = true; 321 break; 322 case HWTSTAMP_FILTER_PTP_V2_EVENT: 323 case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: 324 case HWTSTAMP_FILTER_PTP_V2_L4_EVENT: 325 case HWTSTAMP_FILTER_PTP_V2_SYNC: 326 case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: 327 case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: 328 case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: 329 case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: 330 case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: 331 tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_EVENT_V2; 332 config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; 333 is_l2 = true; 334 is_l4 = true; 335 break; 336 case HWTSTAMP_FILTER_PTP_V1_L4_EVENT: 337 case HWTSTAMP_FILTER_NTP_ALL: 338 case HWTSTAMP_FILTER_ALL: 339 tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_ALL; 340 config->rx_filter = HWTSTAMP_FILTER_ALL; 341 break; 342 /* fall through */ 343 default: 344 config->rx_filter = HWTSTAMP_FILTER_NONE; 345 return -ERANGE; 346 } 347 348 /* Per-packet timestamping only works if all packets are 349 * timestamped, so enable timestamping in all packets as long 350 * as one Rx filter was configured. 351 */ 352 if (tsync_rx_ctl) { 353
drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: sparse: incorrect type in argument 1 (different base types)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 444fc5cde64330661bf59944c43844e7d4c2ccd8 commit: 81b055205e8ba2d400c8fa5845ba540a4a880a3a igc: Add support for RX timestamping date: 5 months ago config: ia64-randconfig-s032-20200527 (attached as .config) compiler: ia64-linux-gcc (GCC) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.1-240-gf0fe1cd9-dirty git checkout 81b055205e8ba2d400c8fa5845ba540a4a880a3a # save the attached .config to linux build tree make W=1 C=1 ARCH=ia64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) ./arch/ia64/include/generated/uapi/asm/unistd_64.h:348:39: sparse: sparse: no newline at end of file >> drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: sparse: incorrect >> type in argument 1 (different base types) @@ expected unsigned int >> [usertype] value @@ got restricted __be16 [usertype] @@ >> drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: expected >> unsigned int [usertype] value drivers/net/ethernet/intel/igc/igc_ptp.c:397:17: sparse: got restricted __be16 [usertype] drivers/net/ethernet/intel/igc/igc_ptp.c:415:6: sparse: sparse: symbol 'igc_ptp_tx_hang' was not declared. Should it be static? drivers/net/ethernet/intel/igc/igc_ptp.c:445:6: sparse: sparse: symbol 'igc_ptp_tx_work' was not declared. Should it be static? drivers/net/ethernet/intel/igc/igc_ptp.c:549:6: sparse: sparse: symbol 'igc_ptp_suspend' was not declared. Should it be static? include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype] include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@ include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usert