Commit a5c0d861 authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher

fm10k: reduce scope of *p local variable

Reduce the scope of the char *p local variable to only the block where
it is used.

This was detected by cppcheck and resolves the following style warning
produced by that tool:

[fm10k_ethtool.c:229]: (style) The scope of the variable 'p' can be
reduced.
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 30b1b498
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2013 - 2018 Intel Corporation. */ /* Copyright(c) 2013 - 2019 Intel Corporation. */
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
...@@ -222,7 +222,6 @@ static void __fm10k_add_ethtool_stats(u64 **data, void *pointer, ...@@ -222,7 +222,6 @@ static void __fm10k_add_ethtool_stats(u64 **data, void *pointer,
const unsigned int size) const unsigned int size)
{ {
unsigned int i; unsigned int i;
char *p;
if (!pointer) { if (!pointer) {
/* memory is not zero allocated so we have to clear it */ /* memory is not zero allocated so we have to clear it */
...@@ -232,7 +231,7 @@ static void __fm10k_add_ethtool_stats(u64 **data, void *pointer, ...@@ -232,7 +231,7 @@ static void __fm10k_add_ethtool_stats(u64 **data, void *pointer,
} }
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
p = (char *)pointer + stats[i].stat_offset; char *p = (char *)pointer + stats[i].stat_offset;
switch (stats[i].sizeof_stat) { switch (stats[i].sizeof_stat) {
case sizeof(u64): case sizeof(u64):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment