From patchwork Mon Jan 27 06:47:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 23737 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0AF362130F for ; Mon, 27 Jan 2014 06:51:44 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf23044844oag.8 for ; Sun, 26 Jan 2014 22:51:44 -0800 (PST) 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=TSA57ECNw0EcAyp56q9DabgedNt4iiSln/g+PwtqdoM=; b=BqqDMwrvO6psqOy/z4JBRhAsYTXhPBsxdFMow4jVNYkmuq00mHbuIX6PYHLfZZwUQa 8ldZE66dBwVOE/t9/7kISkIHDzpGww6NrU1ILp4Vgwxa8PwJrCIZhwERaSFR8MnBlNTo HsZ37iJZK3rzilOGZDZAmI0GkXxu59pAB69i7Gg0dktDVb1z8OxQGFwg0m6izLT3ZXhu d8KMuSmhVtH6XAWNxjBcq84u4QIlzjszXfB4+RXYszJjiw51qbMzFrMnX/1wgvx+jgfE rCPI2/vOF3PZnu6jVrvhI7P7lFQY2351F0JdQheTL3s///arPTbv2t4D8LaiZXhGb4t1 ff3A== X-Gm-Message-State: ALoCoQlEgwNHdauWQ7cKgyTyXvdIWkPJT2pQNwE3N00McklqRiFUPe7w1zjlM/LDudMp9Hcou+CP X-Received: by 10.42.82.137 with SMTP id d9mr3059753icl.25.1390805504163; Sun, 26 Jan 2014 22:51:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.134 with SMTP id v6ls1436543qgv.36.gmail; Sun, 26 Jan 2014 22:51:44 -0800 (PST) X-Received: by 10.58.188.78 with SMTP id fy14mr51129vec.23.1390805504051; Sun, 26 Jan 2014 22:51:44 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id i3si4754227vcp.127.2014.01.26.22.51.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 22:51:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id im17so3132637vcb.19 for ; Sun, 26 Jan 2014 22:51:44 -0800 (PST) X-Received: by 10.220.99.7 with SMTP id s7mr14552762vcn.19.1390805503963; Sun, 26 Jan 2014 22:51:43 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp108479vcz; Sun, 26 Jan 2014 22:51:43 -0800 (PST) X-Received: by 10.68.226.9 with SMTP id ro9mr28863937pbc.72.1390805502896; Sun, 26 Jan 2014 22:51:42 -0800 (PST) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by mx.google.com with ESMTPS id eb3si10128887pbd.197.2014.01.26.22.51.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 22:51:42 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.52; Received: by mail-pb0-f52.google.com with SMTP id jt11so5549212pbb.11 for ; Sun, 26 Jan 2014 22:51:42 -0800 (PST) X-Received: by 10.68.241.134 with SMTP id wi6mr28328854pbc.44.1390805502185; Sun, 26 Jan 2014 22:51:42 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id tu3sm77659135pab.1.2014.01.26.22.51.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Jan 2014 22:51:41 -0800 (PST) From: Sachin Kamat To: devel@driverdev.osuosl.org Cc: gregkh@linuxfoundation.org, sachin.kamat@linaro.org, patches@linaro.org, John Stultz Subject: [PATCH 1/1] staging: ion: Use PTR_ERR_OR_ZERO Date: Mon, 27 Jan 2014 12:17:05 +0530 Message-Id: <1390805225-24389-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , PTR_RET is deprecated. Use PTR_ERR_OR_ZERO instead. While at it also use PTR_ERR_OR_ZERO in ion.c to simplify the code. Signed-off-by: Sachin Kamat Cc: John Stultz --- drivers/staging/android/ion/ion.c | 5 ++--- drivers/staging/android/ion/ion_heap.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 574066ff73f8..b3395924f03e 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -1017,9 +1018,7 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start, mutex_lock(&buffer->lock); vaddr = ion_buffer_kmap_get(buffer); mutex_unlock(&buffer->lock); - if (IS_ERR(vaddr)) - return PTR_ERR(vaddr); - return 0; + return PTR_ERR_OR_ZERO(vaddr); } static void ion_dma_buf_end_cpu_access(struct dma_buf *dmabuf, size_t start, diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 296c74f98dc0..03cc43222b50 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -247,7 +247,7 @@ int ion_heap_init_deferred_free(struct ion_heap *heap) if (IS_ERR(heap->task)) { pr_err("%s: creating thread for deferred free failed\n", __func__); - return PTR_RET(heap->task); + return PTR_ERR_OR_ZERO(heap->task); } return 0; }