drivers: staging: Drop unlikely before IS_ERR(_OR_NULL)
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 31 Jul 2015 08:38:30 +0000 (14:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2015 23:18:43 +0000 (16:18 -0700)
IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
is no need to do that again from its callers. Drop it.

This also replaces an IS_ERR(x) + (x == NULL) check to IS_ERR_OR_NULL
check.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ashmem.c
drivers/staging/lustre/include/linux/libcfs/libcfs.h
drivers/staging/lustre/lustre/obdclass/lu_object.c

index 7958d5c9663f5894a353363017e7aefd5014305f..cefc208c313ac2ece917beb9f937eec30c566af6 100644 (file)
@@ -388,7 +388,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
 
                /* ... and allocate the backing shmem file */
                vmfile = shmem_file_setup(name, asma->size, vma->vm_flags);
-               if (unlikely(IS_ERR(vmfile))) {
+               if (IS_ERR(vmfile)) {
                        ret = PTR_ERR(vmfile);
                        goto out;
                }
index 5dd9cdfae30ccb9b793c167ae7275ac7ca7b07f9..d585041041c7c711bb1fe01d26f2509e3b3697fd 100644 (file)
@@ -134,7 +134,7 @@ void cfs_get_random_bytes(void *buf, int size);
 /* container_of depends on "likely" which is defined in libcfs_private.h */
 static inline void *__container_of(void *ptr, unsigned long shift)
 {
-       if (unlikely(IS_ERR(ptr) || ptr == NULL))
+       if (IS_ERR_OR_NULL(ptr))
                return ptr;
        return (char *)ptr - shift;
 }
index 9469a250d8dc9c69e300931f95ff2b6f57191d23..8e472327c880e3201992b3995456785227bcf4f6 100644 (file)
@@ -602,7 +602,7 @@ static struct lu_object *lu_object_new(const struct lu_env *env,
        struct lu_site_bkt_data *bkt;
 
        o = lu_object_alloc(env, dev, f, conf);
-       if (unlikely(IS_ERR(o)))
+       if (IS_ERR(o))
                return o;
 
        hs = dev->ld_site->ls_obj_hash;
@@ -666,7 +666,7 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env,
         * operations, including fld queries, inode loading, etc.
         */
        o = lu_object_alloc(env, dev, f, conf);
-       if (unlikely(IS_ERR(o)))
+       if (IS_ERR(o))
                return o;
 
        LASSERT(lu_fid_eq(lu_object_fid(o), f));
@@ -1558,7 +1558,7 @@ static int keys_fill(struct lu_context *ctx)
                        LINVRNT(key->lct_index == i);
 
                        value = key->lct_init(ctx, key);
-                       if (unlikely(IS_ERR(value)))
+                       if (IS_ERR(value))
                                return PTR_ERR(value);
 
                        if (!(ctx->lc_tags & LCT_NOREF))