Skip to content

Commit 048578a

Browse files
GustavoARSilvadavem330
authored andcommitted
qlcnic: remove unnecessary static in qlcnic_dump_fw()
Remove unnecessary static on local variable fw_dump_ops. Such variable is initialized before being used, on every execution path throughout the function. The static has no benefit and, removing it reduces the object file size. This issue was detected using Coccinelle and the following semantic patch: @bad exists@ position p; identifier x; type T; @@ static T x@p; ... x = <+...x...+> @@ identifier x; expression e; type T; position p != bad.p; @@ -static T x@p; ... when != x when strict ?x = e; In the following log you can see a difference in the object file size. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 19032 2136 64 21232 52f0 drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.o after: text data bss dec hex filename 19020 2048 0 21068 524c drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.o Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 648e8b8 commit 048578a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
12851285
int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
12861286
{
12871287
struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
1288-
static const struct qlcnic_dump_operations *fw_dump_ops;
1288+
const struct qlcnic_dump_operations *fw_dump_ops;
12891289
struct qlcnic_83xx_dump_template_hdr *hdr_83xx;
12901290
u32 entry_offset, dump, no_entries, buf_offset = 0;
12911291
int i, k, ops_cnt, ops_index, dump_size = 0;

0 commit comments

Comments
 (0)