diff mbox series

[-next] cifs: use PTR_ERR_OR_ZERO() to simplify code

Message ID 20200122102030.95853-1-chenzhou10@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] cifs: use PTR_ERR_OR_ZERO() to simplify code | expand

Commit Message

chenzhou Jan. 22, 2020, 10:20 a.m. UTC
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>
---
 fs/cifs/dfs_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve French Jan. 22, 2020, 4:55 p.m. UTC | #1
merged into cifs-2.6.git for-next

On Wed, Jan 22, 2020 at 4:25 AM Chen Zhou <chenzhou10@huawei.com> wrote:
>
> 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>
> ---
>  fs/cifs/dfs_cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
> index 751c2fc..43c1b43 100644
> --- a/fs/cifs/dfs_cache.c
> +++ b/fs/cifs/dfs_cache.c
> @@ -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
>
diff mbox series

Patch

diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index 751c2fc..43c1b43 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -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)) {