From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72DA0C31E5B for ; Tue, 18 Jun 2019 17:23:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 494052084D for ; Tue, 18 Jun 2019 17:23:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LLv1xDob"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="laceDRsA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 494052084D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3wqyIEV1tjzHKOw0pBfIStnqWR8nU2Ri7S162foy0xM=; b=LLv1xDobwHIZyN CoPcbiSZrqfaozlnEeMjKUmlqTXP5YJ4S/sZNfUuN4gzTHUtjg2JdisWu/AZlo9GbmeSCrlBlxXPa TlWcI5OyZAd3KhEFzobDVfTmLJxvTvkNSasVZCHxvazzMSUcOf0ZQsdD4I/HP96aiIgYm3kxlyPZv RVoSjzV8gdAjAif9+fxnWxiqqEohIGYd3bGKzOcYNw54bT6emiBVt+lYr1BoOyIKYYwZ9jKxo/BDu bv1GfxemTr+VnniqFvq2dqvmJBAULOmKod84zn4Tvah/qgnsn3QsAld2PHuwHkkyzEQsuC+R+bXdH pnTAC8zoOwz3lGDe1O9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdHpc-0006ki-HK; Tue, 18 Jun 2019 17:23:40 +0000 Received: from mail-io1-xd43.google.com ([2607:f8b0:4864:20::d43]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdHpY-0006eJ-Vk for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2019 17:23:38 +0000 Received: by mail-io1-xd43.google.com with SMTP id u19so31598964ior.9 for ; Tue, 18 Jun 2019 10:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=31CQoYWndUD6bpJ1UrOiQPufPpNyp2omY2nX6aWKqPw=; b=laceDRsA2Chtz3DchQl/fkgBwdNhhSZ4AzXC0VraHynOCgqrACgIZwr91LzHC8gDUy anPyVXyB/uKnPB1eRQPPxYOcJ6+HRHm/w8W6Vbe3OnhPOD1Csw7UR+WncsjXMowwK5LG 1+Zy3m5b/FTUyIssmgMHJ7vA68zGS63LG7FUoJfS4MK/Sk2siUaYg3msmzIRHooatDEL 7CFBPghEQOrpU7Oc8uX+k672M6G1Z9QLlVdiGG3//bFrEq0nImZUy9L1mJ15I1rqszeg Y3KtjpquEkRSmG5QogOOqqwPkRsnvTuqiNA1PpDLJXZWdFIuF93apXh56xC6h5qzmwGD IRxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=31CQoYWndUD6bpJ1UrOiQPufPpNyp2omY2nX6aWKqPw=; b=ceDZA9BX55JZFvxeuZOXQgypxKOyCX6ybIvO/bpyA+m+RjtlMv7/qEtEqQ1VoRsHtY YJ8HoIe3bUqhxArsNpVLF3CaOWbon3lX+uDHY2q6Xu3fiCOvbXMOB9kE3loC75RILXGz qf1G77mLdhR+kGy55ZzR3n6SocI5QoATtlYmmUDartmsYa21gmUNMgUcdwPJZxM1sujD 3H6mx+FPvhCzjafpvObDOyc66pkst8cr/pZATfRjt2g+B7P3NmOtSH4d4ow90fyb59tx 1b3nUNFFW+5bx/Z+dmYBUEpuqKrzpTHMy9B975UJ6OdaBN3A+REin4sKODPeELgQrM2K zdHQ== X-Gm-Message-State: APjAAAX1bRF9E2QerOjqRaag8zs9Jt5ixZ/QGSb7K4JUaBJOo6rJCXu5 Z5fMk9BAHvdaWY9OhtqVnBI09u3H6n5wfUJELL7WcQ== X-Google-Smtp-Source: APXvYqxwi+vsQDnxQu3lwSAUzbgZkRTa0i5oBdTkE/Atgmdfrssz4ZX0nXpfJQ69fPoRLPp76UZKfwwA8nGklNL/zFY= X-Received: by 2002:a05:6638:40c:: with SMTP id q12mr4391330jap.17.1560878615711; Tue, 18 Jun 2019 10:23:35 -0700 (PDT) MIME-Version: 1.0 References: <20190618155246.GA17788@kroah.com> In-Reply-To: <20190618155246.GA17788@kroah.com> From: Mathieu Poirier Date: Tue, 18 Jun 2019 11:23:25 -0600 Message-ID: Subject: Re: [PATCH] coresight: cpu-debug: no need to check return value of debugfs_create functions To: Greg Kroah-Hartman X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190618_102337_037205_CCE60A27 X-CRM114-Status: GOOD ( 17.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Shishkin , linux-arm-kernel , Suzuki K Poulose Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Greg, On Tue, 18 Jun 2019 at 09:52, Greg Kroah-Hartman wrote: > > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. Looking around in the kernel there is no shortage of instances where the return value of debugfs functions are checked and the logic altered based on these values. But there are also just as many that don't... It also seems counter intuitive to ignore the return value of any function, something that in most case is guaranteed to raise admonition. That being said I am sure there is a good reason to support your position - would you mind expanding a little so that I can follow? Thanks, Mathieu > > Cc: Mathieu Poirier > Cc: Suzuki K Poulose > Cc: Alexander Shishkin > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Greg Kroah-Hartman > --- > drivers/hwtracing/coresight/coresight-cpu-debug.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-cpu-debug.c b/drivers/hwtracing/coresight/coresight-cpu-debug.c > index e8819d750938..6446ed69ab2f 100644 > --- a/drivers/hwtracing/coresight/coresight-cpu-debug.c > +++ b/drivers/hwtracing/coresight/coresight-cpu-debug.c > @@ -525,23 +525,12 @@ static const struct file_operations debug_func_knob_fops = { > > static int debug_func_init(void) > { > - struct dentry *file; > int ret; > > /* Create debugfs node */ > debug_debugfs_dir = debugfs_create_dir("coresight_cpu_debug", NULL); > - if (!debug_debugfs_dir) { > - pr_err("%s: unable to create debugfs directory\n", __func__); > - return -ENOMEM; > - } > - > - file = debugfs_create_file("enable", 0644, debug_debugfs_dir, NULL, > - &debug_func_knob_fops); > - if (!file) { > - pr_err("%s: unable to create enable knob file\n", __func__); > - ret = -ENOMEM; > - goto err; > - } > + debugfs_create_file("enable", 0644, debug_debugfs_dir, NULL, > + &debug_func_knob_fops); > > /* Register function to be called for panic */ > ret = atomic_notifier_chain_register(&panic_notifier_list, > -- > 2.22.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel