Re: [PATCH 08/11] mt76: Fix undefined behavior due to shift overflowing the constant

From: Kalle Valo
Date: Sun Apr 10 2022 - 08:20:14 EST


Borislav Petkov <bp@xxxxxxxxx> wrote:

> From: Borislav Petkov <bp@xxxxxxx>
>
> Fix:
>
> drivers/net/wireless/mediatek/mt76/mt76x2/pci.c: In function ‘mt76x2e_probe’:
> ././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_946’ \
> declared with attribute error: FIELD_PREP: mask is not constant
> _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
>
> See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@xxxxxxx for the gory
> details as to why it triggers with older gccs only.
>
> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> Cc: Felix Fietkau <nbd@xxxxxxxx>
> Cc: Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx>
> Cc: Ryder Lee <ryder.lee@xxxxxxxxxxxx>
> Cc: Shayne Chen <shayne.chen@xxxxxxxxxxxx>
> Cc: Sean Wang <sean.wang@xxxxxxxxxxxx>
> Cc: Kalle Valo <kvalo@xxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> Cc: linux-wireless@xxxxxxxxxxxxxxx
> Cc: netdev@xxxxxxxxxxxxxxx

Patch applied to wireless.git, thanks.

dbc2b1764734 mt76: Fix undefined behavior due to shift overflowing the constant

--
https://patchwork.kernel.org/project/linux-wireless/patch/20220405151517.29753-9-bp@xxxxxxxxx/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches