Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1414956ybi; Sat, 25 May 2019 01:19:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD0R+f3k2yWuqgF+m+E8vZsck4GlPLcS/yCtBKcTw62SVsNL7yGkIhdlwUXS6+9yuUkaQM X-Received: by 2002:aa7:81d1:: with SMTP id c17mr99543906pfn.174.1558772389028; Sat, 25 May 2019 01:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558772389; cv=none; d=google.com; s=arc-20160816; b=x2B8fWBa9QlAb7IZkVOpyqTMBjLmgAMeHl0KvDQo7uT5YW5/xOuEv5vc5lVB0lzoqY pvEmDiCMJ7ie7LY1p4wLNxiLPQIpcNo5jBK2ZhdJCu14Vr0BqWz0//Kyy4AKqzccdViM 1L/4QRyE6k691CRG0ci9cRARDM5emsrm9k93ZRdgyY82vna1q7vjDf+/r8W9cLbFLpRy cNxGEnPttHlkFQszVWREUuUVVCVN6icgySBsI7ByjDA/Ni9EruXmTabwIGFBSGM7W5T+ 0/J76Tjgzo08VjJzc3Rl2IAo0NZrXipwZiFdnfnUN5UUsksoC7YgmC3xuRVSvalAjLQQ ekgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=urwobqpVOqeWHUA2ik1ydI/vY7DJ9p3a1at1hajr40U=; b=rTVyuwRbeJ5cCcmNPZenIbfLB86rOqkbcHtw5oiPwvPcswiH+f4BIa3qnx/GkfFXxJ lzdtFG6d0VGhIwHxKrErtQTF65dTIhxR2B+8LAiRMJrLX0TEFZ6GtXwhvaI6tBqXfJVf vNBctpwe0YlomBk/2uGIX94kRotTDog4RhWLQXB/zYIVKYwGoH+RG07VCwoo2QjSS9tf gtB+n7y5YoNCXh5lEKrFRQYizHgyy/vttMYitkichyo0Tly1zJtjSz6+AhqAEu01h+Hv qW4ige9FesqLgPFw12GECQt+rFq6LG1yWiRuw/YxX0VG9qUzCs5FlereG5IEMa2SNBek jFsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S8T4eCKa; 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=QUARANTINE 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 b12si7271444pge.261.2019.05.25.01.19.33; Sat, 25 May 2019 01:19:49 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S8T4eCKa; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726437AbfEYISc (ORCPT + 99 others); Sat, 25 May 2019 04:18:32 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46585 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbfEYISb (ORCPT ); Sat, 25 May 2019 04:18:31 -0400 Received: by mail-pf1-f196.google.com with SMTP id y11so1825923pfm.13 for ; Sat, 25 May 2019 01:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=urwobqpVOqeWHUA2ik1ydI/vY7DJ9p3a1at1hajr40U=; b=S8T4eCKaCoYsoURxZ5mZBNX54bF7p1VWFjVaAtDfSyoYOL1oGf/FpFWkPfTaqRIwuS uXtpM6TcZP+6F240cKgqYAMOonZlz9PyjkeP9ZhY5VIFgGK0/GXVnFJURRZJeTqbO/sR JKEWxmzoEtnWUczQyQvw8qAjvsYBQVJb/FKjjOgouFLT9yh0ZFgcZAuxWFiDTkFy4167 63gKGjTFSu4xM17yJajcm6Wgz1FezfIptRs6ODVZvT34GZ1Niv2HLUdc1er8LwZG1VYi QGdDyOVTvrh01VbOH6SYZDDpYB9GVPLTRGH2clzU0oGihl9mh8RRq7lbXeoy/MO3cRAb xCDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=urwobqpVOqeWHUA2ik1ydI/vY7DJ9p3a1at1hajr40U=; b=MwiV606s6Li11VSbM5+8PfGge99NuH1AZlB+iHxgN76WMRxra1RnWSWgI2jlV+0HWC 9o+jZxm80nJTKL6fnaHmsOkti8HRvmW3BfrWQo+qLhrsWkQuiRyX4VUT/OoaHk9xaoiO gWvLNsaYOPqqgygWSLCml8UvqwFcnPMlZGhVKoDcHdKCRCQjVw1P/w1tdRSUm0hgCZBQ d5I6ryiR5NrcDpUjxepf6iY4mg89M57wbxjJ5PTkgyXdwvHgYpH0NPCr8iufgjTeUXWG 8NBmSnp5UeWQOd+g5YjBo6uiEeINNXUXeRQLIdnoNCicKfrosoF0y5wsqWo67aWrkITB zsoA== X-Gm-Message-State: APjAAAVhqKwwgeeKN/hay1EuZPzYLbB+VfgzCDW/mwxSFOoJVy73A9yx JG70oZZ+5E0JIAKAxz/FcL/+XvSe X-Received: by 2002:a63:4006:: with SMTP id n6mr111844911pga.424.1558772311004; Sat, 25 May 2019 01:18:31 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.73]) by smtp.gmail.com with ESMTPSA id b3sm6763549pfr.146.2019.05.25.01.18.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 May 2019 01:18:30 -0700 (PDT) Date: Sat, 25 May 2019 13:48:26 +0530 From: Hariprasad Kelam To: Hariprasad Kelam , linux-kernel@vger.kernel.org Subject: [PATCH] drivers/dca: fix warning PTR_ERR_OR_ZERO can be used Message-ID: <20190525081826.GA9002@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix below warning reported by coccicheck ./drivers/dca/dca-sysfs.c:43:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Hariprasad Kelam --- drivers/dca/dca-sysfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index 126cf29..5270705 100644 --- a/drivers/dca/dca-sysfs.c +++ b/drivers/dca/dca-sysfs.c @@ -40,9 +40,8 @@ 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) -- 2.7.4