From nobody Thu May 16 01:05:05 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=1695943215; cv=none; d=zohomail.com; s=zohoarc; b=IwgB0dtqC9a+U52u5M0ZHqcXwcOKsG72xP/hkJXIOOroNssetgqFPjemH+HZpXqeQNuUT7GgGU3FE31TujZbnaJoj0sOtnpidko13tnkki5FLyfuJdcxGGHtjF9TzlO6H3coOoGoAglcpxdC7H1fcau1JRGsxjr4FXnj78jzetU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695943215; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=byO/3etgfsn59OxPnlOlGNGlTHvLTb+qhWnfAtzcdJw=; b=GnUHBso8Xijr9r0374FgKow+z/SChrEgcYwGi9bXvRaMkv5PewwsSqjaPva7WjVV6NQ7KTkWLCmc+YKrNYjsoIZbD2TPmiezoxj+ckl/nxGUdyNqfSKeMgym6zW+JMnjKM0V3rGXJtN8SdITA40cz2FvOs5/AvpLwlMO+fuw/nU= 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 1695943215623466.0366347741067; Thu, 28 Sep 2023 16:20:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.610079.949349 (Exim 4.92) (envelope-from ) id 1qm0IQ-0003hZ-Tk; Thu, 28 Sep 2023 23:19:50 +0000 Received: by outflank-mailman (output) from mailman id 610079.949349; Thu, 28 Sep 2023 23:19:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qm0IQ-0003gp-OK; Thu, 28 Sep 2023 23:19:50 +0000 Received: by outflank-mailman (input) for mailman id 610079; Thu, 28 Sep 2023 23:19:49 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qm0IP-0003MQ-HA for xen-devel@lists.xenproject.org; Thu, 28 Sep 2023 23:19:49 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 83802657-5e55-11ee-9b0d-b553b5be7939; Fri, 29 Sep 2023 01:19:47 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4330A61DA0; Thu, 28 Sep 2023 23:19:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B483FC433C7; Thu, 28 Sep 2023 23:19:44 +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: 83802657-5e55-11ee-9b0d-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695943185; bh=N3bxzgJ1s2K6v+njeepztZaSboFqG44A04jELbAY81w=; h=Date:From:To:cc:Subject:From; b=YfaBnK07AZJvJvc8X0IpNQl1JJqdCsvG0+pLxfxyslw1frmyLEWvd/eV76YRWtrbo eYfhkz2+kwyBeHiRrEe8PWY+qWp8q6NoerFdVmdNUkEYcNPnjo1j56W1y8BslQ+01z aamioCiuavD0b5tni6ba83RV4iexyZAqHkZ7uF/EQVwEufkU4MbXt4Z7AaxFjxfuzu 5P5fAWsq7SwKt7aEIVM9uV7txCkZoX7a0/tr/gWk3OHdc8gtnKYf2gNCkvTMEg9HI0 lVGfO5JTZQvGVLKrh/IgAM7cZ5qLWs+j3SF2FiJUbyM3icRU6epocRXRkxCNsT6fiV b1NbfJk0k+GHg== Date: Thu, 28 Sep 2023 16:19:43 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: sstabellini@kernel.org, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org, bertrand.marquis@arm.com, george.dunlap@citrix.com, wl@xen.org Subject: [PATCH] bitmap: fix n__ signess 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: 1695943216807100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" All callers of the bitmap_switch macro (which are all within bitmap.h) pass an int as first parameter. Do not assign it to an unsigned int potentially introducing errors. Signed-off-by: Stefano Stabellini Acked-by: Jan Beulich --- We could also have gone the other way and change all the callers and the callers' callers to use an unsigned int instead, but I went for the path of least resistance. diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h index 3caf92c76d..7caec098d7 100644 --- a/xen/include/xen/bitmap.h +++ b/xen/include/xen/bitmap.h @@ -101,7 +101,7 @@ extern int bitmap_allocate_region(unsigned long *bitmap= , int pos, int order); #define bitmap_bytes(nbits) (BITS_TO_LONGS(nbits) * sizeof(unsigned long)) =20 #define bitmap_switch(nbits, zero, small, large) \ - unsigned int n__ =3D (nbits); \ + int n__ =3D (nbits); \ if (__builtin_constant_p(nbits) && !n__) { \ zero; \ } else if (__builtin_constant_p(nbits) && n__ <=3D BITS_PER_LONG) { \