Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1994847rwd; Fri, 2 Jun 2023 03:20:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JMqrt5D7dU2gi2FdgAmdVJO814NlfIakJI7Seu7tT2FecQvlXNbCXd7DCa4BeUn2qXgEJ X-Received: by 2002:a92:c144:0:b0:33a:f1b2:eb6c with SMTP id b4-20020a92c144000000b0033af1b2eb6cmr8814760ilh.3.1685701249051; Fri, 02 Jun 2023 03:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685701249; cv=none; d=google.com; s=arc-20160816; b=FgL6E24kPnSFJZr6FJkNniBt2D0UfexV4NE0xBh8zswyTVxipHx1xfTT0cQSRwZ26c VImEpP4onMLdU96PsHOw5AUq8kkkKrNv4Lwx7/WU7y8epsT3GXrz4dueP2RnEV2RuS1K t+L98QRI40zI4tttGIN8w+5cP10NxIdlBm/yBewFD2GtkzqFhd9OdKptg1HZkPy5o75G s5k9WYwYLiAfg+4Sb+PlgK2zdt5/aIgkJ6yqeyy8smYIkJmmw2NDGvxG1GlgbD/EtFe7 Fss5lgLtFAl8Y5SZHRU+rk4yXR0VYekb501Mzbjy104815Ic9jnqD3POx/+akAWHwVFT K7BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=hYhRLkPi8FoDCUTYM89A2RNac7EIMazIQAo5IMuTC+s=; b=YM7RX0vgI/fg/zYNkG6zElFe5701RrdPoJ1Huyu9dWrRulaLqmOMuoHS9EIwwQs+Ay P3m8wu6XDNn6BQvnyRqg2VTzwreRYlXEXQv6Yef3fCIvrnULRBSrODVhnd3R8ytaYCZ0 +IOd3xsHlPWb2iCy+aHBbIWC6DEXWKKCWCoakM4Elnd58mNYKiPBk7xR9hnZfHO5Ie6S HeoP+xiPsacW7zyP01kwijACLKXqExOjHYJtahgvL/O7zysRN6WUvr+x8y6en+lj5Ekr Gk3wqyL0sg2Nx0xb+x8mKfvl/mxSN5diuyBOXPbaNFly2MNBQOgFO/ek24Yodji27x0C sBDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YdMQjQYD; 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=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d134-20020a63368c000000b0053fb3688fadsi786446pga.144.2023.06.02.03.20.37; Fri, 02 Jun 2023 03:20:49 -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=@samsung.com header.s=mail20170921 header.b=YdMQjQYD; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235220AbjFBKIY (ORCPT + 99 others); Fri, 2 Jun 2023 06:08:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234801AbjFBKIT (ORCPT ); Fri, 2 Jun 2023 06:08:19 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C0C7196 for ; Fri, 2 Jun 2023 03:08:16 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230602100815euoutp012055dda80234a4829c7c5b13b01878e3~kz6tc1of20428904289euoutp01f for ; Fri, 2 Jun 2023 10:08:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230602100815euoutp012055dda80234a4829c7c5b13b01878e3~kz6tc1of20428904289euoutp01f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1685700495; bh=hYhRLkPi8FoDCUTYM89A2RNac7EIMazIQAo5IMuTC+s=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=YdMQjQYDQFZKHmHEbzFHq4pdKaktxp/1Zbn5GUR7X+fBmht1BzED0www7/zs29Taw GUsBH3/xDoyXow6dHvxYKPzES4Xj1zqoYD4OZkbi66F4pH4u5oR5y5zmDlsAT2Glyb r9h3L5ISHPLuO8dkWgdVDdNN5Cs1drurIv5S7qEE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230602100814eucas1p2af69e4ad0f660befbf5aa2b2213cc394~kz6siDBzK1995219952eucas1p2t; Fri, 2 Jun 2023 10:08:14 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 81.35.37758.E8FB9746; Fri, 2 Jun 2023 11:08:14 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230602100814eucas1p15571a8954a027cecc68bf8cf670c3cc2~kz6sQWdV92168721687eucas1p1w; Fri, 2 Jun 2023 10:08:14 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230602100814eusmtrp1be4717455196156d25dc8bcf60e53fce~kz6sP5CU71803818038eusmtrp1P; Fri, 2 Jun 2023 10:08:14 +0000 (GMT) X-AuditID: cbfec7f5-7ffff7000002937e-3a-6479bf8eb6a8 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 48.E1.10549.D8FB9746; Fri, 2 Jun 2023 11:08:14 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20230602100813eusmtip1df27e3376303b6489f747f728197d58e~kz6sCO9SQ0240902409eusmtip1G; Fri, 2 Jun 2023 10:08:13 +0000 (GMT) Received: from localhost (106.210.248.205) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 2 Jun 2023 11:08:13 +0100 From: Joel Granados To: CC: , , , Joel Granados Subject: [PATCH 3/8] test_sysctl: Group node sysctl test under one func Date: Fri, 2 Jun 2023 12:08:00 +0200 Message-ID: <20230602100805.777917-4-j.granados@samsung.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230602100805.777917-1-j.granados@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [106.210.248.205] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsWy7djP87p9+ytTDOa+EbHYs/cki8XlXXPY LKbfec9mcWPCU0YHFo9NqzrZPD5vkgtgiuKySUnNySxLLdK3S+DKuDatn7XgEXfFvRvvGBsY r3F2MXJySAiYSBy/+4Wli5GLQ0hgBaPEtfvtrCAJIYEvjBLXZ0VDJD4zSux4v4MdpuPaoj52 iMRyRon3p+azwlWtXLQOatYWRokD/Y2MIC1sAjoS59/cYQaxRQTEJU6c3gwWZxaYwCgx6xAH iC0s4C7RtvwfG4jNIqAisXDjGrA7eAVsJE4+ucgIsVpeou36dDCbU8BWYtmMp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qAisXDjGrAFvAI2EiefQMyREJCX aLs+HczmFLCVWDbjKRPEYhuJ848mMUPUC0qcnPmEBWK+vETz1tnMELaExMEXL5gh5ihLTFj3 G+qBWonPf58xTmAUmYWkfRaS9llI2hcwMq9iFEktLc5Nzy021CtOzC0uzUvXS87P3cQIjKht x35u3sE479VHvUOMTByMhxglOJiVRHiFwspThHhTEiurUovy44tKc1KLDzGaAv05kVlKNDkf GNN5JfGGZgamhiZmlgamlmbGSuK8ngUdiUIC6YklqdmpqQWpRTB9TBycUg1M/MdX5h8xEr66 QrvQfc406U8rvR5ryc7d1Gx6IqzoPP9FUZ9XbcytH+sSU5/f2liv+fd76HPbs/m/gt7cOcqi LD8jdGWDSMS6Qjf99SbGZr4i8TN61y5cnc6SyLG06kR2wavV/f53KzlKJ9Zqa5y60GjEu1Mi 0bjB7rp79ewyw8m31j7XzTu2VWt/bVFQTI7nrKd7+pwXaO3rtsqTMSwNKc7NvM3/3Pz5h/1h Xz0972c2thad36FzXLxl3muPabfPRRkkzY5wYJq7qY3xS/7CHa99udpn7Y3IyvHIYz72bQ7v yeQvh41ZW7/Fl25RnnanN+azhLDDiXklbxUcdTUs3pZ7zTQOX5oaP0vc3VmJpTgj0VCLuag4 EQBdLM/BMQMAAA== X-CMS-MailID: 20230602100814eucas1p15571a8954a027cecc68bf8cf670c3cc2 X-Msg-Generator: CA X-RootMTR: 20230602100814eucas1p15571a8954a027cecc68bf8cf670c3cc2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230602100814eucas1p15571a8954a027cecc68bf8cf670c3cc2 References: <20230602100805.777917-1-j.granados@samsung.com> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 Preparation commit to add a new type of test to test_sysctl.c. We want to differentiate between node and (sub)directory tests. Signed-off-by: Joel Granados --- lib/test_sysctl.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/test_sysctl.c b/lib/test_sysctl.c index e2a816d85ea2..0cf7c547d61a 100644 --- a/lib/test_sysctl.c +++ b/lib/test_sysctl.c @@ -126,9 +126,7 @@ static struct ctl_table test_table[] = { { } }; -static struct ctl_table_header *test_sysctl_header; - -static int __init test_sysctl_init(void) +static void test_sysctl_calc_match_int_ok(void) { int i; @@ -153,7 +151,13 @@ static int __init test_sysctl_init(void) for (i = 0; i < ARRAY_SIZE(match_int); i++) if (match_int[i].defined != match_int[i].wanted) match_int_ok = 0; +} +static struct ctl_table_header *test_sysctl_header; + +static int test_sysctl_setup_node_tests(void) +{ + test_sysctl_calc_match_int_ok(); test_data.bitmap_0001 = kzalloc(SYSCTL_TEST_BITMAP_SIZE/8, GFP_KERNEL); if (!test_data.bitmap_0001) return -ENOMEM; @@ -162,8 +166,18 @@ static int __init test_sysctl_init(void) kfree(test_data.bitmap_0001); return -ENOMEM; } + return 0; } + +static int __init test_sysctl_init(void) +{ + int err; + + err = test_sysctl_setup_node_tests(); + + return err; +} module_init(test_sysctl_init); static void __exit test_sysctl_exit(void) -- 2.30.2