Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19313645rwd; Wed, 28 Jun 2023 07:48:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7sfy+T0gtAwCOpBqHFNs+FWRlFJMAk9zdYcs0GARzjRX6lx61+W+B1dDT1/tX1CHhRLvd0 X-Received: by 2002:a17:907:869e:b0:98e:35b2:6bab with SMTP id qa30-20020a170907869e00b0098e35b26babmr9059747ejc.73.1687963733304; Wed, 28 Jun 2023 07:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687963733; cv=none; d=google.com; s=arc-20160816; b=ChhG/vch2vbT2fUt4AsRPx4NTZL5thsM++NP4KmV0/Y4py4ybsFJQuubp5HVihOU3Q nWpdzIJ5KyKfVRn1GqmbCWzgvT9GXTURriQn5cgUlG15vvRNm+8xOQ1jWZSbXTb98lzR MobKCrPrJn1bpRiGDHpZ5VrtfXVfQ3224X2UMrxNRkvJLciU9N9ZrnyWt+yWgQ1IaZNq D4IpSuxybIZZ65IGjTnPUTWyyl+qNjgQkayo1x+ROioVSvIGdqeJy4Wa7HgTR13SqKRm 2ybIbxam8SOHSlFaJmzMbfaLVdsyMpx6iTC2gWVuIfWE/e4t5bc49nYR5MMyT9mF00Zy DjmA== 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=hu3zxwzuNchHyzfb145sTCmE5RxggmdMI5lbHs6ZIBI=; fh=K74Qn206kGRPL3/sFv33w+Mj3HfY70If53lrzWbJBvM=; b=mpysLNAodu5LetakunRNdGVsw7LcJR0vTkP/KfifsQEyJ26tLs3WduRDdndpl9TG6z kG8+vo8l0Q2orQEsGCpTCpFQMh9L9ptxS+zF+7VDhKU6LP+Umu+vDNnevwa2jCLtyHzm 2k4HdxC+pos11onrud1oCj/jib7C34eHXi1YJVE3RdNhpzDyAZZSKTf/lnK8XLjANw0j +ci/G7E8MZm2/h+fZrmTCD2YlwMOvpJvv+R5S8XXlbiX5DS1ep0vsKLiF+ajcFCAjfDv ec/187I9XR6sx3WyR6Nk6iahROdICjhPrc7Iy8UzPmuaXs81YE+nANKx7YrKfydHUtXU jCDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=m5C7Z7Vh; 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 x15-20020a170906710f00b00991f8bce3ccsi2776397ejj.721.2023.06.28.07.48.28; Wed, 28 Jun 2023 07:48:53 -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=@xen0n.name header.s=mail header.b=m5C7Z7Vh; 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 S230021AbjF1OXD (ORCPT + 99 others); Wed, 28 Jun 2023 10:23:03 -0400 Received: from mail.xen0n.name ([115.28.160.31]:38314 "EHLO mailbox.box.xen0n.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbjF1OWY (ORCPT ); Wed, 28 Jun 2023 10:22:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1687962141; bh=KteBACahesOTtph0p7WmbToRdVIApqR3ig8QwMvsL1U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=m5C7Z7Vh/RSqq7hVsCH8Pwe6vJ3Zz7iRb3ONjRRqfY72GyqXfmTxGErKyo3/rHexH 48Ox9N7CQ1f5Olb5MKEUDKIyhZxUJlvNgLPu0doMS7lsrLXe2YHO/ptv978GXowT/k svHobETosQ9GQedwM59HMbEYAFRziWU0zD5SeFkA= Received: from [100.100.34.13] (unknown [220.248.53.61]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 5700360112; Wed, 28 Jun 2023 22:22:21 +0800 (CST) Message-ID: <2217f142-470d-b467-6ad8-b1d7c0aee2c8@xen0n.name> Date: Wed, 28 Jun 2023 22:22:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] LoongArch: Delete debugfs checking Content-Language: en-US To: Dan Carpenter , Ivan Orlov , Immad Mir Cc: Huacai Chen , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <7627f2b9-2287-46d2-b461-d33aa69931a8@moroto.mountain> From: WANG Xuerui In-Reply-To: <7627f2b9-2287-46d2-b461-d33aa69931a8@moroto.mountain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2023/6/20 16:06, Dan Carpenter wrote: > Debugfs functions are not supposed to be checked for errors. This > is sort of unusual but it is described in the comments for the > debugfs_create_dir() function. Also debugfs_create_dir() can never > return NULL. > > Signed-off-by: Dan Carpenter > --- > I spotted this code because I was looking at patches which were sent > to stable but without a Fixes tag. The correct way of checking for > error pointers is not IS_ERR_OR_NULL(), it's IS_ERR(). When a function > returns both error pointers and NULL, the NULL should be treated as a > special kind of success. Please see my blog for more details. > > https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/ > > I have not included a Fixes tag here, because it's not really a bug fix, > it's just a clean up. Thanks for the patch and sorry for the late review. I didn't notice this back then (just recovering from covid around that time) but since loongarch-next isn't tagged yet I think the patch could make it this cycle. (Somehow Huacai didn't see the mail either, weird...) > > arch/loongarch/kernel/unaligned.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/loongarch/kernel/unaligned.c b/arch/loongarch/kernel/unaligned.c > index 85fae3d2d71a..3abf163dda05 100644 > --- a/arch/loongarch/kernel/unaligned.c > +++ b/arch/loongarch/kernel/unaligned.c > @@ -485,8 +485,6 @@ static int __init debugfs_unaligned(void) > struct dentry *d; > > d = debugfs_create_dir("loongarch", NULL); > - if (IS_ERR_OR_NULL(d)) > - return -ENOMEM; > > debugfs_create_u32("unaligned_instructions_user", > S_IRUGO, d, &unaligned_instructions_user); Trivial enough, thanks! Reviewed-by: WANG Xuerui -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/