Received: by 10.223.164.202 with SMTP id h10csp3171172wrb; Tue, 28 Nov 2017 07:14:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMbBwG6hnbSZSYtOIm2vBUXT6+G0dhCEEQvrg/8F/CBId+nQ4pYknr3RIDiZbDg+i9nLe5iE X-Received: by 10.84.132.65 with SMTP id 59mr42549901ple.146.1511882070598; Tue, 28 Nov 2017 07:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511882070; cv=none; d=google.com; s=arc-20160816; b=G/+eTc4sueGwktP5mB1Ebxm3JnQdKKjmWt7wed+fVYPzSH0CUQ1ZWd1r1KEOSKaaxf rK0ziH1uvt8qjsEDBXROhWJ49L1G7Yr/mhhLZH9POlVLU2bhzM5RvIeu273odAIC55xZ 1hhkOjIOQsLTzsjvcR1+AlMhYq6FJMZpoo7nIwHMlgUPDhgL5/oFKV1Fp2J/s619+qXa 2yDdiABYmkvMdeAhy50dd4V4/gfF4rjBj9y9PyYp5s6rY5edXe2RfzD4m+6LIHc4XGsn uHDBvHLJs+A3BH4eeeeOLWRQl4AUT53xrXTAXUROudQ5/CYv5d541wXyQzbciNaiXs1e 6rug== 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=7zKsqVR1G9ArF2gSmKq2xwhYbPtjiIScejre3LJTlrU=; b=VzyUN4yh08FQe9bDk82PfFsg8r5tTMxPp6tX/dBhr04KwYAD8BO3VpBdy9FuJqRBCI m9W4JWMucCUYr6So95rfls8yoeEvJJP8JXS7wYiksfRoLPCWTQLpUH36Ity2AQgxZCVm 1Azo4LOfdhycwH8BjA66EBbDMnT02gMeMKHLBXf4PX/GKW/2Wdbd6uQzbEnXqnYHWT21 SK/UlHX9QVVPrWUXSeD4WFYSUzF1+g4+g+TWB5zpCcWQu5ZngQ0tCfqXUEV97fIu5lDJ xigXDDz0/s1t0cmuAV4EaZZnU2EJdkcyVhjGxRUdupj7PlMcMVY6afK8fMR+ghR05ajX Gofg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dewjvitV; 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 r76si27519896pfl.194.2017.11.28.07.14.18; Tue, 28 Nov 2017 07:14:30 -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=dewjvitV; 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 S1753133AbdK1PNk (ORCPT + 77 others); Tue, 28 Nov 2017 10:13:40 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:40086 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbdK1PNi (ORCPT ); Tue, 28 Nov 2017 10:13:38 -0500 Received: by mail-lf0-f67.google.com with SMTP id t197so170340lfe.7 for ; Tue, 28 Nov 2017 07:13:37 -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=7zKsqVR1G9ArF2gSmKq2xwhYbPtjiIScejre3LJTlrU=; b=dewjvitVBn9U03r84TyhfaVF5VOwCCAHsbzuloav1I/aPTEm/g/rOMEcraHR5Xsto9 fKjrfgmKbuzdvL7mkPAlix8mWHX3zgwDX1OYl9/C3BW5yimc8h4JYY6CNmP2eEF1M1xS WI9DgkdyQ36dB+nodGvWAd96u83RUD7jQO6tmTvQUJF5dauQEHQy9QQzMON6/S9u1hRz JHtP1bxmTWSGsi56eyo1OHgrC/BxXN52I5U6M80cu72xUZkyFlG9IHFCa1aR8qphSzdP XlzCauHWJgGzDKr+PdmSNt3XvAKPOmlFGwajmnesV24AXes3+IlKRrK0egUO0VU1iORY PtZg== 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=7zKsqVR1G9ArF2gSmKq2xwhYbPtjiIScejre3LJTlrU=; b=S7kh+BxCO8ppcdsrp7UI7MrFcRtztzxJc685fzrkjZDzi6cBQZYALa5JURDalNZi3S isqKoZqk1JNSjrfYZOPL4frmAT9Z+hLVRJDk46P+08LE2H1lqqkdI0XlwiZzhZQ14EKf I3WCkYadxJgsy1ew4Gw/YNVghrXWa7fIJVSG4QcyhyccFEOx0ADoF6BzR/qFWy6XNNrb kx0MCjLIetvI3AsUVvfBHtHDLBJb+sXuuGeb8BBtcjU+H5Z6IlAlAzn30fV75Vyt04FB mlySIFcAFqOS1el1tnsmn4uBHioSRfU6tObf6CddqtYs1431Q/CVQHva9YekFImLPEPD C90g== X-Gm-Message-State: AJaThX6PDMNRXzBsBNKdhkxstDqav+z47S4YeWKjqbLWYmOsgC29BZex 58hKcw+vyYmI1E1c7Kq/J4EOe4je X-Received: by 10.46.84.86 with SMTP id y22mr8750238ljd.89.1511882016769; Tue, 28 Nov 2017 07:13:36 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id s76sm5251888lfi.56.2017.11.28.07.13.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Nov 2017 07:13:34 -0800 (PST) From: Vasyl Gomonovych To: linux-kernel@vger.kernel.org Cc: gomonovych@gmail.com Subject: [PATCH] DCA: Use PTR_ERR_OR_ZERO() Date: Tue, 28 Nov 2017 16:13:24 +0100 Message-Id: <1511882004-24515-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/dca/dca-sysfs.c:43: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/dca/dca-sysfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index 126cf295b198..b2f8be048089 100644 --- a/drivers/dca/dca-sysfs.c +++ b/drivers/dca/dca-sysfs.c @@ -40,9 +40,7 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL, "requester%d", req_count++); - if (IS_ERR(cd)) - return PTR_ERR(cd); - return 0; + return PTR_ERR_OR_ZERO(cd); } void dca_sysfs_remove_req(struct dca_provider *dca, int slot) -- 1.9.1 From 1585364357935658997@xxx Wed Nov 29 02:07:50 +0000 2017 X-GM-THRID: 1585364357935658997 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread