Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3587998pxv; Mon, 5 Jul 2021 00:32:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC4RrwM47RW24Zlundi+Cwdl7WocP3N8KBe+WXY/oJWGtbuq3CQ6reRq1XFe8gknEG0Adm X-Received: by 2002:a05:6402:2927:: with SMTP id ee39mr15173313edb.367.1625470344484; Mon, 05 Jul 2021 00:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625470344; cv=none; d=google.com; s=arc-20160816; b=Q8PH9BOIokUc1i+QFS8PclWbM8bNalybfclutvKK9R5nLLnY8anptt4OKDpH2UX4Y8 JkhNobvcg0rMAwYyJ2s3o4K3NdNJzyKr/lyb68pSHXcWuow86Qdfvs/55kY05vw2kmcA urgNd8FbloQKc3dvWtu9KZ01vNOu7f2BDS03FsnQFhqn32ULMas+rBNvM1sW9SCVLftF pj4/+z62pCClxsZ4owydUttCs9NGPwfQmfYRCiNhf7JyaTlLVWo+6+/szqjNyBaPXZ4z l64Daf9/JKpVs+hRqCbCj77/66dBeHwAmQ/JLY94ODSVFY6tJNuR0T0M43fM2ljaNs4k 55WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YE8sOcfvxfQ7i+Ndt4CDSXxnui1maBQg5IaDAdbnCew=; b=0b11OiFjLFPasp2jLp05sPtkHtR1wNaCfLOnznM7U5N7+tBqor28tslPZxsy3QrEID u/JUa3kS+7gLRPLxKO/DSY1g4moaFvky+Ft6iDB+BzsBtTJFyWXHqUNOdHchYq8Hnc8v pXMVUMZoEf+a2tHCutH3WS1EbWPVLU4Yftc+0zvBYg9pfoozzpMcixvPNtYJagtc7ds9 o477Qw/ESJsLM8vbIfTIAdU0Xa9qjxzSYihjxIbZELd7Vzh1GhpvfGlfwQBvJ5BjeQam x4etBDoCtBUGFyShQvLn8VcJvd2vM4e8q8ERVdVz9OV69zZxd2b6yvPQMsIjo7eIH56k jYTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NY9EFz6A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb14si543449edb.366.2021.07.05.00.32.01; Mon, 05 Jul 2021 00:32:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NY9EFz6A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhGEHdJ (ORCPT + 99 others); Mon, 5 Jul 2021 03:33:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:60924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbhGEHdI (ORCPT ); Mon, 5 Jul 2021 03:33:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BAC4F6135D; Mon, 5 Jul 2021 07:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625470232; bh=NiW/HXfBqch2oY+lEOTlQYrXSsK64D3GwvR6BGZndyA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NY9EFz6AZqrFYFDfqnsVvqYabkcRKqofUQMVRgEUMX11+CK/ioJgr0Q316XZaOeXF cyGQH9s4RQUTgLnAUUuKfXNUY1yPDkK5M41JGvqF2aRqIoYkmqQiVBm/nFu0TAa8IS DQDSuP/3GsXF9VoPTthvFnvvIRyGWUcL55W3VJAM= Date: Mon, 5 Jul 2021 09:30:30 +0200 From: Greg KH To: Dipen Patel Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, warthog618@gmail.com, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, robh+dt@kernel.org Subject: Re: [RFC 02/11] drivers: Add HTE subsystem Message-ID: References: <20210625235532.19575-1-dipenp@nvidia.com> <20210625235532.19575-3-dipenp@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625235532.19575-3-dipenp@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 04:55:23PM -0700, Dipen Patel wrote: > +static void hte_chip_dbgfs_init(struct hte_device *gdev) > +{ > + const struct hte_chip *chip = gdev->chip; > + const char *name = chip->name ? chip->name : dev_name(chip->dev); > + > + gdev->dbg_root = debugfs_create_dir(name, hte_root); > + if (!gdev->dbg_root) > + return; No need to check for this, if it fails, your other debugfs calls will handle it just fine. > + > + debugfs_create_atomic_t("ts_requested", 0444, gdev->dbg_root, > + &gdev->ts_req); > + debugfs_create_u32("total_ts", 0444, gdev->dbg_root, > + &gdev->nlines); > +} > + > +static void hte_ts_dbgfs_init(const char *name, struct hte_ts_info *ei) > +{ > + if (!ei->gdev->dbg_root || !name) > + return; > + > + ei->ts_dbg_root = debugfs_create_dir(name, ei->gdev->dbg_root); > + if (!ei->ts_dbg_root) > + return; Again, no need to check. > + > + debugfs_create_size_t("ts_buffer_depth", 0444, ei->ts_dbg_root, > + &ei->buf->datum_len); > + debugfs_create_size_t("ts_buffer_watermark", 0444, ei->ts_dbg_root, > + &ei->buf->watermark); > + debugfs_create_atomic_t("dropped_timestamps", 0444, ei->ts_dbg_root, > + &ei->dropped_ts); > +} > + > +static inline void hte_dbgfs_deinit(struct dentry *root) > +{ > + if (!root) > + return; No need to check this. > + > + debugfs_remove_recursive(root); Do not wrap a single call with another call :) thanks, greg k-h