From: Jonathan Cameron Date: Fri, 1 Jul 2022 13:23:00 +0000 (+0100) Subject: hw/cxl: Fix size of constant in interleave granularity function. X-Git-Tag: v7.1.0-rc0~1^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb70b7e8712e17e5761a7447defdce5572cd4b80;p=thirdparty%2Fqemu.git hw/cxl: Fix size of constant in interleave granularity function. Whilst the interleave granularity is always small enough that this isn't a real problem (much less than 4GiB) let's change the constant to ULL to fix the coverity warning. Reported-by: Peter Maydell Fixes: 829de299d1 ("hw/cxl/component: Add utils for interleave parameter encoding/decoding") Fixes: Coverity CID 1488868 Signed-off-by: Jonathan Cameron Message-Id: <20220701132300.2264-4-Jonathan.Cameron@huawei.com> Acked-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/include/hw/cxl/cxl_component.h b/include/hw/cxl/cxl_component.h index 70b50181569..94ec2f07d79 100644 --- a/include/hw/cxl/cxl_component.h +++ b/include/hw/cxl/cxl_component.h @@ -215,7 +215,7 @@ uint8_t cxl_interleave_granularity_enc(uint64_t gran, Error **errp); static inline hwaddr cxl_decode_ig(int ig) { - return 1 << (ig + 8); + return 1ULL << (ig + 8); } CXLComponentState *cxl_get_hb_cstate(PCIHostState *hb);