From: Christophe Vu-Brugier Date: Fri, 6 Jun 2014 15:15:15 +0000 (+0200) Subject: target/spc: Simplify INQUIRY EVPD=0x80 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9aff64e13f3678015c4a08a4fbf320b3a65b5cf1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git target/spc: Simplify INQUIRY EVPD=0x80 Signed-off-by: Christophe Vu-Brugier Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 8653666612a8..17b5b7e099fa 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c @@ -129,15 +129,10 @@ static sense_reason_t spc_emulate_evpd_80(struct se_cmd *cmd, unsigned char *buf) { struct se_device *dev = cmd->se_dev; - u16 len = 0; + u16 len; if (dev->dev_flags & DF_EMULATED_VPD_UNIT_SERIAL) { - u32 unit_serial_len; - - unit_serial_len = strlen(dev->t10_wwn.unit_serial); - unit_serial_len++; /* For NULL Terminator */ - - len += sprintf(&buf[4], "%s", dev->t10_wwn.unit_serial); + len = sprintf(&buf[4], "%s", dev->t10_wwn.unit_serial); len++; /* Extra Byte for NULL Terminator */ buf[3] = len; }