Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4629766ybv; Wed, 26 Feb 2020 00:13:42 -0800 (PST) X-Google-Smtp-Source: APXvYqyJfgOUPBDMZFVA9Yfr5HtldvLQDQgepU1b4opegqwu82BKORKoKvi1BAe+AXxoqbg2R7P0 X-Received: by 2002:aca:3017:: with SMTP id w23mr2042587oiw.152.1582704822679; Wed, 26 Feb 2020 00:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582704822; cv=none; d=google.com; s=arc-20160816; b=Wjd6errmrSEN9uL0GDHfedVo3QeTdze58qQqq8A3iCr6oJLztl+0XWG6JiJbkh8arD 7h0a9lLZ/i6I7DcoBfG8QCwE0CXUdO50Uf1Ac5KEQg28fS4P6PiHXc7BimM55GJFRrHS 9URheMibUe1cah51XJWyctMq0zAcIBiLIw4KnhgLv+UImPbZEtZegoFZ3P6JMDCNWUtO V0jlCoYSa3/tTeeq6OvwRIhVY1jPAWsbqEsyCExY/XNP+/d6CAe6I9RFI5Hsp6nNElCn qOWjTTIMaAr8AOV15Kc81Mel7eL4FfmSYXDqCuyH4DztY/asy+JhEpjhyDyBqFIA5/C/ X/DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NEbdSz2moNnETwBLt4zZ+s3zd+tfSG4zGTYIhDfQMhI=; b=OhiuMvWu/vKKG0mNKJl8YyH48OijKQXXEjkdO/5+Z8lvXumfcIV9CeqGKw4zUIwTd9 uxl6wi2rq6y17Xg41yDyPAuxdTNT0/gTp2/JxMap8IcGMNP463BuMQk67k4y0WtlWV1B A+WPpVK3D4yG6K8NZtFNbR7zz6JyM6Jneieot+/e1dBOpP7MHQCZY2tno997GTLbww5s Qx2A4OvRHnGGDlP7hTRm6pTbsXtFTP1+8NxsI7oUfcCBQUltVuyMiDIvQLAPa4+YJj2f pjiJCWN4E2KQKyEmOzZ2PFhlYd2vzcsD4c51Bos0T7DT7JnpeXecEhXo3HINLGhQk+Sm OqCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2FFrYzro; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si851006oto.194.2020.02.26.00.13.30; Wed, 26 Feb 2020 00:13:42 -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=@kernel.org header.s=default header.b=2FFrYzro; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbgBZIMQ (ORCPT + 99 others); Wed, 26 Feb 2020 03:12:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:38488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbgBZIMP (ORCPT ); Wed, 26 Feb 2020 03:12:15 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EC742084E; Wed, 26 Feb 2020 08:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582704734; bh=HD4JJzN6Z5ogdBDJmkareqDDQZ1mEISl+bI1EQcysu4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2FFrYzrog7zCSkIvxSZkC2a9VskGHr2Lbs9LbrBVh2Ot+CSftgUMaACNe3/KWbwPs ckA2ny2Vl22Ae2Ogff43DbnMgu1tT0f1yRo4dQS1KhBlD+eZWWmG8lh0ruREjNKtJ3 VHeZsgGK7tZ1mVAmrR+Rwqm/M0z7y9aCaGXP1Qzs= Date: Wed, 26 Feb 2020 09:12:11 +0100 From: Greg KH To: Luigi Rizzo Cc: linux-kernel@vger.kernel.org, mhiramat@kernel.org, akpm@linux-foundation.org, naveen.n.rao@linux.ibm.com, changbin.du@intel.com, ardb@kernel.org, rizzo@iet.unipi.it, pabeni@redhat.com, toke@redhat.com, hawk@kernel.org Subject: Re: [PATCH 1/2] quickstats, kernel sample collector Message-ID: <20200226081211.GD22801@kroah.com> References: <20200226023027.218365-1-lrizzo@google.com> <20200226023027.218365-2-lrizzo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200226023027.218365-2-lrizzo@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 25, 2020 at 06:30:26PM -0800, Luigi Rizzo wrote: > +static int __init ks_init(void) > +{ > + ks_root = debugfs_create_dir("kstats", NULL); > + if (IS_ERR_OR_NULL(ks_root)) { > + pr_warn("kstats: cannot create debugfs root\n"); > + return PTR_ERR(ks_root); > + } Do not check debugfs_create_* calls as there is no need to. Just take the return value (if you care to use it again) and move on. Also, the check you made here is incorrect :) > + ks_control_dentry = debugfs_create_file("_control", 0644, ks_root, > + NULL, &ks_file_ops); > + if (IS_ERR_OR_NULL(ks_control_dentry)) { > + pr_warn("kstats: cannot create kstats/_control\n"); > + debugfs_remove_recursive(ks_root); > + return PTR_ERR(ks_control_dentry); > + } Same here, just call debugfs_create_file and move on. You do this same thing in other places too. thanks, greg k-h