History

media: wl128x: fix a clang warning

Clang-16 produces this warning, which is fatal with CONFIG_WERROR: ../drivers/media/radio/wl128x/fmdrv_common.c:1237:19: error: variable 'cmd_cnt' set but not used [-Werror,-Wunused-but-set-variable] int ret, fw_len, cmd_cnt; ^ 1 error generated. What happens is that cmd_cnt tracks the amount of firmware data packets were transfered, which is printed only when debug is used. Switch to use the firmware count, as the message is all about reporting a partial firmware transfer. Link: https://lore.kernel.org/linux-media/6badd27ebfa718d5737f517f18b29a3e0f6e43f8.1687981726.git.mchehab@kernel.org

Mauro Carvalho Chehab committed 3 years ago

Commit c61480a1 parent 190e2e11 file · +2 −4Browse files

Unified · Split

drivers/media/radio/wl128x/fmdrv_common.c+2−4
@@ -1234,9 +1234,8 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) · 1233 unmodified lines
1234 struct bts_action *action;1234 struct bts_action *action;
1235 struct bts_action_delay *delay;1235 struct bts_action_delay *delay;
1236 u8 *fw_data;1236 u8 *fw_data;
1237 int ret, fw_len, cmd_cnt;1237 int ret, fw_len;
1238 1238
1239 cmd_cnt = 0;
1240 set_bit(FM_FW_DW_INPROGRESS, &fmdev->flag);1239 set_bit(FM_FW_DW_INPROGRESS, &fmdev->flag);
1241 1240
1242 ret = request_firmware(&fw_entry, fw_name,1241 ret = request_firmware(&fw_entry, fw_name,
@@ -1272,7 +1271,6 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) · 29 unmodified lines
1272 if (ret)1271 if (ret)
1273 goto rel_fw;1272 goto rel_fw;
1274 1273
1275 cmd_cnt++;
1276 break;1274 break;
1277 1275
1278 case ACTION_DELAY: /* Delay */1276 case ACTION_DELAY: /* Delay */
@@ -1284,7 +1282,7 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) · 5 unmodified lines
1284 fw_data += (sizeof(struct bts_action) + (action->size));1282 fw_data += (sizeof(struct bts_action) + (action->size));
1285 fw_len -= (sizeof(struct bts_action) + (action->size));1283 fw_len -= (sizeof(struct bts_action) + (action->size));
1286 }1284 }
1287 fmdbg("Firmware commands(%d) loaded to chip\n", cmd_cnt);1285 fmdbg("Transfered only %d of %d bytes of the firmware to chip\n", fw_entry->size - fw_len, fw_entry->size);
1288rel_fw:1286rel_fw:
1289 release_firmware(fw_entry);1287 release_firmware(fw_entry);
1290 clear_bit(FM_FW_DW_INPROGRESS, &fmdev->flag);1288 clear_bit(FM_FW_DW_INPROGRESS, &fmdev->flag);