linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval
@ 2020-12-04 19:18 Colin King
  2020-12-08  1:58 ` Martin K. Petersen
  2020-12-09 17:23 ` Martin K. Petersen
  0 siblings, 2 replies; 6+ messages in thread
From: Colin King @ 2020-12-04 19:18 UTC (permalink / raw)
  To: Nilesh Javali, Manish Rangankar, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable rval is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/scsi/qla4xxx/ql4_nx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
index fd30fbd0d33c..e6e35e6958f6 100644
--- a/drivers/scsi/qla4xxx/ql4_nx.c
+++ b/drivers/scsi/qla4xxx/ql4_nx.c
@@ -1767,7 +1767,7 @@ qla4_82xx_start_firmware(struct scsi_qla_host *ha, uint32_t image_start)
 
 int qla4_82xx_try_start_fw(struct scsi_qla_host *ha)
 {
-	int rval = QLA_ERROR;
+	int rval;
 
 	/*
 	 * FW Load priority:
-- 
2.29.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval
  2020-12-04 19:18 [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval Colin King
@ 2020-12-08  1:58 ` Martin K. Petersen
  2020-12-09 17:23 ` Martin K. Petersen
  1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-12-08  1:58 UTC (permalink / raw)
  To: Colin King
  Cc: Nilesh Javali, Manish Rangankar, GR-QLogic-Storage-Upstream,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	kernel-janitors, linux-kernel


Colin,

> The variable rval is being initialized with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval
  2020-12-04 19:18 [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval Colin King
  2020-12-08  1:58 ` Martin K. Petersen
@ 2020-12-09 17:23 ` Martin K. Petersen
  1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-12-09 17:23 UTC (permalink / raw)
  To: Nilesh Javali, James E . J . Bottomley, Manish Rangankar,
	Colin King, linux-scsi, GR-QLogic-Storage-Upstream
  Cc: Martin K . Petersen, kernel-janitors, linux-kernel

On Fri, 4 Dec 2020 19:18:10 +0000, Colin King wrote:

> The variable rval is being initialized with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: qla4xxx: remove redundant assignment to variable rval
      https://git.kernel.org/mkp/scsi/c/3a5b9fa2cc5f

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla4xxx: Remove redundant assignment to variable rval
  2020-11-03 12:01 [PATCH] scsi: qla4xxx: Remove " Jing Xiangfeng
  2020-11-17  5:53 ` Martin K. Petersen
@ 2020-11-20  3:31 ` Martin K. Petersen
  1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-11-20  3:31 UTC (permalink / raw)
  To: jejb, Jing Xiangfeng; +Cc: Martin K . Petersen, linux-kernel, linux-scsi

On Tue, 3 Nov 2020 20:01:37 +0800, Jing Xiangfeng wrote:

> The variable rval has been initialized with 'QLA_ERROR'. The assignment
> is redundant in an error path. So remove it.

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: qla4xxx: Remove redundant assignment to variable rval
      https://git.kernel.org/mkp/scsi/c/cf4d4d8ebdb8

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: qla4xxx: Remove redundant assignment to variable rval
  2020-11-03 12:01 [PATCH] scsi: qla4xxx: Remove " Jing Xiangfeng
@ 2020-11-17  5:53 ` Martin K. Petersen
  2020-11-20  3:31 ` Martin K. Petersen
  1 sibling, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-11-17  5:53 UTC (permalink / raw)
  To: Jing Xiangfeng; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel


Jing,

> The variable rval has been initialized with 'QLA_ERROR'. The
> assignment is redundant in an error path. So remove it.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] scsi: qla4xxx: Remove redundant assignment to variable rval
@ 2020-11-03 12:01 Jing Xiangfeng
  2020-11-17  5:53 ` Martin K. Petersen
  2020-11-20  3:31 ` Martin K. Petersen
  0 siblings, 2 replies; 6+ messages in thread
From: Jing Xiangfeng @ 2020-11-03 12:01 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: linux-scsi, linux-kernel, jingxiangfeng

The variable rval has been initialized with 'QLA_ERROR'. The assignment
is redundant in an error path. So remove it.

Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 drivers/scsi/qla4xxx/ql4_os.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 676778cbc550..aaccbf71dff5 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -686,7 +686,6 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha,
 
 	if (!ha->chap_list) {
 		ql4_printk(KERN_ERR, ha, "CHAP table cache is empty!\n");
-		rval = QLA_ERROR;
 		goto exit_get_chap;
 	}
 
@@ -698,14 +697,12 @@ static int qla4xxx_get_chap_by_index(struct scsi_qla_host *ha,
 
 	if (chap_index > max_chap_entries) {
 		ql4_printk(KERN_ERR, ha, "Invalid Chap index\n");
-		rval = QLA_ERROR;
 		goto exit_get_chap;
 	}
 
 	*chap_entry = (struct ql4_chap_table *)ha->chap_list + chap_index;
 	if ((*chap_entry)->cookie !=
 	     __constant_cpu_to_le16(CHAP_VALID_COOKIE)) {
-		rval = QLA_ERROR;
 		*chap_entry = NULL;
 	} else {
 		rval = QLA_SUCCESS;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-09 17:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 19:18 [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval Colin King
2020-12-08  1:58 ` Martin K. Petersen
2020-12-09 17:23 ` Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2020-11-03 12:01 [PATCH] scsi: qla4xxx: Remove " Jing Xiangfeng
2020-11-17  5:53 ` Martin K. Petersen
2020-11-20  3:31 ` 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).