[openeuler:OLK-6.6 0/13] drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1151:19: sparse: sparse: cast to restricted __le16
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 52a3b0aa13aa2325ca2caf528fbcaba06ad3bab5 commit: eb673fa0fa02b70db5a6e93a9ea2087a11ffb37c [0/13] wifi: mt76: mt7921: fix country count limitation for CLC config: x86_64-randconfig-121-20251226 (https://download.01.org/0day-ci/archive/20251226/202512260835.0bNBpUcu-lkp@i...) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251226/202512260835.0bNBpUcu-lkp@i...) 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@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512260835.0bNBpUcu-lkp@intel.com/ sparse warnings: (new ones prefixed by >>)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1151:19: sparse: sparse: cast to restricted __le16 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:1151:19: sparse: sparse: cast from restricted __le32
vim +1151 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c 1119 1120 static 1121 int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2, 1122 enum environment_cap env_cap, 1123 struct mt7921_clc *clc, 1124 u8 idx) 1125 { 1126 struct sk_buff *skb; 1127 struct { 1128 u8 ver; 1129 u8 pad0; 1130 __le16 len; 1131 u8 idx; 1132 u8 env; 1133 u8 acpi_conf; 1134 u8 pad1; 1135 u8 alpha2[2]; 1136 u8 type[2]; 1137 u8 rsvd[64]; 1138 } __packed req = { 1139 .ver = 1, 1140 .idx = idx, 1141 .env = env_cap, 1142 .acpi_conf = mt792x_acpi_get_flags(&dev->phy), 1143 }; 1144 int ret, valid_cnt = 0; 1145 u16 buf_len = 0; 1146 u8 *pos; 1147 1148 if (!clc) 1149 return 0; 1150
1151 buf_len = le16_to_cpu(clc->len) - sizeof(*clc); 1152 pos = clc->data; 1153 while (buf_len > 16) { 1154 struct mt7921_clc_rule *rule = (struct mt7921_clc_rule *)pos; 1155 u16 len = le16_to_cpu(rule->len); 1156 u16 offset = len + sizeof(*rule); 1157 1158 pos += offset; 1159 buf_len -= offset; 1160 if (rule->alpha2[0] != alpha2[0] || 1161 rule->alpha2[1] != alpha2[1]) 1162 continue; 1163 1164 memcpy(req.alpha2, rule->alpha2, 2); 1165 memcpy(req.type, rule->type, 2); 1166 1167 req.len = cpu_to_le16(sizeof(req) + len); 1168 skb = __mt76_mcu_msg_alloc(&dev->mt76, &req, 1169 le16_to_cpu(req.len), 1170 sizeof(req), GFP_KERNEL); 1171 if (!skb) 1172 return -ENOMEM; 1173 skb_put_data(skb, rule->data, len); 1174 1175 ret = mt76_mcu_skb_send_msg(&dev->mt76, skb, 1176 MCU_CE_CMD(SET_CLC), false); 1177 if (ret < 0) 1178 return ret; 1179 valid_cnt++; 1180 } 1181 1182 if (!valid_cnt) 1183 return -ENOENT; 1184 1185 return 0; 1186 } 1187
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot