lkml.org 
[lkml]   [2018]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] btrfs: fix err_cast.cocci warnings
From: Fengguang Wu <fengguang.wu@intel.com>

fs/btrfs/volumes.c:742:10-17: WARNING: ERR_CAST can be used with fs_devices


Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

Generated by: scripts/coccinelle/api/err_cast.cocci

Fixes: bf155c98d312 ("btrfs: get device pointer from device_list_add()")
CC: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

volumes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -739,7 +739,7 @@ static noinline struct btrfs_device *dev
if (!fs_devices) {
fs_devices = alloc_fs_devices(disk_super->fsid);
if (IS_ERR(fs_devices))
- return ERR_PTR(PTR_ERR(fs_devices));
+ return ERR_CAST(fs_devices);

list_add(&fs_devices->list, &fs_uuids);

\
 
 \ /
  Last update: 2018-01-28 19:52    [W:0.034 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site