fs/dcache: Replace printk and WARN_ON by WARN
authorAnh Tuan Phan <tuananhlfc@gmail.com>
Thu, 17 Aug 2023 16:31:42 +0000 (23:31 +0700)
committerChristian Brauner <brauner@kernel.org>
Sat, 19 Aug 2023 11:41:11 +0000 (13:41 +0200)
Use WARN instead of printk + WARN_ON as reported from coccinelle:
./fs/dcache.c:1667:1-7: SUGGESTION: printk + WARN_ON can be just WARN

Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com>
Message-Id: <20230817163142.117706-1-tuananhlfc@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/dcache.c

index 3aaf2c7ba110d9ed7b74d4214ac3d97e85ec3492..25ac74d30bff3b39e6763c4717cee2b403d80139 100644 (file)
@@ -1664,7 +1664,7 @@ static enum d_walk_ret umount_check(void *_data, struct dentry *dentry)
        if (dentry == _data && dentry->d_lockref.count == 1)
                return D_WALK_CONTINUE;
 
-       printk(KERN_ERR "BUG: Dentry %p{i=%lx,n=%pd} "
+       WARN(1, "BUG: Dentry %p{i=%lx,n=%pd} "
                        " still in use (%d) [unmount of %s %s]\n",
                       dentry,
                       dentry->d_inode ?
@@ -1673,7 +1673,6 @@ static enum d_walk_ret umount_check(void *_data, struct dentry *dentry)
                       dentry->d_lockref.count,
                       dentry->d_sb->s_type->name,
                       dentry->d_sb->s_id);
-       WARN_ON(1);
        return D_WALK_CONTINUE;
 }