Skip to contentSkip to conversation

iommu/intel: remove an unused variable "length"

PATCH Applied Qian Cai 4 participants 4 messages Jun 17, 2019 – Jun 18, 2019 IOMMU

lore
Share & tools
lore

Qian Cai

author
#0 lore raw

PATCH 1/1 iommu/intel: remove an unused variable "length"

The linux-next commit "iommu/vt-d: Duplicate iommu_resv_region objects per device list" [1] left out an unused variable,

drivers/iommu/intel-iommu.c: In function 'dmar_parse_one_rmrr':
drivers/iommu/intel-iommu.c:4014:9: warning: variable 'length' set but not used [-Wunused-but-set-variable]

[1] https://lore.kernel.org/patchwork/patch/1083073/

---
 drivers/iommu/intel-iommu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iommu/intel-iommu.c +0 -3
index 478ac186570b..d86d4ee5cc78 100644
@@ -4011,7 +4011,6 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
 {
 	struct acpi_dmar_reserved_memory *rmrr;
 	struct dmar_rmrr_unit *rmrru;
-	size_t length;
 
 	rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL);
 	if (!rmrru)
@@ -4022,8 +4021,6 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
 	rmrru->base_address = rmrr->base_address;
 	rmrru->end_address = rmrr->end_address;
 
-	length = rmrr->end_address - rmrr->base_address + 1;
-
 	rmrru->devices = dmar_alloc_dev_scope((void *)(rmrr + 1),
 				((void *)rmrr) + rmrr->header.length,
 				&rmrru->devices_cnt);
Signature · 1 line
2.20.1 (Apple Git-117)
Reviewed-by on v1 1/1
#1 lore raw

Hi Qian,

Quoted 10 lines · Qian Cai

The linux-next commit "iommu/vt-d: Duplicate iommu_resv_region objects per device list" [1] left out an unused variable,

drivers/iommu/intel-iommu.c: In function 'dmar_parse_one_rmrr':
drivers/iommu/intel-iommu.c:4014:9: warning: variable 'length' set but not used [-Wunused-but-set-variable]

[1] https://lore.kernel.org/patchwork/patch/1083073/

Thank you for fixing this oversight

Best Regards

Eric

Quoted 26 lines
---
 drivers/iommu/intel-iommu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iommu/intel-iommu.c +0 -3
index 478ac186570b..d86d4ee5cc78 100644
@@ -4011,7 +4011,6 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
 {
 	struct acpi_dmar_reserved_memory *rmrr;
 	struct dmar_rmrr_unit *rmrru;
-	size_t length;
 
 	rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL);
 	if (!rmrru)
@@ -4022,8 +4021,6 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
 	rmrru->base_address = rmrr->base_address;
 	rmrru->end_address = rmrr->end_address;
 
-	length = rmrr->end_address - rmrr->base_address + 1;
-
 	rmrru->devices = dmar_alloc_dev_scope((void *)(rmrr + 1),
 				((void *)rmrr) + rmrr->header.length,
 				&rmrru->devices_cnt);
#2 lore raw
In reply to Qian Cai

Hi,

Quoted 10 lines · Qian Cai

The linux-next commit "iommu/vt-d: Duplicate iommu_resv_region objects per device list" [1] left out an unused variable,

drivers/iommu/intel-iommu.c: In function 'dmar_parse_one_rmrr':
drivers/iommu/intel-iommu.c:4014:9: warning: variable 'length' set but not used [-Wunused-but-set-variable]

[1] https://lore.kernel.org/patchwork/patch/1083073/

With regard to the subject, we normally use "iommu/vt-d: ".

Best regards,
Baolu

Quoted 18 lines
---
  drivers/iommu/intel-iommu.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/iommu/intel-iommu.c +0 -1
index 478ac186570b..d86d4ee5cc78 100644
@@ -4011,7 +4011,6 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
  {
  	struct acpi_dmar_reserved_memory *rmrr;
  	struct dmar_rmrr_unit *rmrru;
-	size_t length;
 
  	rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL);
  	if (!rmrru)

drivers/iommu/intel-iommu.c int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) · line 4026

Quoted 8 lines
drivers/iommu/intel-iommu.c +0 -2
@@ -4022,8 +4021,6 @@ int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
  	rmrru->base_address = rmrr->base_address;
  	rmrru->end_address = rmrr->end_address;
 
-	length = rmrr->end_address - rmrr->base_address + 1;
-
  	rmrru->devices = dmar_alloc_dev_scope((void *)(rmrr + 1),
  				((void *)rmrr) + rmrr->header.length,
  				&rmrru->devices_cnt);

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Applied
#3 lore raw
In reply to Qian Cai
Quoted 7 lines · Qian Cai

The linux-next commit "iommu/vt-d: Duplicate iommu_resv_region objects per device list" [1] left out an unused variable,

drivers/iommu/intel-iommu.c: In function 'dmar_parse_one_rmrr':
drivers/iommu/intel-iommu.c:4014:9: warning: variable 'length' set but not used [-Wunused-but-set-variable]

Quoted 6 lines

[1] https://lore.kernel.org/patchwork/patch/1083073/

---
 drivers/iommu/intel-iommu.c | 3 ---
 1 file changed, 3 deletions(-)

Applied, thanks.

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu