2018-02-06 14:23:18

by Colin King

[permalink] [raw]
Subject: [PATCH] scsi: libfc: remove redundant initialization of 'disc'

From: Colin Ian King <[email protected]>

Pointer disc is being intializated a value that is never read and then
re-assigned the same value later on, hence the initialization is redundant
and can be removed.

Cleans up clang warning:
drivers/scsi/libfc/fc_disc.c:734:18: warning: Value stored to 'disc'
during its initialization is never read

Signed-off-by: Colin Ian King <[email protected]>
---
drivers/scsi/libfc/fc_disc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 8660f923ace0..3f3569ec5ce3 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -731,7 +731,7 @@ static void fc_disc_stop_final(struct fc_lport *lport)
*/
void fc_disc_config(struct fc_lport *lport, void *priv)
{
- struct fc_disc *disc = &lport->disc;
+ struct fc_disc *disc;

if (!lport->tt.disc_start)
lport->tt.disc_start = fc_disc_start;
--
2.15.1



2018-02-06 14:40:40

by Johannes Thumshirn

[permalink] [raw]
Subject: Re: [PATCH] scsi: libfc: remove redundant initialization of 'disc'

Looks good,
Acked-by: Johannes Thumshirn <[email protected]>
--
Johannes Thumshirn Storage
[email protected] +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

2018-02-07 01:27:32

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] scsi: libfc: remove redundant initialization of 'disc'


Colin,

> Pointer disc is being intializated a value that is never read and then
> re-assigned the same value later on, hence the initialization is redundant
> and can be removed.

Applied to 4.17/scsi-queue.

--
Martin K. Petersen Oracle Linux Engineering