cifs: use PTR_ERR_OR_ZERO() to simplify code
authorChen Zhou <chenzhou10@huawei.com>
Wed, 22 Jan 2020 10:20:30 +0000 (18:20 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 27 Jan 2020 01:24:17 +0000 (19:24 -0600)
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR, just use
PTR_ERR_OR_ZERO directly.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
fs/cifs/dfs_cache.c

index b0315b7..9a384d1 100644 (file)
@@ -661,7 +661,7 @@ static int __dfs_cache_find(const unsigned int xid, struct cifs_ses *ses,
         */
        if (noreq) {
                up_read(&htable_rw_lock);
-               return IS_ERR(ce) ? PTR_ERR(ce) : 0;
+               return PTR_ERR_OR_ZERO(ce);
        }
 
        if (!IS_ERR(ce)) {