Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2418900pxu; Fri, 18 Dec 2020 12:48:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwR/In8LrbPFEykK18+Es3UG7/w/lR2OWln83hx50bP29gKJhgsNeVT4MwOb0D7PPkqtzWL X-Received: by 2002:a17:906:b082:: with SMTP id x2mr3976861ejy.100.1608324509864; Fri, 18 Dec 2020 12:48:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608324509; cv=none; d=google.com; s=arc-20160816; b=Ja/NurrTVOfp/zJS0v5es0r4wwUi3B055XOt6Ajmo9NWTw4TeC8DOnq+b3D93AtSUd OhUxcGUtonYm0eR0tvNKhc10VQMAqa50lvLA/VkLgIJNUfjfhk0wUl2gC+i76uNBYV13 YBIs2SavmuR5mVg+GorsYccxqMUPn8u/rX3UvoLGfRzN/lkoMyZvSplVTXis3kWObD/I SKaKyq0Fp7twUNZY3tyYFtLly/vzNntCpp4494r3gNhffWsh+X8TU4mUpqHG/GAu7c9G E89lXyEIvfH7/z0lo/Zx0cVvrxkX2DL/DULno5WFimh3S7xXj3nmvz+cRlgUleA+Hnd8 Dbog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=VOfVRVMXwaXp0O1enJ1Uc/kEDU32Y6Pd6RfXGnyTX4g=; b=DhcuYdYQx64Hr4MutDnc58NFSmcwAfTliTbrkIa5A6HuAGCrFpa5Sue/+4Aboe/xtX MJyxEb5V6cymopnM6LqC7dZPpMpXc5NabsU754QmJycJnf/Nx9he4u9cqxhLq+9U3qqk qcaVLcef2pU4AHpzD5Wgll6foLwuyvS+NM3pHfct7g7kb/baS8T8l6D6EXaeolEEE5sk M/MhUn7ZXMyqkWIYxj2f4dcbHUWB40czlE7fR3YTD6hnQL02fEeB3athezyjyHGCVFuY GxnX/uRzPZlEWfSq3rwqfaw2rBGiGqicbgEKTP6kHpFg536eZWstQwwuv46A1nM+811B KSFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GEQUloU9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si5170251eje.504.2020.12.18.12.48.07; Fri, 18 Dec 2020 12:48:29 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=GEQUloU9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729161AbgLRS6k (ORCPT + 99 others); Fri, 18 Dec 2020 13:58:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbgLRS6j (ORCPT ); Fri, 18 Dec 2020 13:58:39 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF83C0617B0; Fri, 18 Dec 2020 10:57:58 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id cm17so3424734edb.4; Fri, 18 Dec 2020 10:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=VOfVRVMXwaXp0O1enJ1Uc/kEDU32Y6Pd6RfXGnyTX4g=; b=GEQUloU9U6KVXvW91AE/nU8qp/mVq/ws7uB9dVDDGiEHZrbdwGSVZNHU+Z5sMm8FTs Otz6qNQ3cjr9tedVRZ0pIp4iYL/6HOem2AIiFNx1Z1RknncF1axW+20Yytsqj1TOitzP +PleIqQeQC3rTVDYgL/S2WUxsIyYtYfzxP841dPGAYPh6PNcBRi7MqwaqQ/1nLQWNnvS 2zt1vkJeCrc+klSbsW6aR7NxHv+Iy24dLFNTD+cTVuoFA3bkvxrIv0/+vllk6f2DAlmB WxBob2LccXlm0wYFsqxQkV7RMgQIP+JcM9VmgQAQcgrSqxwdwWus3t5OqJZtj/nipl8p nskQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=VOfVRVMXwaXp0O1enJ1Uc/kEDU32Y6Pd6RfXGnyTX4g=; b=bFhapuQHt1ADDlVE/AtVNumXreceJILjKU9JWRs5ntbczhk/IW3Tu2lDGzRvEENrHc QkLAnHYRRQeKIcistu/Sn3VtlxjbOPm3MWPxeLbeoYoWulskq6SmBo2K1vNXwwjxhA+9 mj5Pv8DofOtn7KC3Qa1kkLjjEeotjJe5FeV+E//i2tDOKeglpbKKitA27PoDFtencijT h95Yav914MuwjG70G9k0xDEydtgGfHfiRmpOj5V9wN6dvksVSbR9ZkoB7bFTorUtDsxt VJzCRQex6YGBIwnWCWSjSCmqEKRiKv6PdMbHGFpi1qM8PcQkAa0gFmMWQ/cLdbhnfC/1 BLOg== X-Gm-Message-State: AOAM533zHczBf4EFAIqMAlu65/MFVj4MV8jTHqmLHwf7SWqcTDqabDOQ hpjTFKYPNqZi3BtYJxiSyJg= X-Received: by 2002:a50:a6c2:: with SMTP id f2mr5816028edc.7.1608317877019; Fri, 18 Dec 2020 10:57:57 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfce9.dynamic.kabel-deutschland.de. [95.91.252.233]) by smtp.googlemail.com with ESMTPSA id v18sm5738048ejw.18.2020.12.18.10.57.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Dec 2020 10:57:56 -0800 (PST) Message-ID: <2ce8e183f03855af6c16b2a555473cca3fbbfef6.camel@gmail.com> Subject: Re: [PATCH V3] scsi: ufs-debugfs: Add error counters From: Bean Huo To: Adrian Hunter , "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Alim Akhtar , Avri Altman , Can Guo , Stanley Chu Date: Fri, 18 Dec 2020 19:57:55 +0100 In-Reply-To: <17957d71-d45b-d5f6-8ef2-453402a23268@intel.com> References: <20201218122027.27472-1-adrian.hunter@intel.com> <17957d71-d45b-d5f6-8ef2-453402a23268@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-12-18 at 20:34 +0200, Adrian Hunter wrote: > It is OK to pass NULL or error codes as parent dentry to > debugfs_create_... > functions. > > If ufs_debugfs_root is NULL (which won't happen) then the directory > will be > created in debugfs root i.e. /sys/kernel/debug, using the device > name. > > If ufs_debugfs_root is an error code, then debugfs_create_dir will > return an > error code, and following debugfs_create_file() will return an error > code. > > > > > > + debugfs_create_file("stats", 0400, hba->debugfs_root, hba, > > > &ufs_debugfs_stats_fops); > > > > if (!debugfs_create_file("stats", 0400, hba->debugfs_root, > > hba, > > &ufs_debugfs_stats_fops)) { > > debugfs_remove(hba->debugfs_root); > > return -ENOMEM; > > Being without debugfs files is not a problem, so there is no reason > to > return an error. It is relatively rare in the kernel that code > checks the > return value of debugfs_create_file(). We really don't want to fail > probing > just because of debugfs. > > However, because debugfs' only real resource is a small amount of > memory, it > is extremely unlikely it will fail in that sense. Although you can > force it > to fail by adding the kernel command line parameter debugfs=off Adrian Sounds your choice is correct. thanks. Reviewed-by: Bean Huo