Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp1220719rwp; Thu, 13 Jul 2023 07:52:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlHwvcfH5qJ64c+Bsp6bvI8dQf6CHU977U7UgiMW1LXFssSTHura8vS85vWr0SA9uYaIFzNn X-Received: by 2002:a17:906:ecf5:b0:993:dd0d:10a5 with SMTP id qt21-20020a170906ecf500b00993dd0d10a5mr1758309ejb.22.1689259939710; Thu, 13 Jul 2023 07:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689259939; cv=none; d=google.com; s=arc-20160816; b=JD6467uVHUgZzKjCu0r1IxMFkBeR4jaARknQ72H/cwP+nM1CGuZlgzQPBkHOU9ob1X xxbTcURDEicBwULL8PZxDGnoxwezU5QfKLLiYN2B6wqmizMTOGdsKGBHuEK0JfpJ+2S2 Ob9R1/t3PmDRd3r5mJ9zsTEniSP4DfsVDew7nRFlwODA6N9rvNh87EuZKNCddvSVcsLQ 9Ix5dbkSjmiug1G+IE46czJ4LfVpIzmDvjxPebmOqPvWljsCLNfJA92GqZZxsIBayWhZ rUuWQF3FR7QM2E1skOlMqSy9Zc1OVnLEL+WpqwlFowZbFf1GKkqQpPrcj0MJO8nxsjJr efNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1cn7Q6I73HV7gvnlU7oQKxFR3wKoCxsTSAluUNEqkHc=; fh=PhIG9Hhx0JcKn6tw35mlAahLCbzPPDbGR1qVlpnrWRY=; b=rR7DBkDgT/VbMz7foTb870T0UW9kIZB+1Gl8DSpZpDCn//gNkmvvjD1nw2oCM6TaYE HwZVZvqCBLCaYShOA/HaMvhzrYVHrTGrPXfiftA0f5P2zV4wAj8a4omOaVvSJtaQTkjO HAvmP4e4nHky8+fI03fVYxUz5H7GdN9t81mTSOKj+3leMGLy6/c1cKlNrLFwe5A0lKCa 82idlidsdvlS6QKkDJw6bY+nwcYmBgwQs28jzoezy3ZSAr7x6kBpugN19Z2TS+s4tEoi FbjY8COVbZkcR607DXS02TwUVq/iBy07Fg7OIkGwsTMIZMUvwR8QlVwuwkQecJARs8y2 Cdgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=sOgaJ6qd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170906184a00b0098291c57810si6862580eje.704.2023.07.13.07.51.55; Thu, 13 Jul 2023 07:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=sOgaJ6qd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231165AbjGMOeT (ORCPT + 99 others); Thu, 13 Jul 2023 10:34:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230511AbjGMOeS (ORCPT ); Thu, 13 Jul 2023 10:34:18 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 034A61734; Thu, 13 Jul 2023 07:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=1cn7Q6I73HV7gvnlU7oQKxFR3wKoCxsTSAluUNEqkHc=; b=sOgaJ6qdj54VtOsq1KfsidmtDT DSiGDNgH4inaB2oU94f3BPqpXBg9phkOiRHg0PNO9Wzexpsofd1PT1A++mo2wAg1AqHEk5lgRwKVN jN6xyeGp3xCPzyP7EW1aiESBfhNcch5zQuAS8e/kjm3DrtGgre231nG1T+EA0PWNUsoAVQb6/+WqR JPwVj+zA/nGBCHTUuJVmxK0px6hKgwf8gMCDPD6pIpz8b8NwOGXDJorzzBuSlgJWDiHQSfwTmLREJ HSeK9beUgz7cDtl5p0iYlCzalxv30mST4xUQlMpX5L/41GqnpgN+BhltBjIFHUnmX9vH3fWtHpl/I FDQSYCpg==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qJxOT-003ZqM-0i; Thu, 13 Jul 2023 14:34:09 +0000 Message-ID: Date: Thu, 13 Jul 2023 07:34:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW1BBVENIIG5ldCB2MV0gYm5hOkZpeCBlcnJvciBj?= =?UTF-8?Q?hecking_for_debugfs=5fcreate=5fdir=28=29?= Content-Language: en-US To: =?UTF-8?B?546L5piOLei9r+S7tuW6leWxguaKgOacr+mDqA==?= Cc: Rasesh Mody , Sudarsana Kalluru , "GR-Linux-NIC-Dev@marvell.com" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krishna Gudipati , "netdev@vger.kernel.org" , LKML References: <20230713053823.14898-1-machel@vivo.com> <27105f25-f3f9-0856-86e5-86236ce83dee@infradead.org> From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/13/23 02:05, 王明-软件底层技术部 wrote: > Ok, so I think we should delete the check operation. What do you think? If it is consistent, I will submit it again > : ) Yes, that's the idea. Thanks. > Ming > -----邮件原件----- > 发件人: Randy Dunlap > 发送时间: 2023年7月13日 13:50 > 收件人: 王明-软件底层技术部 ; Rasesh Mody ; Sudarsana Kalluru ; GR-Linux-NIC-Dev@marvell.com; David S. Miller ; Eric Dumazet ; Jakub Kicinski ; Paolo Abeni ; Krishna Gudipati ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org > 抄送: opensource.kernel > 主题: Re: [PATCH net v1] bna:Fix error checking for debugfs_create_dir() > > [Some people who received this message don't often get email from rdunlap@infradead.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > Hi-- > > On 7/12/23 22:38, Wang Ming wrote: >> The debugfs_create_dir() function returns error pointers, it never >> returns NULL. Most incorrect error checks were fixed, but the one in >> bnad_debugfs_init() was forgotten. >> >> Fix the remaining error check. >> >> Signed-off-by: Wang Ming >> >> Fixes: 7afc5dbde091 ("bna: Add debugfs interface.") > > Comment from fs/debugfs/inode.c: > > * NOTE: it's expected that most callers should _ignore_ the errors returned > * by this function. Other debugfs functions handle the fact that the "dentry" > * passed to them could be an error and they don't crash in that case. > * Drivers should generally work fine even if debugfs fails to init anyway. > > so no, drivers should not usually care about debugfs function call results. > Is there some special case here? > >> --- >> drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c >> b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c >> index 04ad0f2b9677..678a3668a041 100644 >> --- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c >> +++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c >> @@ -512,7 +512,7 @@ bnad_debugfs_init(struct bnad *bnad) >> if (!bnad->port_debugfs_root) { >> bnad->port_debugfs_root = >> debugfs_create_dir(name, bna_debugfs_root); >> - if (!bnad->port_debugfs_root) { >> + if (IS_ERR(bnad->port_debugfs_root)) { >> netdev_warn(bnad->netdev, >> "debugfs root dir creation failed\n"); >> return; > > -- > ~Randy -- ~Randy