Sparse warns:
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:526:9: warning: dubious: x | !y
Workaround it by using the '?' operator. Compile tested only.
Signed-off-by: Kalle Valo <[email protected]>
---
v2:
* use parenthesis
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
index 450f4d221184..578013884e43 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
@@ -523,7 +523,8 @@ mt7915_fw_debug_wm_set(void *data, u64 val)
/* WM CPU info record control */
mt76_clear(dev, MT_CPU_UTIL_CTRL, BIT(0));
- mt76_wr(dev, MT_DIC_CMD_REG_CMD, BIT(2) | BIT(13) | !dev->fw.debug_wm);
+ mt76_wr(dev, MT_DIC_CMD_REG_CMD, BIT(2) | BIT(13) |
+ (dev->fw.debug_wm ? 0 : BIT(0)));
mt76_wr(dev, MT_MCU_WM_CIRQ_IRQ_MASK_CLR_ADDR, BIT(5));
mt76_wr(dev, MT_MCU_WM_CIRQ_IRQ_SOFT_ADDR, BIT(5));
--
2.39.2
> Sparse warns:
>
> drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:526:9: warning: dubious: x | !y
>
> Workaround it by using the '?' operator. Compile tested only.
Acked-by: Lorenzo Bianconi <[email protected]>
>
> Signed-off-by: Kalle Valo <[email protected]>
> ---
> v2:
>
> * use parenthesis
>
> drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
> index 450f4d221184..578013884e43 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c
> @@ -523,7 +523,8 @@ mt7915_fw_debug_wm_set(void *data, u64 val)
>
> /* WM CPU info record control */
> mt76_clear(dev, MT_CPU_UTIL_CTRL, BIT(0));
> - mt76_wr(dev, MT_DIC_CMD_REG_CMD, BIT(2) | BIT(13) | !dev->fw.debug_wm);
> + mt76_wr(dev, MT_DIC_CMD_REG_CMD, BIT(2) | BIT(13) |
> + (dev->fw.debug_wm ? 0 : BIT(0)));
> mt76_wr(dev, MT_MCU_WM_CIRQ_IRQ_MASK_CLR_ADDR, BIT(5));
> mt76_wr(dev, MT_MCU_WM_CIRQ_IRQ_SOFT_ADDR, BIT(5));
>
> --
> 2.39.2
>
>
Kalle Valo <[email protected]> wrote:
> Sparse warns:
>
> drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c:526:9: warning: dubious: x | !y
>
> Workaround it by using the '?' operator. Compile tested only.
>
> Signed-off-by: Kalle Valo <[email protected]>
> Acked-by: Lorenzo Bianconi <[email protected]>
Patch applied to wireless-next.git, thanks.
b68b2beadfd3 wifi: mt76: mt7915: workaround dubious x | !y warning
--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches