Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34059rwd; Mon, 15 May 2023 19:32:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5B7+k640OL1IjpBnPVgEMwSyEUck70hS4l4eMIOQB5NFvIDYLf/604xUpp/XBCQJGh0VaL X-Received: by 2002:a05:6a20:7faa:b0:fa:1f3a:8f56 with SMTP id d42-20020a056a207faa00b000fa1f3a8f56mr45532744pzj.12.1684204326092; Mon, 15 May 2023 19:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684204326; cv=none; d=google.com; s=arc-20160816; b=BW5X29zaWLSmBsStWnW6PzfvZIkWGmh/jwGux4M1IQWXh81phst8gsELXOHoXYfeMh HauPD8lQQHVLAVoB2u+2ZCSV7CH2jXr/zlSqBizLCyHX1c84xi9V+qLmGBfQTCC3gt2p rMInS3XyiDZWZp/Zve0kFn6+q3Z5iEDQJTTFDRd/bGEP4XJsfIxZNCBLzrJExEaOBSD1 Bk6wNEDa1sD3iWhAc0qhkDJZ/7sEk6g6ZJG5fY0NkonpXEl/7eXdGW2lgr3wLgoqssxZ LKfmUep98cVsFNPvXdrIGEELvjc0fdRphefxhRBVV4h69AljnAw0HF59gMPra/CNnimh /IyQ== 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=/DyAtHbr7DQR/uvnn+So6Tb4VezN+T0ExbYCVR66q/U=; b=jzAgtjsPG736SjizTNGSDP4JAnZxT6GiB6J3KuyZLy2aara8t/qLcQIHAkgkREHvXY zuvTImVoUrR+OO+zItCfjRUWZFoXemXrxoalcVzUsLIQdmvCETaz62eWEnHtY0/YPGV4 SUwj6eRCaosGiurL1Oe2VqoVYzZe5WptcE5UlnAN3XpwbZd26K8yDzbg1XPkx0eLgoI+ 2W4lYTwOx5WnXevIggqlnq8ju7v/OV6XWvSSHaVh4hMuG0x48h4VJCqlqtcD1+zDJqln n2fMoKohtlEmDvsR/I+9IL6HQmOLu0s6eRk6zV+U3n8VhVB8+RBQnH4acAh3gCDRBDk9 G9kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RfL+wE+i; 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 j192-20020a638bc9000000b005303a7ca051si16736911pge.284.2023.05.15.19.31.54; Mon, 15 May 2023 19:32:06 -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=RfL+wE+i; 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 S229775AbjEPCD1 (ORCPT + 99 others); Mon, 15 May 2023 22:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229709AbjEPCD0 (ORCPT ); Mon, 15 May 2023 22:03:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 954B413E for ; Mon, 15 May 2023 19:03:25 -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 2D3D8633B8 for ; Tue, 16 May 2023 02:03:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B5EAC433A0 for ; Tue, 16 May 2023 02:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684202604; bh=ycv+VEOGv9cbrchvl8jntmN5FDbyqDgaTPIMmjcdJ2E=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RfL+wE+ijp/vwxuUi8Oeoc58fXRtexJKKEwdzdM3jh8pj6jgmWY5R1kijJkO7rprd IFIs2MHseWek6U3oemMJvtq2nSSr6OO/F85mia6BQAFi+45SCUa7SePdsilXTUm1eP A42akmSQh1XZl4OFiXKSnmD6YhlBejLzUkazlXga0g4qsfAbiA0jvkWQFl+Y1uD7y3 2GEuJJ0AutAoO3RPBZKJgwijad6mWMlzkXJjBVkfN1L8bb7LXvVUNMDNdu8RDLulwR W/u0cBu5Br8vFJkZ5Q2+NKEjtUDEhQVH6QRN9pjPUqe/1fmbTdjIMhbVJ2swcp+ESF 3fHzTB4ntWCaQ== Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-9659f452148so2468843066b.1 for ; Mon, 15 May 2023 19:03:24 -0700 (PDT) X-Gm-Message-State: AC+VfDxViEw6DjNCkRSCP5KXb4U1BDjX+6Smr3SNvLA6pKdN86XcTgts rrTiesITpPEyfrwtr/WX8zy+9UMO5MMbV0BHlk4= X-Received: by 2002:a17:907:2685:b0:94f:3bf7:dacf with SMTP id bn5-20020a170907268500b0094f3bf7dacfmr30748735ejc.71.1684202602654; Mon, 15 May 2023 19:03:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Huacai Chen Date: Tue, 16 May 2023 10:03:11 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] loongarch: fix debugfs_create_dir error checking To: mirimmad@outlook.com Cc: ivan.orlov0322@gmail.com, kernel@xen0n.name, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, mirimmad17@gmail.com, skhan@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Queued, thanks. Huacai On Sun, May 14, 2023 at 2:44=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_OR_NULL inline function, a= nd > 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..85fae3d2d 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_OR_NULL(d)) > return -ENOMEM; > > debugfs_create_u32("unaligned_instructions_user", > -- > 2.40.0 >