From nobody Mon Nov 25 05:26:18 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=1715813556; cv=none; d=zohomail.com; s=zohoarc; b=WcolNygGX1bAtXtQZnXWIO/wtA8coTNFv7FIHU1Ix4APBm0LZRELw+A903Zzj+je+OnwbzDufBsLxAtnscK7cQBc/B/iG0Ab7GA3qVjSGSgnE4gQqRv8DbINmslhXiI75BR68bDDamaPIQhgfj5eA7l57B619vG3PWejBOSJ6rk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715813556; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=noiG0qXPzWcFCWyF2kAc8GTSgIxWph1JvHx5DjdM3NM=; b=oLmQjrMLz8xipnvqISUMtGTN0zSyLnX2ZYEuvYAPUdNCC1ZWEl06laTkGTjUncPLONbCGdpZxz5lBHrOoLrVQyWdiY0JQDEBZ6TUWBSunD2z6r4FUzZb2iKYrVgol3YQW/2abjK+m0IAdsYXOtzu67xq7QLyOxZjqFaF02Yr8yI= 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 1715813556362662.0279948866115; Wed, 15 May 2024 15:52:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.722645.1126793 (Exim 4.92) (envelope-from ) id 1s7NTo-0002bs-JL; Wed, 15 May 2024 22:52:12 +0000 Received: by outflank-mailman (output) from mailman id 722645.1126793; Wed, 15 May 2024 22:52:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s7NTo-0002bl-GN; Wed, 15 May 2024 22:52:12 +0000 Received: by outflank-mailman (input) for mailman id 722645; Wed, 15 May 2024 22:52:10 +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 1s7NTm-0002bf-J6 for xen-devel@lists.xenproject.org; Wed, 15 May 2024 22:52:10 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [2604:1380:4641:c500::1]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c23560c1-130d-11ef-909d-e314d9c70b13; Thu, 16 May 2024 00:52:09 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 48DF1614C5; Wed, 15 May 2024 22:52:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FAACC116B1; Wed, 15 May 2024 22:52: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: c23560c1-130d-11ef-909d-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715813528; bh=yq9aJoe7mPRaP2y/18GJw006zYIktPsyCWvFrHtNf4A=; h=Date:From:To:cc:Subject:From; b=R9VgG3rV/tBB+KTwEnCAO5FBDL+EkermOybBCbWvtQf5M488en5V+KzpmwGX+TmJA xC02yINB2owbuDPAPY/M+i2flFh/PALWXQuVfG3O92BYNprK6qhEYRANSwmL4xL85A MdG//8imY7VVhhGMsnVoYyzAj5e9OJDgzgRDjS5kqhih9owTmMWBxeC79M++BtScdy f5ZJJ74ZAaWlJT2QrSEiRGDg9oHmkLlkgJ4BOi18dJC6dV7ev1h1tiHCdMao8cLyeu SxVHNaZdJyzoK8GKZH9DtcUUatfpzlSbAJ08fR9GESxfL7BjiW71Wfnwjg/dP1Z79w cLihdRBv9wjUw== Date: Wed, 15 May 2024 15:52:04 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: Stefano Stabellini , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Andrew Cooper , Bertrand Marquis , Michal Orzel , Julien Grall , nicola.vetrini@bugseng.com, consulting@bugseng.com, jbeulich@suse.com Subject: [PATCH v2] include/ctype.h: fix MISRA R10.2 violation 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: 1715813558465100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The value returned by __toupper is used in arithmetic operations causing MISRA C 10.2 violations. Cast to plain char in the toupper macro. Also do the same in tolower for consistency. Signed-off-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v2: - fix the toupper macro instead diff --git a/xen/include/xen/ctype.h b/xen/include/xen/ctype.h index 6dec944a37..773ac27aa4 100644 --- a/xen/include/xen/ctype.h +++ b/xen/include/xen/ctype.h @@ -48,7 +48,7 @@ static inline unsigned char __toupper(unsigned char c) return c; } =20 -#define tolower(c) __tolower(c) -#define toupper(c) __toupper(c) +#define tolower(c) ((char)__tolower(c)) +#define toupper(c) ((char)__toupper(c)) =20 #endif