Skip to contentSkip to conversation

iommufd/selftest: set varaiable mock_iommu_device storage-class-specifier to static

PATCH In review Tom Rix 2 participants 2 messages Apr 4, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 iommufd/selftest: set varaiable mock_iommu_device storage-class-specifier to static

smatch reports drivers/iommu/iommufd/selftest.c:295:21: warning: symbol
'mock_iommu_device' was not declared. Should it be static?

This variable is only used in one file so it should be static.

---
 drivers/iommu/iommufd/selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/iommufd/selftest.c +1 -1
index 2deda489a934..9d43334e4faf 100644
@@ -292,7 +292,7 @@ static const struct iommu_ops mock_ops = {
 		},
 };
 
-struct iommu_device mock_iommu_device = {
+static struct iommu_device mock_iommu_device = {
 	.ops = &mock_ops,
 };
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 9 lines · Tom Rix

smatch reports drivers/iommu/iommufd/selftest.c:295:21: warning: symbol
'mock_iommu_device' was not declared. Should it be static?

This variable is only used in one file so it should be static.

---
 drivers/iommu/iommufd/selftest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, I applied this

Jason