Skip to content

Commit

Permalink
mwifiex: use sizeof(array) to print_hex_dump_bytes
Browse files Browse the repository at this point in the history
DBG_CMD_NUM is the number of commands, not the actual bytes of
data for printing.

Also remove the duplicated DBG_CMD_NUM definition.

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Bing Zhao authored and John W. Linville committed Oct 19, 2012
1 parent 7a66205 commit f575f65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 7 additions & 4 deletions drivers/net/wireless/mwifiex/cmdevt.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,20 +918,23 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
dev_err(adapter->dev, "last_cmd_index = %d\n",
adapter->dbg.last_cmd_index);
print_hex_dump_bytes("last_cmd_id: ", DUMP_PREFIX_OFFSET,
adapter->dbg.last_cmd_id, DBG_CMD_NUM);
adapter->dbg.last_cmd_id,
sizeof(adapter->dbg.last_cmd_id));
print_hex_dump_bytes("last_cmd_act: ", DUMP_PREFIX_OFFSET,
adapter->dbg.last_cmd_act, DBG_CMD_NUM);
adapter->dbg.last_cmd_act,
sizeof(adapter->dbg.last_cmd_act));

dev_err(adapter->dev, "last_cmd_resp_index = %d\n",
adapter->dbg.last_cmd_resp_index);
print_hex_dump_bytes("last_cmd_resp_id: ", DUMP_PREFIX_OFFSET,
adapter->dbg.last_cmd_resp_id,
DBG_CMD_NUM);
sizeof(adapter->dbg.last_cmd_resp_id));

dev_err(adapter->dev, "last_event_index = %d\n",
adapter->dbg.last_event_index);
print_hex_dump_bytes("last_event: ", DUMP_PREFIX_OFFSET,
adapter->dbg.last_event, DBG_CMD_NUM);
adapter->dbg.last_event,
sizeof(adapter->dbg.last_event));

dev_err(adapter->dev, "data_sent=%d cmd_sent=%d\n",
adapter->data_sent, adapter->cmd_sent);
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/mwifiex/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ enum {
#define MWIFIEX_TYPE_DATA 0
#define MWIFIEX_TYPE_EVENT 3

#define DBG_CMD_NUM 5

#define MAX_BITMAP_RATES_SIZE 10

#define MAX_CHANNEL_BAND_BG 14
Expand Down

0 comments on commit f575f65

Please sign in to comment.