* [PATCH] scsi: target: core: Remove unused variable unit_serial_len
@ 2022-11-01 10:53 Colin Ian King
2022-11-08 3:50 ` Martin K. Petersen
2022-11-17 18:29 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2022-11-01 10:53 UTC (permalink / raw)
To: Martin K . Petersen, linux-scsi, target-devel
Cc: kernel-janitors, linux-kernel
Variable unit_serial_len is just being assigned and it's never used
anywhere else. The variable is redundant so remove it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/target/target_core_spc.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index ffe02e195733..621a460ba234 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -227,7 +227,7 @@ spc_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf)
struct t10_alua_tg_pt_gp *tg_pt_gp;
unsigned char *prod = &dev->t10_wwn.model[0];
u32 prod_len;
- u32 unit_serial_len, off = 0;
+ u32 off = 0;
u16 len = 0, id_len;
off = 4;
@@ -272,13 +272,9 @@ spc_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf)
prod_len += strlen(prod);
prod_len++; /* For : */
- if (dev->dev_flags & DF_EMULATED_VPD_UNIT_SERIAL) {
- unit_serial_len = strlen(&dev->t10_wwn.unit_serial[0]);
- unit_serial_len++; /* For NULL Terminator */
-
+ if (dev->dev_flags & DF_EMULATED_VPD_UNIT_SERIAL)
id_len += sprintf(&buf[off+12], "%s:%s", prod,
&dev->t10_wwn.unit_serial[0]);
- }
buf[off] = 0x2; /* ASCII */
buf[off+1] = 0x1; /* T10 Vendor ID */
buf[off+2] = 0x0;
--
2.37.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: target: core: Remove unused variable unit_serial_len
2022-11-01 10:53 [PATCH] scsi: target: core: Remove unused variable unit_serial_len Colin Ian King
@ 2022-11-08 3:50 ` Martin K. Petersen
2022-11-17 18:29 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-11-08 3:50 UTC (permalink / raw)
To: Colin Ian King
Cc: Martin K . Petersen, linux-scsi, target-devel, kernel-janitors,
linux-kernel
Colin,
> Variable unit_serial_len is just being assigned and it's never used
> anywhere else. The variable is redundant so remove it.
Applied to 6.2/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: target: core: Remove unused variable unit_serial_len
2022-11-01 10:53 [PATCH] scsi: target: core: Remove unused variable unit_serial_len Colin Ian King
2022-11-08 3:50 ` Martin K. Petersen
@ 2022-11-17 18:29 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-11-17 18:29 UTC (permalink / raw)
To: target-devel, linux-scsi, Colin Ian King
Cc: Martin K . Petersen, kernel-janitors, linux-kernel
On Tue, 1 Nov 2022 10:53:26 +0000, Colin Ian King wrote:
> Variable unit_serial_len is just being assigned and it's never used
> anywhere else. The variable is redundant so remove it.
>
>
Applied to 6.2/scsi-queue, thanks!
[1/1] scsi: target: core: Remove unused variable unit_serial_len
https://git.kernel.org/mkp/scsi/c/bc81131813aa
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-17 18:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01 10:53 [PATCH] scsi: target: core: Remove unused variable unit_serial_len Colin Ian King
2022-11-08 3:50 ` Martin K. Petersen
2022-11-17 18:29 ` 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