Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2275729rwd; Wed, 14 Jun 2023 00:01:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4UkyDbdBLrci0MNh2IT82YgrVNZAq8xFRDqfkGj0nhUdMTBoE4jncYMUu7U91vyKjct0SB X-Received: by 2002:a17:907:60cd:b0:982:66e5:64fc with SMTP id hv13-20020a17090760cd00b0098266e564fcmr786589ejc.44.1686726077133; Wed, 14 Jun 2023 00:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686726077; cv=none; d=google.com; s=arc-20160816; b=ujr3o+9PYLrkcppUSKeYmH+E82ey2i/st5DO8YINtTtU+ZKZ+ySttOiW8mRpI2JOk7 50/r/WwaX71TSqMlCshcBST+KzTJi/N+yODGywejxWG2pt/+MzB2qNHGCl+cgyEcNkug iwOdxrJogkq/1GQisHvZiiCaHHWIsXqO+6oC8eigOyTTiNACH1EUf1OadpaXr22KisxL nHtncTBNW8O6OhmbtM2ikzocGnDXk1BiF+wjg802iigBva8mUix9P3U2uOaRuj0PAGjP O6q3wKUboyi1iO/UnZIn7Efa7mD0Wm5xHRFjnjF68IJoVLUR4jxFk4OCyz4nmMcB3BMP 2gAQ== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=Kf6zgkDUnecNfzu3j5XSu5/huKGd/SdarF/Qmk9HXkg=; b=E/j/N3xsUTgs+impT/JTuTRjwcHy1lfIpWWF0VCwTlB6bOeeFLa7Nx8dgCEnuWqc/I nmIepXM15XG/ilE8iiNTr7crSbGfnbPa3/Ckk8IgpmKi5csVHG2levM2p9vapHz8Ib32 6647hXJC+zdGb3zOwltPEhciMqoVA6j9nv30awq3JlE6F4zqznFeM9xRDuzgo/38taX4 3XxIMrzMNUBXtbTPRc8Wl/PU0c2HRFF9SWiOCyhzw/IgCV+fBRT4CuJIDYxpCV0/HScI RdIwCw2QHNMnHdFm998wUCKiv7dsWO+ITrFmKeVT4A76qHZaVdxjUJ7lvLxOB4itWKfN bwQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZgToFv6k; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y13-20020a1709064b0d00b009788a112566si7391758eju.116.2023.06.14.00.00.51; Wed, 14 Jun 2023 00:01:17 -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=@bootlin.com header.s=gm1 header.b=ZgToFv6k; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243161AbjFNGbJ (ORCPT + 99 others); Wed, 14 Jun 2023 02:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243154AbjFNGal (ORCPT ); Wed, 14 Jun 2023 02:30:41 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701421FCC for ; Tue, 13 Jun 2023 23:30:22 -0700 (PDT) X-GND-Sasl: miquel.raynal@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1686724220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kf6zgkDUnecNfzu3j5XSu5/huKGd/SdarF/Qmk9HXkg=; b=ZgToFv6kXV0KhJSTl92ii6RlUbRLDMkIf2OuYuvSLGVaebwUuK5+kRvMfry1Rcq2lIj8Ot AmilI1hLbUuCrTC/xguPSLN5yJOM5WhMA0t0LL/LtaIVkR6/kyhk4lcSA8ILjkigNwP2Mh dTLbaKcRRnnfzhsIpLI1NfP81x8bXVc3dDmV3G0RoaGcpyM4AuUz5smiDioeHngUjqL2UL sgHvPHHZQKImn5RxxXLQhlZnUCqlrPO+mx/YaaALv0e5Zb2yon35hK33cXYMuwt6IXmkkm nt5rfa1vK19j5oO300bAmg6D2aFMP8/cvWu0I9+KIBTg4jLfN6Bi3yEBKAmCpg== X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 144CFFF806; Wed, 14 Jun 2023 06:30:19 +0000 (UTC) From: Miquel Raynal To: Srinivas Kandagatla Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , , Thomas Petazzoni , Luka Perkov , Robert Marko , Miquel Raynal Subject: [PATCH v4 1/4] sysfs: Improve readability by following the kernel coding style Date: Wed, 14 Jun 2023 08:30:15 +0200 Message-Id: <20230614063018.2419043-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230614063018.2419043-1-miquel.raynal@bootlin.com> References: <20230614063018.2419043-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 The purpose of the if/else block is to select the right sysfs directory entry to be used for the files creation. At a first look when you have the file in front of you, it really seems like the "create_files()" lines right after the block are badly indented and the "else" does not guard. In practice the code is correct but lacks curly brackets to show where the big if/else block actually ends. Add these brackets to comply with the current kernel coding style and to ease the understanding of the whole logic. Signed-off-by: Miquel Raynal --- fs/sysfs/group.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index eeb0e3099421..990309132c93 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -142,8 +142,10 @@ static int internal_create_group(struct kobject *kobj, int update, return PTR_ERR(kn); } } - } else + } else { kn = kobj->sd; + } + kernfs_get(kn); error = create_files(kn, kobj, uid, gid, grp, update); if (error) { -- 2.34.1