]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ice: Fix a 32bit bug
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 20 Aug 2024 13:43:46 +0000 (16:43 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Aug 2024 00:21:47 +0000 (17:21 -0700)
BIT() is unsigned long but ->pu.flg_msk and ->pu.flg_val are u64 type.
On 32 bit systems, unsigned long is a u32 and the mismatch between u32
and u64 will break things for the high 32 bits.

Fixes: 9a4c07aaa0f5 ("ice: add parser execution main loop")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/ddc231a8-89c1-4ff4-8704-9198bcb41f8d@stanley.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/ice/ice_parser_rt.c

index d5bcc266b01ec6c824a766078ddbdfd804ae107a..dedf5e854e4b76fcfe7477db8c0531b1edf72776 100644 (file)
@@ -377,11 +377,11 @@ static void ice_pg_exe(struct ice_parser_rt *rt)
 
 static void ice_flg_add(struct ice_parser_rt *rt, int idx, bool val)
 {
-       rt->pu.flg_msk |= BIT(idx);
+       rt->pu.flg_msk |= BIT_ULL(idx);
        if (val)
-               rt->pu.flg_val |= BIT(idx);
+               rt->pu.flg_val |= BIT_ULL(idx);
        else
-               rt->pu.flg_val &= ~BIT(idx);
+               rt->pu.flg_val &= ~BIT_ULL(idx);
 
        ice_debug(rt->psr->hw, ICE_DBG_PARSER, "Pending update for flag %d value %d\n",
                  idx, val);