Skip to contentSkip to conversation

cifs: use PTR_ERR_OR_ZERO() to simplify code

PATCH Applied Chen Zhou 2 participants 2 messages Jan 22, 2020

Subsystems (2)
lore
Share & tools
lore

Chen Zhou

author
#0 lore raw

PATCH 1/1 cifs: use PTR_ERR_OR_ZERO() to simplify code

PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR, just use PTR_ERR_OR_ZERO directly.

---
 fs/cifs/dfs_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dfs_cache.c +1 -1
index 751c2fc..43c1b43 100644
@@ -662,7 +662,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)) {
Signature · 1 line
2.7.4
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 25 lines · Chen Zhou

PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR, just use PTR_ERR_OR_ZERO directly.

---
 fs/cifs/dfs_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/dfs_cache.c +1 -2
index 751c2fc..43c1b43 100644
@@ -662,7 +662,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)) {
--

2.7.4

Signature · 3 lines
Thanks,

Steve