All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scot Doyle <lkml14@scotdoyle.com>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Thomas Winischhofer <thomas@winischhofer.net>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] video: fbdev: sis: condition with no effect
Date: Thu, 05 Feb 2015 20:45:59 +0000	[thread overview]
Message-ID: <alpine.LNX.2.11.1502052013430.700@localhost> (raw)
In-Reply-To: <1423049774-16305-1-git-send-email-hofrat@osadl.org>

On Wed, 4 Feb 2015, Nicholas Mc Guire wrote:
> The if and the else branch code are identical - so the condition has no
> effect on the effective code - this patch removes the condition and the
> duplicated code.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> 
> This code has been in here since commit 544393fe584d ("sisfb update") so I guess it is
> safe to simply remove the duplicated code if nobody noticed for 10 years.
> 
> Note that the code is not really CodingStyle compliant - the lines inserted were formatted
> to satisfy the coding style but I'm unsure if it is not better to leave it in the
> old format.
> 
> Patch was only compile tested with x86_64_defconfig +
> CONFIG_FB_SIS=m, CONFIG_FB_SIS_300=y, CONFIG_FB_SIS_315=y
> 
> Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
> 
>  drivers/video/fbdev/sis/init301.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
> index 295e0de..9533a8ab 100644
> --- a/drivers/video/fbdev/sis/init301.c
> +++ b/drivers/video/fbdev/sis/init301.c
> @@ -7971,13 +7971,8 @@ SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
>           }
>        } else {						/* ---- PAL ---- */
>           /* We don't play around with FSCI in PAL mode */
> -         if(resindex = 0x04) {
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF);	/* loop filter off */
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE);	/* ACIV on */
> -         } else {
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF);	/* loop filter off */
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE);	/* ACIV on */
> -         }
> +	  SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF);	/* loop filter off */
> +	  SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE);	/* ACIV on */
>        }
>  
>  #endif  /* 300 */

The code covering the PAL case had this redundancy when it was introduced 
in Linux 2.4.19.

Lines 7934-7981 consider three variables: PAL, overscan, and resindex. 
Given the "#ifdef 0" block, couldn't the current six sections collapse 
into two? One for (!PAL && overscan && resindex=5) and another for the 
rest?

WARNING: multiple messages have this Message-ID (diff)
From: Scot Doyle <lkml14@scotdoyle.com>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Thomas Winischhofer <thomas@winischhofer.net>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] video: fbdev: sis: condition with no effect
Date: Thu, 5 Feb 2015 20:45:59 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LNX.2.11.1502052013430.700@localhost> (raw)
In-Reply-To: <1423049774-16305-1-git-send-email-hofrat@osadl.org>

On Wed, 4 Feb 2015, Nicholas Mc Guire wrote:
> The if and the else branch code are identical - so the condition has no
> effect on the effective code - this patch removes the condition and the
> duplicated code.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> 
> This code has been in here since commit 544393fe584d ("sisfb update") so I guess it is
> safe to simply remove the duplicated code if nobody noticed for 10 years.
> 
> Note that the code is not really CodingStyle compliant - the lines inserted were formatted
> to satisfy the coding style but I'm unsure if it is not better to leave it in the
> old format.
> 
> Patch was only compile tested with x86_64_defconfig +
> CONFIG_FB_SIS=m, CONFIG_FB_SIS_300=y, CONFIG_FB_SIS_315=y
> 
> Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
> 
>  drivers/video/fbdev/sis/init301.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
> index 295e0de..9533a8ab 100644
> --- a/drivers/video/fbdev/sis/init301.c
> +++ b/drivers/video/fbdev/sis/init301.c
> @@ -7971,13 +7971,8 @@ SiS_SetCHTVReg(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned short
>           }
>        } else {						/* ---- PAL ---- */
>           /* We don't play around with FSCI in PAL mode */
> -         if(resindex == 0x04) {
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF);	/* loop filter off */
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE);	/* ACIV on */
> -         } else {
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x20,0x00,0xEF);	/* loop filter off */
> -            SiS_SetCH70xxANDOR(SiS_Pr,0x21,0x01,0xFE);	/* ACIV on */
> -         }
> +	  SiS_SetCH70xxANDOR(SiS_Pr, 0x20, 0x00, 0xEF);	/* loop filter off */
> +	  SiS_SetCH70xxANDOR(SiS_Pr, 0x21, 0x01, 0xFE);	/* ACIV on */
>        }
>  
>  #endif  /* 300 */

The code covering the PAL case had this redundancy when it was introduced 
in Linux 2.4.19.

Lines 7934-7981 consider three variables: PAL, overscan, and resindex. 
Given the "#ifdef 0" block, couldn't the current six sections collapse 
into two? One for (!PAL && overscan && resindex==5) and another for the 
rest?

  reply	other threads:[~2015-02-05 20:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 11:36 [PATCH RFC] video: fbdev: sis: condition with no effect Nicholas Mc Guire
2015-02-04 11:36 ` Nicholas Mc Guire
2015-02-05 20:45 ` Scot Doyle [this message]
2015-02-05 20:45   ` Scot Doyle
2015-02-05 21:27   ` Tormod Volden
2015-02-05 21:27     ` Tormod Volden
2015-02-05 23:37     ` Scot Doyle
2015-02-05 23:37       ` Scot Doyle
2015-02-06  7:00     ` Thomas Winischhofer
2015-02-06  7:00       ` Thomas Winischhofer
2015-02-06 13:47       ` Nicholas Mc Guire
2015-02-06 13:47         ` Nicholas Mc Guire
2015-02-06 14:32         ` Thomas Winischhofer
2015-02-06 14:32           ` Thomas Winischhofer
2015-02-06 13:43     ` Nicholas Mc Guire
2015-02-06 13:43       ` Nicholas Mc Guire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.11.1502052013430.700@localhost \
    --to=lkml14@scotdoyle.com \
    --cc=hofrat@osadl.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=thomas@winischhofer.net \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.