swiotlb: drop pointless static qualifier in swiotlb_dma_supported()
Subsystems (2)
PATCH 1/1 swiotlb: drop pointless static qualifier in swiotlb_dma_supported()
There is no need to have the 'struct dentry *d_swiotlb_usage' variable static since new value always be assigned before use it.
--- kernel/dma/swiotlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/swiotlb.c +1 -1
@@ -689,7 +689,7 @@ swiotlb_dma_supported(struct device *hwdev, u64 mask)static int __init swiotlb_create_debugfs (void ) { -static struct dentry *d_swiotlb_usage; +struct dentry *d_swiotlb_usage;struct dentry *ent; d_swiotlb_usage =debugfs_create_dir ("swiotlb" ,NULL );
Quoted 2 lines · YueHaibing
There is no need to have the 'struct dentry
*d_swiotlb_usage' variable static since new value always be assigned before use it.
FYI, this is in swiotlb_create_debugfs, not swiotlb_dma_supported.
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · YueHaibing
There is no need to have the 'struct dentry
*d_swiotlb_usage' variable static since new value always be assigned before use it.FYI, this is in
swiotlb_create_debugfs, notswiotlb_dma_supported.
Thank you, I will fix it.
Quoted 3 lines
.
PATCH v2 1/1 swiotlb: drop pointless static qualifier in swiotlb_create_debugfs()
In reply to YueHaibingThere is no need to have the 'struct dentry *d_swiotlb_usage' variable static since new value always be assigned before use it.
---
v2: fix patch title
--- kernel/dma/swiotlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/dma/swiotlb.c +1 -1
@@ -689,7 +689,7 @@ swiotlb_dma_supported(struct device *hwdev, u64 mask)static int __init swiotlb_create_debugfs (void ) { -static struct dentry *d_swiotlb_usage; +struct dentry *d_swiotlb_usage;struct dentry *ent; d_swiotlb_usage =debugfs_create_dir ("swiotlb" ,NULL );