From nobody Thu Nov 28 10:58:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1670379168; cv=none; d=zohomail.com; s=zohoarc; b=PfhF9JBqgi1YBaro8gJKbzz1DVw4ez7n6cujFD+gdAp+eVP5hzQE+/rbBw78bVEhwYSbDSbor8D4X/iHqmH+QtryJ08/rxbKKm56J3nL/J9dmWE6jDvKYOvLFbxD/14GoqMuD+sGC/7MU9aaHtMjD0vf8w9YwLa3kszFWArv7QI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670379168; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=j+E8XjJSL3z3PUVgIAtqrnel+ftMorDDUFIZDkjWO6M=; b=fk/OndtnArKnl5U5jBRw+zm2EulDPsRjVWF6+9RK3cUcRVq3UT7Zw43FXFeyYOf81xP29JepJqKj5MuPL2WC1/R6BQ4eD5qIBvFF3/ryADy5kCPw2ZRJNjMWywYt8/KNecNSxrdc53W7jk0RAFCkSiIM2g40N7YqxNVLhPq+Lek= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1670379168366756.9130677920518; Tue, 6 Dec 2022 18:12:48 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.455767.713325 (Exim 4.92) (envelope-from ) id 1p2juw-0004Dy-2J; Wed, 07 Dec 2022 02:12:14 +0000 Received: by outflank-mailman (output) from mailman id 455767.713325; Wed, 07 Dec 2022 02:12:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2juv-0004Dr-W6; Wed, 07 Dec 2022 02:12:13 +0000 Received: by outflank-mailman (input) for mailman id 455767; Wed, 07 Dec 2022 02:12:11 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2jut-0004Dl-TD for xen-devel@lists.xenproject.org; Wed, 07 Dec 2022 02:12:11 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8e5bb331-75d4-11ed-91b6-6bf2151ebd3b; Wed, 07 Dec 2022 03:12:10 +0100 (CET) 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 ams.source.kernel.org (Postfix) with ESMTPS id 28DD1B81BED; Wed, 7 Dec 2022 02:12:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8454C433C1; Wed, 7 Dec 2022 02:12:06 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8e5bb331-75d4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670379127; bh=KaNQjCOoCnKyAJXKABah3u2RfjuN2EZvKuzl4FDxLmA=; h=Date:From:To:cc:Subject:From; b=ogJPSAMWgZNaESRZQ42WPHirTudk3dZdnzreyQ0m5aba3FjZy+Is7ahOljqNx9tYy atAqutulgJ2u40VV4c2iHTUjwcy54+uLGHkXP3GOP6wguf9Fu0WxuSD3cG4TgKXEtO uQIBzVAAwVhMOkulQtxWls4QBmBtLk7JQS5dozx1Ansp0CGGdU34ecEsJZAjXaiOnO u9UR3vLukaGinh5+dNiRoCKAmor98hZR8SVd6PfnEY6veVGxwtKYI9auj0XHG04xJt ASevjSGcBwEEol0KT9F1CIz6hjx5lI6S93ryL2YxbaxjFN9g6s+8P4TToo25SYHcld /HUb0D2d9Xjgw== Date: Tue, 6 Dec 2022 18:12:05 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: sstabellini@kernel.org, dpsmith@apertussolutions.com Subject: [PATCH] xsm: misra rule 8.4 fix Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1670379170203100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fix two MISRA Issues Rule 8.4 ("A compatible declaration shall be visible when an object or function with external linkage is defined") found by cppcheck affecting xen/xsm/flask/ss/services.c. Fix the first issue by making policydb_loaded_version static and the second issue by declaring ss_initialized in a proper header. Signed-off-by: Stefano Stabellini diff --git a/xen/xsm/flask/flask_op.c b/xen/xsm/flask/flask_op.c index d319466c6b..b866e8d05f 100644 --- a/xen/xsm/flask/flask_op.c +++ b/xen/xsm/flask/flask_op.c @@ -56,8 +56,6 @@ static int bool_num =3D 0; static int *bool_pending_values =3D NULL; static int flask_security_make_bools(void); =20 -extern int ss_initialized; - static int __init cf_check parse_flask_param(const char *s) { if ( !strcmp(s, "enforcing") ) diff --git a/xen/xsm/flask/private.h b/xen/xsm/flask/private.h index 429f213cce..2e0e65489c 100644 --- a/xen/xsm/flask/private.h +++ b/xen/xsm/flask/private.h @@ -6,4 +6,6 @@ long cf_check do_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op); int cf_check compat_flask_op(XEN_GUEST_HANDLE_PARAM(void) u_flask_op); =20 +extern int ss_initialized; + #endif /* XSM_FLASK_PRIVATE */ diff --git a/xen/xsm/flask/ss/services.c b/xen/xsm/flask/ss/services.c index dab07b5f60..4665f3b007 100644 --- a/xen/xsm/flask/ss/services.c +++ b/xen/xsm/flask/ss/services.c @@ -53,7 +53,7 @@ #include "conditional.h" #include "mls.h" =20 -unsigned int policydb_loaded_version; +static unsigned int policydb_loaded_version; =20 static DEFINE_RWLOCK(policy_rwlock); #define POLICY_RDLOCK read_lock(&policy_rwlock)