diff mbox series

video: fbdev: sis: Remove unnecessary parentheses and commented code

Message ID 20180920202217.27304-1-natechancellor@gmail.com (mailing list archive)
State New, archived
Headers show
Series video: fbdev: sis: Remove unnecessary parentheses and commented code | expand

Commit Message

Nathan Chancellor Sept. 20, 2018, 8:22 p.m. UTC
Clang warns when multiple pairs of parentheses are used for a single
conditional statement.

drivers/video/fbdev/sis/init301.c:851:42: warning: equality comparison
with extraneous parentheses [-Wparentheses-equality]
      } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
                 ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
drivers/video/fbdev/sis/init301.c:851:42: note: remove extraneous
parentheses around the comparison to silence this warning
      } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
                ~                        ^   ~
drivers/video/fbdev/sis/init301.c:851:42: note: use '=' to turn this
equality comparison into an assignment
      } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
                                         ^~
                                         =
1 warning generated.

Remove the parentheses and while we're at it, clean up the commented
code, which has been here since the beginning of git history.

Link: https://github.com/ClangBuiltLinux/linux/issues/118
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/video/fbdev/sis/init301.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Bartlomiej Zolnierkiewicz Oct. 8, 2018, 10:51 a.m. UTC | #1
On 09/20/2018 10:22 PM, Nathan Chancellor wrote:
> Clang warns when multiple pairs of parentheses are used for a single
> conditional statement.
> 
> drivers/video/fbdev/sis/init301.c:851:42: warning: equality comparison
> with extraneous parentheses [-Wparentheses-equality]
>       } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
>                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> drivers/video/fbdev/sis/init301.c:851:42: note: remove extraneous
> parentheses around the comparison to silence this warning
>       } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
>                 ~                        ^   ~
> drivers/video/fbdev/sis/init301.c:851:42: note: use '=' to turn this
> equality comparison into an assignment
>       } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
>                                          ^~
>                                          =
> 1 warning generated.
> 
> Remove the parentheses and while we're at it, clean up the commented
> code, which has been here since the beginning of git history.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/118
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Patch queued for 4.20, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
diff mbox series

Patch

diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
index 27a2b72e50e8..a8fb41f1a258 100644
--- a/drivers/video/fbdev/sis/init301.c
+++ b/drivers/video/fbdev/sis/init301.c
@@ -848,9 +848,7 @@  SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime)
 	    SiS_DDC2Delay(SiS_Pr, 0x4000);
 	 }
 
-      } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
-	 (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-	 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) {			/* 315 series, LVDS; Special */
+      } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) {			/* 315 series, LVDS; Special */
 
 	 if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
 	    PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);