Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/3] Fix clang -Wunused-but-set-variable warnings
@ 2021-07-14 9:17 Bill Wendling
2021-07-14 9:17 ` [PATCH 1/3] base: remove unused variable 'no_warn' Bill Wendling
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Bill Wendling @ 2021-07-14 9:17 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
These patches clean up warnings from clang's '-Wunused-but-set-variable' flag.
Bill Wendling (3):
base: remove unused variable 'no_warn'
bnx2x: remove unused variable 'cur_data_offset'
scsi: qla2xxx: remove unused variable 'status'
drivers/base/module.c | 6 ++----
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 6 ------
drivers/scsi/qla2xxx/qla_nx.c | 2 --
3 files changed, 2 insertions(+), 12 deletions(-)
--
2.32.0.93.g670b81a890-goog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/3] base: remove unused variable 'no_warn'
2021-07-14 9:17 [PATCH 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
@ 2021-07-14 9:17 ` Bill Wendling
2021-07-14 12:15 ` kernel test robot
2021-07-14 9:17 ` [PATCH 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Bill Wendling @ 2021-07-14 9:17 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
Fix the following build warning:
drivers/base/module.c:36:6: error: variable 'no_warn' set but not used [-Werror,-Wunused-but-set-variable]
int no_warn;
Signed-off-by: Bill Wendling <morbo@google.com>
---
drivers/base/module.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/base/module.c b/drivers/base/module.c
index 46ad4d636731..81d84a066a38 100644
--- a/drivers/base/module.c
+++ b/drivers/base/module.c
@@ -33,7 +33,6 @@ static void module_create_drivers_dir(struct module_kobject *mk)
void module_add_driver(struct module *mod, struct device_driver *drv)
{
char *driver_name;
- int no_warn;
struct module_kobject *mk = NULL;
if (!drv)
@@ -59,12 +58,11 @@ void module_add_driver(struct module *mod, struct device_driver *drv)
return;
/* Don't check return codes; these calls are idempotent */
- no_warn = sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
+ sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
driver_name = make_driver_name(drv);
if (driver_name) {
module_create_drivers_dir(mk);
- no_warn = sysfs_create_link(mk->drivers_dir, &drv->p->kobj,
- driver_name);
+ sysfs_create_link(mk->drivers_dir, &drv->p->kobj, driver_name);
kfree(driver_name);
}
}
--
2.32.0.93.g670b81a890-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/3] bnx2x: remove unused variable 'cur_data_offset'
2021-07-14 9:17 [PATCH 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
2021-07-14 9:17 ` [PATCH 1/3] base: remove unused variable 'no_warn' Bill Wendling
@ 2021-07-14 9:17 ` Bill Wendling
2021-07-14 9:17 ` [PATCH 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
3 siblings, 0 replies; 12+ messages in thread
From: Bill Wendling @ 2021-07-14 9:17 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
Fix the clang build warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1862:13: error: variable 'cur_data_offset' set but not used [-Werror,-Wunused-but-set-variable]
dma_addr_t cur_data_offset;
Signed-off-by: Bill Wendling <morbo@google.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 27943b0446c2..f255fd0b16db 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -1858,7 +1858,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
{
int i;
int first_queue_query_index, num_queues_req;
- dma_addr_t cur_data_offset;
struct stats_query_entry *cur_query_entry;
u8 stats_count = 0;
bool is_fcoe = false;
@@ -1879,10 +1878,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
BNX2X_NUM_ETH_QUEUES(bp), is_fcoe, first_queue_query_index,
first_queue_query_index + num_queues_req);
- cur_data_offset = bp->fw_stats_data_mapping +
- offsetof(struct bnx2x_fw_stats_data, queue_stats) +
- num_queues_req * sizeof(struct per_queue_stats);
-
cur_query_entry = &bp->fw_stats_req->
query[first_queue_query_index + num_queues_req];
@@ -1933,7 +1928,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
cur_query_entry->funcID,
j, cur_query_entry->index);
cur_query_entry++;
- cur_data_offset += sizeof(struct per_queue_stats);
stats_count++;
/* all stats are coalesced to the leading queue */
--
2.32.0.93.g670b81a890-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] scsi: qla2xxx: remove unused variable 'status'
2021-07-14 9:17 [PATCH 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
2021-07-14 9:17 ` [PATCH 1/3] base: remove unused variable 'no_warn' Bill Wendling
2021-07-14 9:17 ` [PATCH 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
@ 2021-07-14 9:17 ` Bill Wendling
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
3 siblings, 0 replies; 12+ messages in thread
From: Bill Wendling @ 2021-07-14 9:17 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
Fix the clang build warning:
drivers/scsi/qla2xxx/qla_nx.c:2209:6: error: variable 'status' set but not used [-Werror,-Wunused-but-set-variable]
int status = 0;
Signed-off-by: Bill Wendling <morbo@google.com>
---
drivers/scsi/qla2xxx/qla_nx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 615e44af1ca6..11aad97dfca8 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -2166,7 +2166,6 @@ qla82xx_poll(int irq, void *dev_id)
struct qla_hw_data *ha;
struct rsp_que *rsp;
struct device_reg_82xx __iomem *reg;
- int status = 0;
uint32_t stat;
uint32_t host_int = 0;
uint16_t mb[8];
@@ -2195,7 +2194,6 @@ qla82xx_poll(int irq, void *dev_id)
case 0x10:
case 0x11:
qla82xx_mbx_completion(vha, MSW(stat));
- status |= MBX_INTERRUPT;
break;
case 0x12:
mb[0] = MSW(stat);
--
2.32.0.93.g670b81a890-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] base: remove unused variable 'no_warn'
2021-07-14 9:17 ` [PATCH 1/3] base: remove unused variable 'no_warn' Bill Wendling
@ 2021-07-14 12:15 ` kernel test robot
0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2021-07-14 12:15 UTC (permalink / raw)
To: Bill Wendling, linux-kernel, netdev, linux-scsi,
clang-built-linux, Nathan Chancellor, Nick Desaulniers,
Ariel Elior, Sudarsana Kalluru, GR-everest-linux-l2,
David S . Miller
Cc: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3478 bytes --]
Hi Bill,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on scsi/for-next]
[also build test WARNING on linux/master driver-core/driver-core-testing mkp-scsi/for-next ipvs/master linus/master v5.14-rc1 next-20210714]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Bill-Wendling/Fix-clang-Wunused-but-set-variable-warnings/20210714-172029
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: powerpc-redwood_defconfig (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/f6c4b007fc8c907719d883faae424f2cf3bb100c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bill-Wendling/Fix-clang-Wunused-but-set-variable-warnings/20210714-172029
git checkout f6c4b007fc8c907719d883faae424f2cf3bb100c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/base/module.c: In function 'module_add_driver':
>> drivers/base/module.c:61:2: warning: ignoring return value of 'sysfs_create_link', declared with attribute warn_unused_result [-Wunused-result]
61 | sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/base/module.c:65:3: warning: ignoring return value of 'sysfs_create_link', declared with attribute warn_unused_result [-Wunused-result]
65 | sysfs_create_link(mk->drivers_dir, &drv->p->kobj, driver_name);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/sysfs_create_link +61 drivers/base/module.c
32
33 void module_add_driver(struct module *mod, struct device_driver *drv)
34 {
35 char *driver_name;
36 struct module_kobject *mk = NULL;
37
38 if (!drv)
39 return;
40
41 if (mod)
42 mk = &mod->mkobj;
43 else if (drv->mod_name) {
44 struct kobject *mkobj;
45
46 /* Lookup built-in module entry in /sys/modules */
47 mkobj = kset_find_obj(module_kset, drv->mod_name);
48 if (mkobj) {
49 mk = container_of(mkobj, struct module_kobject, kobj);
50 /* remember our module structure */
51 drv->p->mkobj = mk;
52 /* kset_find_obj took a reference */
53 kobject_put(mkobj);
54 }
55 }
56
57 if (!mk)
58 return;
59
60 /* Don't check return codes; these calls are idempotent */
> 61 sysfs_create_link(&drv->p->kobj, &mk->kobj, "module");
62 driver_name = make_driver_name(drv);
63 if (driver_name) {
64 module_create_drivers_dir(mk);
65 sysfs_create_link(mk->drivers_dir, &drv->p->kobj, driver_name);
66 kfree(driver_name);
67 }
68 }
69
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 14516 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings
2021-07-14 9:17 [PATCH 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
` (2 preceding siblings ...)
2021-07-14 9:17 ` [PATCH 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
@ 2021-07-26 20:19 ` Bill Wendling
2021-07-26 20:19 ` [PATCH v2 1/3] base: mark 'no_warn' as unused Bill Wendling
` (3 more replies)
3 siblings, 4 replies; 12+ messages in thread
From: Bill Wendling @ 2021-07-26 20:19 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
These patches clean up warnings from clang's '-Wunused-but-set-variable' flag.
Changes for v2:
- Mark "no_warn" as "__maybe_unused" to avoid separate warning.
Bill Wendling (3):
base: mark 'no_warn' as unused
bnx2x: remove unused variable 'cur_data_offset'
scsi: qla2xxx: remove unused variable 'status'
drivers/base/module.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 6 ------
drivers/scsi/qla2xxx/qla_nx.c | 2 --
3 files changed, 1 insertion(+), 9 deletions(-)
--
2.32.0.432.gabb21c7263-goog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/3] base: mark 'no_warn' as unused
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
@ 2021-07-26 20:19 ` Bill Wendling
2021-07-26 20:19 ` [PATCH v2 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Bill Wendling @ 2021-07-26 20:19 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
Fix the following build warning:
drivers/base/module.c:36:6: error: variable 'no_warn' set but not used [-Werror,-Wunused-but-set-variable]
int no_warn;
This variable is used to remove another warning, but causes a warning
itself. Mark it as 'unused' to avoid that.
Signed-off-by: Bill Wendling <morbo@google.com>
---
drivers/base/module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/module.c b/drivers/base/module.c
index 46ad4d636731..10494336d601 100644
--- a/drivers/base/module.c
+++ b/drivers/base/module.c
@@ -33,7 +33,7 @@ static void module_create_drivers_dir(struct module_kobject *mk)
void module_add_driver(struct module *mod, struct device_driver *drv)
{
char *driver_name;
- int no_warn;
+ int __maybe_unused no_warn;
struct module_kobject *mk = NULL;
if (!drv)
--
2.32.0.432.gabb21c7263-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/3] bnx2x: remove unused variable 'cur_data_offset'
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
2021-07-26 20:19 ` [PATCH v2 1/3] base: mark 'no_warn' as unused Bill Wendling
@ 2021-07-26 20:19 ` Bill Wendling
2021-07-26 20:36 ` Nathan Chancellor
2021-07-26 20:19 ` [PATCH v2 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
2021-07-29 3:38 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Martin K. Petersen
3 siblings, 1 reply; 12+ messages in thread
From: Bill Wendling @ 2021-07-26 20:19 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
Fix the clang build warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1862:13: error: variable 'cur_data_offset' set but not used [-Werror,-Wunused-but-set-variable]
dma_addr_t cur_data_offset;
Signed-off-by: Bill Wendling <morbo@google.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 27943b0446c2..f255fd0b16db 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -1858,7 +1858,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
{
int i;
int first_queue_query_index, num_queues_req;
- dma_addr_t cur_data_offset;
struct stats_query_entry *cur_query_entry;
u8 stats_count = 0;
bool is_fcoe = false;
@@ -1879,10 +1878,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
BNX2X_NUM_ETH_QUEUES(bp), is_fcoe, first_queue_query_index,
first_queue_query_index + num_queues_req);
- cur_data_offset = bp->fw_stats_data_mapping +
- offsetof(struct bnx2x_fw_stats_data, queue_stats) +
- num_queues_req * sizeof(struct per_queue_stats);
-
cur_query_entry = &bp->fw_stats_req->
query[first_queue_query_index + num_queues_req];
@@ -1933,7 +1928,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
cur_query_entry->funcID,
j, cur_query_entry->index);
cur_query_entry++;
- cur_data_offset += sizeof(struct per_queue_stats);
stats_count++;
/* all stats are coalesced to the leading queue */
--
2.32.0.432.gabb21c7263-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 3/3] scsi: qla2xxx: remove unused variable 'status'
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
2021-07-26 20:19 ` [PATCH v2 1/3] base: mark 'no_warn' as unused Bill Wendling
2021-07-26 20:19 ` [PATCH v2 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
@ 2021-07-26 20:19 ` Bill Wendling
2021-07-27 3:14 ` Martin K. Petersen
2021-07-29 3:38 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Martin K. Petersen
3 siblings, 1 reply; 12+ messages in thread
From: Bill Wendling @ 2021-07-26 20:19 UTC (permalink / raw)
To: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Cc: Bill Wendling
Fix the clang build warning:
drivers/scsi/qla2xxx/qla_nx.c:2209:6: error: variable 'status' set but not used [-Werror,-Wunused-but-set-variable]
int status = 0;
Signed-off-by: Bill Wendling <morbo@google.com>
---
drivers/scsi/qla2xxx/qla_nx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 615e44af1ca6..11aad97dfca8 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -2166,7 +2166,6 @@ qla82xx_poll(int irq, void *dev_id)
struct qla_hw_data *ha;
struct rsp_que *rsp;
struct device_reg_82xx __iomem *reg;
- int status = 0;
uint32_t stat;
uint32_t host_int = 0;
uint16_t mb[8];
@@ -2195,7 +2194,6 @@ qla82xx_poll(int irq, void *dev_id)
case 0x10:
case 0x11:
qla82xx_mbx_completion(vha, MSW(stat));
- status |= MBX_INTERRUPT;
break;
case 0x12:
mb[0] = MSW(stat);
--
2.32.0.432.gabb21c7263-goog
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] bnx2x: remove unused variable 'cur_data_offset'
2021-07-26 20:19 ` [PATCH v2 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
@ 2021-07-26 20:36 ` Nathan Chancellor
0 siblings, 0 replies; 12+ messages in thread
From: Nathan Chancellor @ 2021-07-26 20:36 UTC (permalink / raw)
To: Bill Wendling, linux-kernel, netdev, linux-scsi,
clang-built-linux, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
On 7/26/2021 1:19 PM, 'Bill Wendling' via Clang Built Linux wrote:
> Fix the clang build warning:
>
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1862:13: error: variable 'cur_data_offset' set but not used [-Werror,-Wunused-but-set-variable]
> dma_addr_t cur_data_offset;
>
> Signed-off-by: Bill Wendling <morbo@google.com>
It has been unused since the function's introduction in commit
67c431a5f2f3 ("bnx2x: Support statistics collection for VFs by the PF"),
perhaps a leftover remnant from a previous version?
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> index 27943b0446c2..f255fd0b16db 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
> @@ -1858,7 +1858,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
> {
> int i;
> int first_queue_query_index, num_queues_req;
> - dma_addr_t cur_data_offset;
> struct stats_query_entry *cur_query_entry;
> u8 stats_count = 0;
> bool is_fcoe = false;
> @@ -1879,10 +1878,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
> BNX2X_NUM_ETH_QUEUES(bp), is_fcoe, first_queue_query_index,
> first_queue_query_index + num_queues_req);
>
> - cur_data_offset = bp->fw_stats_data_mapping +
> - offsetof(struct bnx2x_fw_stats_data, queue_stats) +
> - num_queues_req * sizeof(struct per_queue_stats);
> -
> cur_query_entry = &bp->fw_stats_req->
> query[first_queue_query_index + num_queues_req];
>
> @@ -1933,7 +1928,6 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp)
> cur_query_entry->funcID,
> j, cur_query_entry->index);
> cur_query_entry++;
> - cur_data_offset += sizeof(struct per_queue_stats);
> stats_count++;
>
> /* all stats are coalesced to the leading queue */
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 3/3] scsi: qla2xxx: remove unused variable 'status'
2021-07-26 20:19 ` [PATCH v2 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
@ 2021-07-27 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2021-07-27 3:14 UTC (permalink / raw)
To: Bill Wendling
Cc: linux-kernel, netdev, linux-scsi, clang-built-linux,
Nathan Chancellor, Nick Desaulniers, Ariel Elior,
Sudarsana Kalluru, GR-everest-linux-l2, David S . Miller,
Nilesh Javali, GR-QLogic-Storage-Upstream,
James E . J . Bottomley, Martin K . Petersen
Bill,
> Fix the clang build warning:
>
> drivers/scsi/qla2xxx/qla_nx.c:2209:6: error: variable 'status' set but not used [-Werror,-Wunused-but-set-variable]
> int status = 0;
Applied to 5.15/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
` (2 preceding siblings ...)
2021-07-26 20:19 ` [PATCH v2 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
@ 2021-07-29 3:38 ` Martin K. Petersen
3 siblings, 0 replies; 12+ messages in thread
From: Martin K. Petersen @ 2021-07-29 3:38 UTC (permalink / raw)
To: linux-scsi, Sudarsana Kalluru, Nathan Chancellor,
GR-QLogic-Storage-Upstream, linux-kernel,
James E . J . Bottomley, Ariel Elior, Nilesh Javali,
Nick Desaulniers, David S . Miller, GR-everest-linux-l2, netdev,
Bill Wendling, clang-built-linux
Cc: Martin K . Petersen
On Mon, 26 Jul 2021 13:19:21 -0700, Bill Wendling wrote:
> These patches clean up warnings from clang's '-Wunused-but-set-variable' flag.
>
> Changes for v2:
> - Mark "no_warn" as "__maybe_unused" to avoid separate warning.
>
> Bill Wendling (3):
> base: mark 'no_warn' as unused
> bnx2x: remove unused variable 'cur_data_offset'
> scsi: qla2xxx: remove unused variable 'status'
>
> [...]
Applied to 5.15/scsi-queue, thanks!
[3/3] scsi: qla2xxx: remove unused variable 'status'
https://git.kernel.org/mkp/scsi/c/cb51bcd5c34b
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2021-07-29 3:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 9:17 [PATCH 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
2021-07-14 9:17 ` [PATCH 1/3] base: remove unused variable 'no_warn' Bill Wendling
2021-07-14 12:15 ` kernel test robot
2021-07-14 9:17 ` [PATCH 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
2021-07-14 9:17 ` [PATCH 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
2021-07-26 20:19 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Bill Wendling
2021-07-26 20:19 ` [PATCH v2 1/3] base: mark 'no_warn' as unused Bill Wendling
2021-07-26 20:19 ` [PATCH v2 2/3] bnx2x: remove unused variable 'cur_data_offset' Bill Wendling
2021-07-26 20:36 ` Nathan Chancellor
2021-07-26 20:19 ` [PATCH v2 3/3] scsi: qla2xxx: remove unused variable 'status' Bill Wendling
2021-07-27 3:14 ` Martin K. Petersen
2021-07-29 3:38 ` [PATCH v2 0/3] Fix clang -Wunused-but-set-variable warnings Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).