bdev: make blockdev_mnt static

Message ID 20240227081958.89092-1-jiapeng.chong@linux.alibaba.com
State New
Headers
Series bdev: make blockdev_mnt static |

Commit Message

Jiapeng Chong Feb. 27, 2024, 8:19 a.m. UTC
  The blockdev_mnt are not used outside the file bdev.c, so the modification
is defined as static.

block/bdev.c:377:17: warning: symbol 'blockdev_mnt' was not declared. Should it be static?

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8341
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 block/bdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Christoph Hellwig Feb. 28, 2024, 1:28 p.m. UTC | #1
On Tue, Feb 27, 2024 at 04:19:58PM +0800, Jiapeng Chong wrote:
> The blockdev_mnt are not used outside the file bdev.c, so the modification
> is defined as static.
> 
> block/bdev.c:377:17: warning: symbol 'blockdev_mnt' was not declared. Should it be static?
> 

The patch looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8341

But I don't think kernel commit should close random bugzillas?
  
Jens Axboe Feb. 28, 2024, 2:21 p.m. UTC | #2
On 2/27/24 1:19 AM, Jiapeng Chong wrote:
> The blockdev_mnt are not used outside the file bdev.c, so the modification
> is defined as static.
> 
> block/bdev.c:377:17: warning: symbol 'blockdev_mnt' was not declared. Should it be static?

What is this against?
  

Patch

diff --git a/block/bdev.c b/block/bdev.c
index e7adaaf1c219..ca1c12c1189e 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -374,7 +374,7 @@  static struct file_system_type bd_type = {
 };
 
 struct super_block *blockdev_superblock __ro_after_init;
-struct vfsmount *blockdev_mnt __ro_after_init;
+static struct vfsmount *blockdev_mnt __ro_after_init;
 EXPORT_SYMBOL_GPL(blockdev_superblock);
 
 void __init bdev_cache_init(void)