Linux-SCSI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] scsi: libsas: remove redundant assignment to variable res
@ 2020-07-22 15:44 Colin King
  2020-07-22 15:59 ` John Garry
  2020-07-25  2:50 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2020-07-22 15:44 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen, John Garry, linux-scsi
  Cc: kernel-janitors, linux-kernel

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

The variable res 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/libsas/sas_expander.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index ab671cdd4cfb..b7d1b1ea185d 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -427,7 +427,7 @@ int sas_ex_phy_discover(struct domain_device *dev, int single)
 static int sas_expander_discover(struct domain_device *dev)
 {
 	struct expander_device *ex = &dev->ex_dev;
-	int res = -ENOMEM;
+	int res;
 
 	ex->ex_phy = kcalloc(ex->num_phys, sizeof(*ex->ex_phy), GFP_KERNEL);
 	if (!ex->ex_phy)
-- 
2.27.0


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

* Re: [PATCH] scsi: libsas: remove redundant assignment to variable res
  2020-07-22 15:44 [PATCH] scsi: libsas: remove redundant assignment to variable res Colin King
@ 2020-07-22 15:59 ` John Garry
  2020-07-25  2:50 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: John Garry @ 2020-07-22 15:59 UTC (permalink / raw)
  To: Colin King, James E . J . Bottomley, Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

On 22/07/2020 16:44, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
> 
> The variable res 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>

Reviewed-by: John Garry <john.garry@huawei.com>

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

* Re: [PATCH] scsi: libsas: remove redundant assignment to variable res
  2020-07-22 15:44 [PATCH] scsi: libsas: remove redundant assignment to variable res Colin King
  2020-07-22 15:59 ` John Garry
@ 2020-07-25  2:50 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2020-07-25  2:50 UTC (permalink / raw)
  To: James E . J . Bottomley, John Garry, linux-scsi, Colin King
  Cc: Martin K . Petersen, linux-kernel, kernel-janitors

On Wed, 22 Jul 2020 16:44:04 +0100, Colin King wrote:

> The variable res 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.9/scsi-queue, thanks!

[1/1] scsi: libsas: Remove redundant assignment to variable res
      https://git.kernel.org/mkp/scsi/c/55eb809f5e1c

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 15:44 [PATCH] scsi: libsas: remove redundant assignment to variable res Colin King
2020-07-22 15:59 ` John Garry
2020-07-25  2:50 ` Martin K. Petersen

Linux-SCSI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-scsi/0 linux-scsi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-scsi linux-scsi/ https://lore.kernel.org/linux-scsi \
		linux-scsi@vger.kernel.org
	public-inbox-index linux-scsi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-scsi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git