Skip to content

Commit

Permalink
hw/cxl: Fix size of constant in interleave granularity function.
Browse files Browse the repository at this point in the history
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 <peter.maydell@linaro.org>
Fixes: 829de29 ("hw/cxl/component: Add utils for interleave parameter encoding/decoding")
Fixes: Coverity CID 1488868
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Message-Id: <20220701132300.2264-4-Jonathan.Cameron@huawei.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
jic23 authored and mstsirkin committed Jul 26, 2022
1 parent 4a447a7 commit cb70b7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/hw/cxl/cxl_component.h
Expand Up @@ -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);
Expand Down

0 comments on commit cb70b7e

Please sign in to comment.