Skip to content

Commit c61480a

Browse files
committed
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 Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 190e2e1 commit c61480a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/radio/wl128x/fmdrv_common.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,9 +1234,8 @@ static int fm_download_firmware(struct fmdev *fmdev, const u8 *fw_name)
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)
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)
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);

0 commit comments

Comments
 (0)