From patchwork Mon Apr 5 15:57:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 12183197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46EA5C43603 for ; Mon, 5 Apr 2021 15:57:37 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 083F061242 for ; Mon, 5 Apr 2021 15:57:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 083F061242 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.105396.201761 (Exim 4.92) (envelope-from ) id 1lTRbR-0002CF-5O; Mon, 05 Apr 2021 15:57:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 105396.201761; Mon, 05 Apr 2021 15:57:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lTRbR-0002C7-1f; Mon, 05 Apr 2021 15:57:25 +0000 Received: by outflank-mailman (input) for mailman id 105396; Mon, 05 Apr 2021 15:57:23 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lTRbP-0002AY-BS for xen-devel@lists.xenproject.org; Mon, 05 Apr 2021 15:57:23 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lTRbO-0002nT-3j; Mon, 05 Apr 2021 15:57:22 +0000 Received: from 54-240-197-235.amazon.com ([54.240.197.235] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTRbN-00053b-Rj; Mon, 05 Apr 2021 15:57:22 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=+qpe2Q4MYVn+N9AOgWxQnBcvE9Q4UEVlLyVO20fEAig=; b=0s6PRARc2L7Ols9se5qmubITO gCphmgCs7lKIQzI5hW9F5lftz96cYZXIWqh44Nvg3k88t04xh2WXceIGv1LD5/oFrnBHoWEiz1uBO WH5HjSuPJUx+pmj180WxZlco8v+Pv8RpV0pKgXiRbET7wZNbUDGLZDTU9xIQ3kSC7NJFE=; From: Julien Grall To: xen-devel@lists.xenproject.org Cc: julien@xen.org, Julien Grall , Tim Deegan , Jan Beulich , Andrew Cooper , George Dunlap , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [PATCH 03/14] xen/x86: shadow: The return type of sh_audit_flags() should be const Date: Mon, 5 Apr 2021 16:57:02 +0100 Message-Id: <20210405155713.29754-4-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210405155713.29754-1-julien@xen.org> References: <20210405155713.29754-1-julien@xen.org> From: Julien Grall The function sh_audit_flags() is returning pointer to literal strings. They should not be modified, so the return is now const and this is propagated to the callers. Take the opportunity to fix the coding style in the declaration of sh_audit_flags. Signed-off-by: Julien Grall Reviewed-by: Roger Pau Monné Acked-by: Tim Deegan --- xen/arch/x86/mm/shadow/multi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index 9b43cb116c47..0342de81d2c1 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -4290,8 +4290,8 @@ static void sh_pagetable_dying(paddr_t gpa) done = 1; \ } while (0) -static char * sh_audit_flags(struct vcpu *v, int level, - int gflags, int sflags) +static const char *sh_audit_flags(struct vcpu *v, int level, + int gflags, int sflags) /* Common code for auditing flag bits */ { if ( (sflags & _PAGE_PRESENT) && !(gflags & _PAGE_PRESENT) ) @@ -4324,7 +4324,7 @@ int sh_audit_l1_table(struct vcpu *v, mfn_t sl1mfn, mfn_t x) mfn_t mfn, gmfn, gl1mfn; gfn_t gfn; p2m_type_t p2mt; - char *s; + const char *s; int done = 0; /* Follow the backpointer */ @@ -4419,7 +4419,7 @@ int sh_audit_l2_table(struct vcpu *v, mfn_t sl2mfn, mfn_t x) mfn_t mfn, gmfn, gl2mfn; gfn_t gfn; p2m_type_t p2mt; - char *s; + const char *s; int done = 0; /* Follow the backpointer */ @@ -4471,7 +4471,7 @@ int sh_audit_l3_table(struct vcpu *v, mfn_t sl3mfn, mfn_t x) mfn_t mfn, gmfn, gl3mfn; gfn_t gfn; p2m_type_t p2mt; - char *s; + const char *s; int done = 0; /* Follow the backpointer */ @@ -4521,7 +4521,7 @@ int sh_audit_l4_table(struct vcpu *v, mfn_t sl4mfn, mfn_t x) mfn_t mfn, gmfn, gl4mfn; gfn_t gfn; p2m_type_t p2mt; - char *s; + const char *s; int done = 0; /* Follow the backpointer */