On 11/12/2024 9:57 AM, Howard Wang wrote:
> +
> +#define TRUE  1
> +#define FALSE 0
>

Also checkpatch has BOOL_COMPARISON warnings [1], technically
"(hw->NotWrMcuPatchCode == TRUE)" can be "(hw->NotWrMcuPatchCode)"
they are same.

As you are defining TRUE & FALSE as above (since this is compatibility
header, I understand the reason of defining them), check can be
misleading, consider following case:
hw->NotWrMcuPatchCode = FALSE;
hw->NotWrMcuPatchCode += 3;
if (hw->NotWrMcuPatchCode == TRUE) // The result is unexpected

This is not hard requirement, except from checkpatch warning, but can
you please double check?



[1]
CHECK:BOOL_COMPARISON: Using comparison to TRUE is error prone
#396: FILE: drivers/net/r8169/base/rtl8125a.c:380:
+       if (hw->NotWrMcuPatchCode == TRUE)

CHECK:BOOL_COMPARISON: Using comparison to TRUE is error prone
#2403: FILE: drivers/net/r8169/base/rtl8125b.c:358:
+       if (hw->NotWrMcuPatchCode == TRUE)

CHECK:BOOL_COMPARISON: Using comparison to TRUE is error prone
#3617: FILE: drivers/net/r8169/base/rtl8125bp.c:83:
+       if (hw->NotWrMcuPatchCode == TRUE)

CHECK:BOOL_COMPARISON: Using comparison to TRUE is error prone
#4180: FILE: drivers/net/r8169/base/rtl8125d.c:212:
+       if (hw->NotWrMcuPatchCode == TRUE)

CHECK:BOOL_COMPARISON: Using comparison to TRUE is error prone
#5355: FILE: drivers/net/r8169/base/rtl8126a.c:495:
+       if (hw->NotWrMcuPatchCode == TRUE)

Reply via email to