From patchwork Sat Oct 29 01:25:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 12614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1132480wru; Fri, 28 Oct 2022 18:34:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4oSUrOEXZn82CoKjmOQlRWiA9F4eHdfHNoYu1FGN4NVP0tCN65gvg8qIyciXQI/b6Ej1v3 X-Received: by 2002:a05:6402:90c:b0:457:b5ce:5f18 with SMTP id g12-20020a056402090c00b00457b5ce5f18mr2159463edz.309.1667007257781; Fri, 28 Oct 2022 18:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667007257; cv=none; d=google.com; s=arc-20160816; b=aNSB5zNfBYdLuyriAgtwNNZXcE/SySb+pyc6bw2dgDyV0Rl26tQGJxYwNi/ODnDixN N7t3zBWFc4sGIoa4lyWviITzpQDopaS82WRWNFEPo30YKEDxWDxLXh+2LGMnA2ARN8nV AZD114RPAdtXL0HJ4U65osbaCFVEdyRuoS64ugcWk896Cp5ukYFY8/zThGAQz/6YKCpZ 7RlXXIN9Czd/yvEGdakPu+XF3FEs0bFHoKBCElglK0GTfvUV5sp3Bmw7qt8OpceUyei+ AdEpMVD1dxG06BKDpg90ANwIRRDw3sgCbuyAoh8maSRe9+US+f3NZNgdFFW6En36MFqp BIiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=9vLvGno+O1MVbEAOR4s5qMZglogqyZsRNlNe0IsNrDM=; b=nVekuVYND+uPXbgS4tz6XNhH0LbTI3obiPmAXXY5NHtl0xIpjwQls4Yr9EgQM8xJ2+ TrAeejoXHZXdh8fXaFxWHpM0mNrWgx/KqDluVNK+qMgd8KUqzxyBZ30ZXF5Z3TD5ebPO 6xhPyd3sk4YHLtHETs6Ps7ktll0Y+4empGKumUqv9IVNIXR6u08G6839VT35cMhpO3Py tq4p7N6j121hLCKPinDEAXYBviw+SEvt3J4Y2HRCrpiakGij8/6lYHiw91w/mW4LduR4 Ty2wyTftvJdHynxB2v4jpUTst80x///ZCLPtW2y7hEAChKDmOni3D78z7BC/KMddfTHG ZMRA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a9-20020a1709062b0900b0078decbc3f73si219007ejg.460.2022.10.28.18.33.54; Fri, 28 Oct 2022 18:34: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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbiJ2B22 (ORCPT + 99 others); Fri, 28 Oct 2022 21:28:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiJ2B20 (ORCPT ); Fri, 28 Oct 2022 21:28:26 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 325B013F87; Fri, 28 Oct 2022 18:28:26 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MzhYp6j8DzFqRp; Sat, 29 Oct 2022 09:25:34 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 29 Oct 2022 09:28:24 +0800 From: Xiu Jianfeng To: , , , CC: , , Subject: [PATCH] apparmor: Add __init annotation to aa_{setup/teardown}_dfa_engine() Date: Sat, 29 Oct 2022 09:25:05 +0800 Message-ID: <20221029012505.227136-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747983802315938380?= X-GMAIL-MSGID: =?utf-8?q?1747983802315938380?= The aa_setup_dfa_engine() and aa_teardown_dfa_engine() is only called in apparmor_init(), so let us add __init annotation to them. Fixes: 11c236b89d7c ("apparmor: add a default null dfa") Signed-off-by: Xiu Jianfeng Acked-by: John Johansen --- security/apparmor/match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/apparmor/match.c b/security/apparmor/match.c index 5095c26ca683..b97ef5e1db73 100644 --- a/security/apparmor/match.c +++ b/security/apparmor/match.c @@ -31,7 +31,7 @@ static char stacksplitdfa_src[] = { }; struct aa_dfa *stacksplitdfa; -int aa_setup_dfa_engine(void) +int __init aa_setup_dfa_engine(void) { int error; @@ -59,7 +59,7 @@ int aa_setup_dfa_engine(void) return 0; } -void aa_teardown_dfa_engine(void) +void __init aa_teardown_dfa_engine(void) { aa_put_dfa(stacksplitdfa); aa_put_dfa(nulldfa);