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
12341234 struct bts_action *action;
12351235 struct bts_action_delay *delay;
12361236 u8 *fw_data;
1237− int ret, fw_len, cmd_cnt;
1237+ int ret, fw_len;
12381238
1239− cmd_cnt = 0;
12401239 set_bit(FM_FW_DW_INPROGRESS, &fmdev->flag);
12411240
12421241 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
12721271 if (ret)
12731272 goto rel_fw;
12741273
1275− cmd_cnt++;
12761274 break;
12771275
12781276 case ACTION_DELAY: /* Delay */
@@ -1284,7 +1282,7 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name) · 5 unmodified lines
12841282 fw_data += (sizeof(struct bts_action) + (action->size));
12851283 fw_len -= (sizeof(struct bts_action) + (action->size));
12861284 }
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);
12881286 rel_fw:
12891287 release_firmware(fw_entry);
12901288 clear_bit(FM_FW_DW_INPROGRESS, &fmdev->flag);