diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2016-09-07 14:13:15 +0200 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-10-21 12:36:21 +0800 |
commit | 5633e3c987c36b803b35c65708b9c83f89006418 (patch) | |
tree | 38603165f5cf93b0be226c279b3ea7158d18dfda | |
parent | 374c4e103670e0563647a418ed0f8c5d24931d20 (diff) | |
download | beignet-5633e3c987c36b803b35c65708b9c83f89006418.tar.gz |
toMB: use standard constant
0x followed by 15 `f` is 2^60-1, which is neither 2^64-1 (the maximum
value for an uint64_t) neither 2^44-1 (the value that would reside in
the upper 44 bits of a 64-bit numbers, which is what we want here).
It still work in the context, because the extra bits are just dropped
by the shift, but it's a rather odd constant _and_ it requires a type
specifier to avoid a warning (see previous commit).
Replace it by UINT64_MAX (2^64-1), which was probably the intended
value in the first place.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | src/cl_device_id.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cl_device_id.c b/src/cl_device_id.c index a4f51329..5dfc2296 100644 --- a/src/cl_device_id.c +++ b/src/cl_device_id.c @@ -757,7 +757,7 @@ kbl_gt4_break: /* Apply any driver-dependent updates to the device info */ cl_driver_update_device_info(ret); - #define toMB(size) (size)&(UINT64_C(0xfffffffffffffff)<<20) + #define toMB(size) (size)&(UINT64_MAX<<20) /* Get the global_mem_size and max_mem_alloc size from * driver, system ram and hardware*/ struct sysinfo info; |