Hi Igor, Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master] url: https://github.com/0day-ci/linux/commits/Igor-Russkikh/net-aquantia-PTP-support-for-AQC-devices/20191023-194531 base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 88652bf8ce4b91c49769a2a49c17dc44b85b4fa2 reproduce: # apt-get install sparse # sparse version: v0.6.1-dirty make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot <l...@intel.com> sparse warnings: (new ones prefixed by >>) drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:794:45: sparse: sparse: cast to restricted __le16 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1201:15: sparse: >> sparse: cast to restricted __be64 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1202:14: sparse: >> sparse: cast to restricted __be32 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1202:14: sparse: >> sparse: cast to restricted __be32 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1202:14: sparse: >> sparse: cast to restricted __be32 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1202:14: sparse: >> sparse: cast to restricted __be32 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1202:14: sparse: >> sparse: cast to restricted __be32 >> drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c:1202:14: sparse: >> sparse: cast to restricted __be32 vim +1201 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c 1175 1176 static u16 hw_atl_b0_rx_extract_ts(struct aq_hw_s *self, u8 *p, 1177 unsigned int len, u64 *timestamp) 1178 { 1179 unsigned int offset = 14; 1180 struct ethhdr *eth; 1181 u64 sec; 1182 u8 *ptr; 1183 u32 ns; 1184 1185 if (len <= offset || !timestamp) 1186 return 0; 1187 1188 /* The TIMESTAMP in the end of package has following format: 1189 * (big-endian) 1190 * struct { 1191 * uint64_t sec; 1192 * uint32_t ns; 1193 * uint16_t stream_id; 1194 * }; 1195 */ 1196 ptr = p + (len - offset); 1197 memcpy(&sec, ptr, sizeof(sec)); 1198 ptr += sizeof(sec); 1199 memcpy(&ns, ptr, sizeof(ns)); 1200 > 1201 sec = be64_to_cpu(sec) & 0xffffffffffffllu; > 1202 ns = be32_to_cpu(ns); 1203 *timestamp = sec * NSEC_PER_SEC + ns + self->ptp_clk_offset; 1204 1205 eth = (struct ethhdr *)p; 1206 1207 return (eth->h_proto == htons(ETH_P_1588)) ? 12 : 14; 1208 } 1209 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation