Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp356512rwd; Sat, 13 May 2023 20:45:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7kz30kD1g//LwvXgo+0VgEhaksP1GByEvkP1UdMDp93hg+NdVuDt3aMxOz9u1Gf86EpLE5 X-Received: by 2002:a05:6a00:2d85:b0:646:8515:c763 with SMTP id fb5-20020a056a002d8500b006468515c763mr27028693pfb.9.1684035929112; Sat, 13 May 2023 20:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684035929; cv=none; d=google.com; s=arc-20160816; b=nn+3fZayKz5CeaBOP6MIsOEgNl6XRkM6Dpm6ybNMmg79jYU9syQxwcu4sin22ti/Ie 4LOGb0nyj3YG6eVgUCH0q+c5aMimOaZGSvKwluNH8qnENKd0lLrpM/dUtjSN6aOv+8KU tFppOcR6L1BJX5+F6QeHx4BwlUmygpeuo8Kp6JK7DI0XJjbAlYboU4zR0ym73yKJg1tN +obsNKTYzhDzSlLXyIphp+G8iK3YZFWyRUMvfb4ou8b1c7sPKRZyZcXjZlihlwqLf71S StHWBgkM+v6aSiFg5O4LFjsE9DEwTLhlMKex/JM53wf8kma4cJOVBh+TCsDTcny5H7F7 TB+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zlkb8r/vunwwob0pzrUW9lvtNsObUXUg+QXQXBJ/E+c=; b=D21PybGptXaX/P/knTlo7xRsgk/h/+FlrIIGUswUBzYgGEcHM1P+wXSvj08wZOZUXR gIVZUSSMxz2gkug+OH0QUlZE0eYD+SHWENIw0+hDR2O1ozTl3ppe6X2C2/B9xtzX2xn6 sKKjUX1eulw0yn96/tX2QsvD7jT1YxfTdyzIlKFzVP0VX9rMFmvx70BZlNbInwq9K1gv vWmXSzvc8fJK4c4pn5JUZhrzvnbTiMyOfneKfulGRkzwShpWx8p6rejI0Y691FLI0Ooj hr3cBkzRtQwLnyzOv0cIHlFiKFypCnKJqkiyQCiYu2q3V8GEUrfQA6KXnjIkTItv+A+5 GwPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VOBOZyxJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020aa78e91000000b0063d33fc3e08si14095682pfr.79.2023.05.13.20.45.03; Sat, 13 May 2023 20:45:29 -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=@kernel.org header.s=k20201202 header.b=VOBOZyxJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230496AbjENDJI (ORCPT + 99 others); Sat, 13 May 2023 23:09:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjENDJD (ORCPT ); Sat, 13 May 2023 23:09:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A0D51BDC for ; Sat, 13 May 2023 20:09:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 987C860989 for ; Sun, 14 May 2023 03:09:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CECEC433D2 for ; Sun, 14 May 2023 03:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684033742; bh=tn/b5nGJCsepGZi2dbYA45zwbk8oczOejMOPqJtpC7Q=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VOBOZyxJKKyHOmtkUljxhyfXvdzH3+SezeVJLpK1eKjgqkAkkvynaEhr+2qQ/8mTF 8M+JXtwOT2gC5DaOU/y2AAQDlMh28y7PH7D9atCL2HntpStS5RZY0Az/WJZXyFixYi zAPDPwUz3MT+kXmO1yoAxnh18Uxv8k9G4Jk+jn/LF0y9Umb05pTTnaHUMCGe4UaaKq nxFMMfk6vaJ1ZfQ7KHvN2OeMa+WtJwe4gLX6srNRl+psJ5uPdanm7kmLAuGJbAPU3Q C+ro9LPv+zGvhotpdLvrO4Xajq00vSQsix8yX1vudaMZ2+4xG1XdRVc4rkF+MMsTC0 t7hevlSNfe8YQ== Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-9659443fb56so1793227966b.2 for ; Sat, 13 May 2023 20:09:01 -0700 (PDT) X-Gm-Message-State: AC+VfDxN6+DXAeiwNjJfs9EMhDqALIIk/awZj6wCGveH0pzluPed70Dn b1VKbt3d1tcJwJ27OmCtDILhhI3NDrdji84Fw1E= X-Received: by 2002:a17:907:97d0:b0:969:7739:2eb7 with SMTP id js16-20020a17090797d000b0096977392eb7mr20654208ejc.4.1684033740317; Sat, 13 May 2023 20:09:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Huacai Chen Date: Sun, 14 May 2023 11:08:48 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] loongarch: fix debugfs_create_dir error checking To: mirimmad@outlook.com Cc: skhan@linuxfoundation.org, Immad Mir , Ivan Orlov , WANG Xuerui , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Hi, Immad, On Sat, May 13, 2023 at 10:46=E2=80=AFPM wrote: > > From: Immad Mir > > The debugfs_create_dir returns ERR_PTR incase of an error and the > correct way of checking it by using the IS_ERR inline function, and > not the simple null comparision. This patch fixes this. > > Suggested-By: Ivan Orlov > Signed-off-by: Immad Mir > --- > arch/loongarch/kernel/unaligned.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/loongarch/kernel/unaligned.c b/arch/loongarch/kernel/un= aligned.c > index bdff825d2..be2a5bdc5 100644 > --- a/arch/loongarch/kernel/unaligned.c > +++ b/arch/loongarch/kernel/unaligned.c > @@ -485,7 +485,7 @@ static int __init debugfs_unaligned(void) > struct dentry *d; > > d =3D debugfs_create_dir("loongarch", NULL); > - if (!d) > + if (IS_ERR(d)) Maybe we need IS_ERR_OR_NULL() here? Huacai > return -ENOMEM; > > debugfs_create_u32("unaligned_instructions_user", > -- > 2.40.0 >