Received: by 10.223.164.202 with SMTP id h10csp3614690wrb; Tue, 28 Nov 2017 14:19:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMac0msskYHDbOeCyPlsj8MXfA0uwdZP3vn0JLtatuuaIDmxP9bZ7794FL8yO4RVYYOOY0c8 X-Received: by 10.99.125.81 with SMTP id m17mr609454pgn.279.1511907597436; Tue, 28 Nov 2017 14:19:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511907597; cv=none; d=google.com; s=arc-20160816; b=NSRWN/f9xH1Gm6UlFqxD8sCNGX3pGsMgzZTNvIDgO+qheJKJSy3ttFl5EHsW/tfYEb uiOlT1l/aYy74Q1LZYK6nNqH3PWZdYeSg7WxeSoM3+741we6p7xUs43exYjyNwdOSXp3 LXomtMQJKWwsKcqdavr7RFPqq+xcVg0Z5lXfurRKE/t5tVHXoK0CumSXtki6O1tQA3Qr Yv+X3ShWrriIROw0Z1gGQ42/k6dJONncUt1PjOCqBkvkKHZamxvhhl9gllxa0HUY1eJC qchv6bKDZer+cslmY0+KcUrvAaOPuaqoyI+4tHCgeJijVr1QVA35Y4bSD0rnKaMMgNzi Hfbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=qjAjzOXjzH1hj4nOI1C6+zMZyygKOYVWK3iPhVvxhUY=; b=N4RiA/vMsDV2Hr9flIAhK4DJRg33bgPhIROU+8qhKb0DWKX44z6PsLTycNkQ4ggFmq NFay7rU2x4M9FkF8DeVQq5Vfgm4o8aYYKTYD2xDB09wX6Xdo7NMMNhN2qbk6yM6xRf9N Zxe2Bq20bk2rDodNb2ywWYYmBLGWiltllIvzo8e70fhWrozOaIIzPp/sZPZ/bXbO2kT0 tcH6COWlV6WpU3KNrcYN4TGXCE6o4SxI4fPyZSqRV04W8h2+Y6eeaxSVfpIN9ndr8dGr RN04E6ev36hPKXTI0xCKrzw5CaqcS8+KzmUHjlpEsq1lPBL5JWtvD0gJsHeZXEkv83kE XFDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B57H7YjU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q127si148735pga.571.2017.11.28.14.19.47; Tue, 28 Nov 2017 14:19:57 -0800 (PST) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B57H7YjU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbdK1WSu (ORCPT + 70 others); Tue, 28 Nov 2017 17:18:50 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34048 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752616AbdK1WSe (ORCPT ); Tue, 28 Nov 2017 17:18:34 -0500 Received: by mail-lf0-f67.google.com with SMTP id x20so1633619lff.1; Tue, 28 Nov 2017 14:18:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qjAjzOXjzH1hj4nOI1C6+zMZyygKOYVWK3iPhVvxhUY=; b=B57H7YjUMzPR7GONZdt1qmpFQ/n+LzGDf1f9nrksO4xMBHXpIoeTlkqiC2MgDxsU/k YeF+KRK1MWS/yuqG2HDL7D9OrFmf7rtpJ/CaW/uTnCeTv/Im8ZtUHmpIWa7+L3ewMqkQ cfoy2VZiwSgfuTOqB+4NEQW+nMDUcYXkLuIs5iOvknetq8GosQRnQaFxGC0yw/Bj/2n3 02UBz2VyUWqCATDQNRDzSfQZVeJuglQ7kzuBNbmYuAMTvicDHxtGR6LPDbbRbU3kmAav 4iCLdugiqjcleTJNERwUBZWkei0G7GWi9kMmDusUkzmYpe6Rp1tqLYRGSVKSdjMFO9O8 ZTeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qjAjzOXjzH1hj4nOI1C6+zMZyygKOYVWK3iPhVvxhUY=; b=kg1G92lk4aDKDTPvWAy9vAAYMIx5+fUO0e9YWrQE/JRrBRRcqLafIOe7/qXVrpjsQt lReE8zP1gcy4fKjfEEjhjYhJQ9gCPb88cB2l+unxWyHxcCAb1FGe8sG+pqZp9PFpMcOm ZuSPeUV5y5qMmxpMgjB0cgW+cCX9dLlasYmKV4FViDs5XtOdLv/q2einoZlXU2vQgHUr AkzNrSCrt7aagHpZad8405SRfU0wMdUdnfCUeu5gQMrewJ6KuVcEOvC5DtdcLPwEtsk/ iTAhV3geoDOSf6Ri6ydwf9ETicBC7agIjGsTcDfc4h9sRXAFr9S4du30AHQMkh5VwWgg 2rSg== X-Gm-Message-State: AJaThX7jNSrfeSDkWRjPANwB4Ivp2JVzBTLT/vyyaYaoeJncnKr4i6T9 03IAWeQ+cmj6uTBAWwrNUe4= X-Received: by 10.25.20.77 with SMTP id k74mr261143lfi.80.1511907512904; Tue, 28 Nov 2017 14:18:32 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id 86sm37111lft.13.2017.11.28.14.18.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Nov 2017 14:18:32 -0800 (PST) From: Vasyl Gomonovych To: thierry.reding@gmail.com, airlied@linux.ie, jonathanh@nvidia.com, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, gomonovych@gmail.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH] drm/tegra: gem: Use PTR_ERR_OR_ZERO() Date: Tue, 28 Nov 2017 23:18:22 +0100 Message-Id: <1511907502-11528-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix ptr_ret.cocci warnings: drivers/gpu/drm/tegra/gem.c:420:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych --- drivers/gpu/drm/tegra/gem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index ab1e53d434e8..a40148cd0957 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -417,10 +417,8 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, bo = tegra_bo_create_with_handle(file, drm, args->size, 0, &args->handle); - if (IS_ERR(bo)) - return PTR_ERR(bo); - return 0; + return PTR_ERR_OR_ZERO(bo); } static int tegra_bo_fault(struct vm_fault *vmf) -- 1.9.1 From 1585462312900027075@xxx Thu Nov 30 04:04:47 +0000 2017 X-GM-THRID: 1585419272256215063 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread