Skip to contentSkip to conversation

scsi: target: Remove unused variable 'tpg'

PATCH Applied Wei Yongjun 5 participants 5 messages Jul 9, 2020 – Jul 14, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: target: Remove unused variable 'tpg'

Gcc report warning as follows:

drivers/target/target_core_pr.c:1162:26: warning:
variable 'tpg' set but not used [-Wunused-but-set-variable] 1162 | struct se_portal_group *tpg;
| ^~~

After commit 63c9ffe473d3 ("scsi: target: Check enforce_pr_isids during registration"), 'tpg' is never used, so removing it to avoid build warning.

---
 drivers/target/target_core_pr.c | 2 --
 1 file changed, 2 deletions(-)
drivers/target/target_core_pr.c +0 -2
index 300b03b1b696..8fc88654bff6 100644
@@ -1159,7 +1159,6 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
 {
 	struct t10_reservation *pr_tmpl = &dev->t10_pr;
 	struct t10_pr_registration *pr_reg, *pr_reg_tmp;
-	struct se_portal_group *tpg;
 
 	spin_lock(&pr_tmpl->registration_lock);
 	list_for_each_entry_safe(pr_reg, pr_reg_tmp,
@@ -1170,7 +1169,6 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
 		if (pr_reg->pr_reg_nacl != nacl)
 			continue;
 
-		tpg = pr_reg->pr_reg_nacl->se_tpg;
 		/*
 		 * If this registration does NOT contain a fabric provided
 		 * ISID, then we have found a match.
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Wei Yongjun

Gcc report warning as follows:

drivers/target/target_core_pr.c:1162:26: warning:
variable 'tpg' set but not used [-Wunused-but-set-variable] 1162 | struct se_portal_group *tpg;
| ^~~

After commit 63c9ffe473d3 ("scsi: target: Check enforce_pr_isids during registration"), 'tpg' is never used, so removing it to avoid build warning.

---
 drivers/target/target_core_pr.c | 2 --
 1 file changed, 2 deletions(-)
drivers/target/target_core_pr.c +0 -1
index 300b03b1b696..8fc88654bff6 100644
@@ -1159,7 +1159,6 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
 {
 	struct t10_reservation *pr_tmpl = &dev->t10_pr;
 	struct t10_pr_registration *pr_reg, *pr_reg_tmp;
-	struct se_portal_group *tpg;
 
 	spin_lock(&pr_tmpl->registration_lock);
 	list_for_each_entry_safe(pr_reg, pr_reg_tmp,

drivers/target/target_core_pr.c static struct t10_pr_registration *__core_scsi3_locate_pr_reg( · line 1174

Quoted 7 lines
drivers/target/target_core_pr.c +0 -1
@@ -1170,7 +1169,6 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
 		if (pr_reg->pr_reg_nacl != nacl)
 			continue;
 
-		tpg = pr_reg->pr_reg_nacl->se_tpg;
 		/*
 		 * If this registration does NOT contain a fabric provided
 		 * ISID, then we have found a match.

Sorry. That was my fault. Thanks.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Wei Yongjun
Quoted 7 lines · Wei Yongjun

Gcc report warning as follows:

drivers/target/target_core_pr.c:1162:26: warning:
variable 'tpg' set but not used [-Wunused-but-set-variable] 1162 | struct se_portal_group *tpg;
| ^~~

Quoted 6 lines

After commit 63c9ffe473d3 ("scsi: target: Check enforce_pr_isids during registration"), 'tpg' is never used, so removing it to avoid build warning.

Looks good to me.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Wei Yongjun
Quoted 31 lines · Wei Yongjun

Gcc report warning as follows:

drivers/target/target_core_pr.c:1162:26: warning:
variable 'tpg' set but not used [-Wunused-but-set-variable] 1162 | struct se_portal_group *tpg;
| ^~~

After commit 63c9ffe473d3 ("scsi: target: Check enforce_pr_isids during registration"), 'tpg' is never used, so removing it to avoid build warning.

---
  drivers/target/target_core_pr.c | 2 --
  1 file changed, 2 deletions(-)
drivers/target/target_core_pr.c +0 -1
index 300b03b1b696..8fc88654bff6 100644
@@ -1159,7 +1159,6 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
  {
  	struct t10_reservation *pr_tmpl = &dev->t10_pr;
  	struct t10_pr_registration *pr_reg, *pr_reg_tmp;
-	struct se_portal_group *tpg;
 
  	spin_lock(&pr_tmpl->registration_lock);
  	list_for_each_entry_safe(pr_reg, pr_reg_tmp,

drivers/target/target_core_pr.c static struct t10_pr_registration *__core_scsi3_locate_pr_reg( · line 1174

Quoted 7 lines
drivers/target/target_core_pr.c +0 -1
@@ -1170,7 +1169,6 @@ static struct t10_pr_registration *__core_scsi3_locate_pr_reg(
  		if (pr_reg->pr_reg_nacl != nacl)
  			continue;
 
-		tpg = pr_reg->pr_reg_nacl->se_tpg;
  		/*
  		 * If this registration does NOT contain a fabric provided
  		 * ISID, then we have found a match.

Looks Good.

Signature · 1 line
Himanshu Madhani                     Oracle Linux Engineering
#4 lore raw
In reply to Wei Yongjun
Quoted 8 lines · Wei Yongjun

Gcc report warning as follows:

drivers/target/target_core_pr.c:1162:26: warning:
variable 'tpg' set but not used [-Wunused-but-set-variable] 1162 | struct se_portal_group *tpg;
| ^~~

[...]

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: target: Remove unused variable 'tpg'

      https://git.kernel.org/mkp/scsi/c/dd06a40201fe
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering