From patchwork Fri Jul 31 08:38:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51755 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 9ED9722A8D for ; Fri, 31 Jul 2015 08:40:10 +0000 (UTC) Received: by lbcjf8 with SMTP id jf8sf21868228lbc.0 for ; Fri, 31 Jul 2015 01:40:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=VOpyJcqEcTgZWMHPzEzO1czPOc+VdYxjy0XGvVFolXA=; b=L0tbRTwS1r5sT2vpumNEXB6mf2PtPDEJLhSySOg5rxDUVvvcUvoZgyQ/IVSNMjjNM2 nuVn/D6lN4xSyZ/X7rG+mk7dqDISkEu4VH8tXzPNxyss7aztZj0nzu6RmgkNEKhPkyb1 kIRFVf4wXwo/c4zeCviSiCTjgHFphZWsz13aCBcbv7O+CHVz9aeEA4DNqRuopTwzpZti FmvM9WcW4m/9WBgjJ/C362OTxJ88EasOm6czifgh0mT4unDQkQD87ojM8T+Nd0BEC9cN u/Hg0IL+mhCriYy9K8yhVBcYVTkxYvvXtV2QvgsVqEC1oMDjesXqTzvW16AkOqpivTEC 3d3w== X-Gm-Message-State: ALoCoQk+KY4q828zPhxzq9rY6TB5hwXtmiiFWLmIxt6v0XCEwtvdUUiBw2rBmz00rcbvloMbdcMQ X-Received: by 10.112.189.131 with SMTP id gi3mr585900lbc.6.1438332009566; Fri, 31 Jul 2015 01:40:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.7 with SMTP id bc7ls281503lab.74.gmail; Fri, 31 Jul 2015 01:40:09 -0700 (PDT) X-Received: by 10.152.7.206 with SMTP id l14mr1573335laa.3.1438332009381; Fri, 31 Jul 2015 01:40:09 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id lh6si3007632lbc.49.2015.07.31.01.40.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 01:40:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lafd3 with SMTP id d3so39803042laf.1 for ; Fri, 31 Jul 2015 01:40:09 -0700 (PDT) X-Received: by 10.152.5.228 with SMTP id v4mr1631512lav.36.1438332009275; Fri, 31 Jul 2015 01:40:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp227581lba; Fri, 31 Jul 2015 01:40:07 -0700 (PDT) X-Received: by 10.70.65.99 with SMTP id w3mr4503940pds.132.1438331998976; Fri, 31 Jul 2015 01:39:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si8822753pap.63.2015.07.31.01.39.57; Fri, 31 Jul 2015 01:39:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753177AbbGaIjy (ORCPT + 28 others); Fri, 31 Jul 2015 04:39:54 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:35360 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753081AbbGaIjv (ORCPT ); Fri, 31 Jul 2015 04:39:51 -0400 Received: by pdrg1 with SMTP id g1so39146938pdr.2 for ; Fri, 31 Jul 2015 01:39:50 -0700 (PDT) X-Received: by 10.70.45.225 with SMTP id q1mr4583370pdm.46.1438331990551; Fri, 31 Jul 2015 01:39:50 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id nz12sm6299145pdb.12.2015.07.31.01.39.49 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 31 Jul 2015 01:39:49 -0700 (PDT) From: Viresh Kumar To: akpm@linux-foundation.org Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar , Andreas Dilger , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Aya Mahfouz , devel@driverdev.osuosl.org (open list:ANDROID DRIVERS), Dmitry Eremin , Greg Kroah-Hartman , Gulsah Kose , HPDD-discuss@lists.01.org (moderated list:STAGING - LUSTRE PARALLEL FILESYSTEM), James Simmons , Joe Perches , Julia Lawall , Oleg Drokin , Pekka Enberg , Riley Andrews , Serguey Parkhomovsky , Supriya Karanth Subject: [PATCH 10/15] drivers: staging: Drop unlikely before IS_ERR(_OR_NULL) Date: Fri, 31 Jul 2015 14:08:30 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- drivers/staging/android/ashmem.c | 2 +- drivers/staging/lustre/include/linux/libcfs/libcfs.h | 2 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index c5c037ccf32c..9db321c63e79 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -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; } diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 5dd9cdfae30c..d585041041c7 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -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; } diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 4d9b6333eeae..6cd3af8c6237 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -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))