* [bug report] staging: sm750fb: Fix polarity assignment for vertical and horizontal mode
@ 2025-07-23 19:24 Alok Tiwari
2025-07-31 16:11 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Alok Tiwari @ 2025-07-23 19:24 UTC (permalink / raw)
To: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging
Cc: alok.a.tiwari, linux-kernel
In drivers/staging/sm750fb/sm750_hw.c,
the vertical and horizontal sync polarity assignments were incorrectly
ordered.
The assignment for modparm.vertical_sync_polarity was mistakenly using
the FB_SYNC_HOR_HIGH_ACT bit instead of FB_SYNC_VERT_HIGH_ACT,
and the horizontal polarity line was commented out or missing.
This patch corrects the logic by properly assigning:
vertical_sync_polarity -> from FB_SYNC_VERT_HIGH_ACT
horizontal_sync_polarity -> from FB_SYNC_HOR_HIGH_ACT
Please let me know your feedback.
Thanks,
Alok
---
Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
drivers/staging/sm750fb/sm750_hw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index 7119b67efe11b..5a32756f98c31 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -280,9 +280,9 @@ int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc,
/* set timing */
modparm.pixel_clock = ps_to_hz(var->pixclock);
modparm.vertical_sync_polarity =
- (var->sync & FB_SYNC_HOR_HIGH_ACT) ? POS : NEG;
- modparm.horizontal_sync_polarity =
(var->sync & FB_SYNC_VERT_HIGH_ACT) ? POS : NEG;
+ modparm.horizontal_sync_polarity =
+ (var->sync & FB_SYNC_HOR_HIGH_ACT) ? POS : NEG;
modparm.clock_phase_polarity =
(var->sync & FB_SYNC_COMP_HIGH_ACT) ? POS : NEG;
modparm.horizontal_display_end = var->xres;
--
2.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [bug report] staging: sm750fb: Fix polarity assignment for vertical and horizontal mode
2025-07-23 19:24 [bug report] staging: sm750fb: Fix polarity assignment for vertical and horizontal mode Alok Tiwari
@ 2025-07-31 16:11 ` Dan Carpenter
2025-07-31 16:33 ` [External] : " ALOK TIWARI
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2025-07-31 16:11 UTC (permalink / raw)
To: Alok Tiwari
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
On Wed, Jul 23, 2025 at 12:24:31PM -0700, Alok Tiwari wrote:
> In drivers/staging/sm750fb/sm750_hw.c,
> the vertical and horizontal sync polarity assignments were incorrectly
> ordered.
> The assignment for modparm.vertical_sync_polarity was mistakenly using
> the FB_SYNC_HOR_HIGH_ACT bit instead of FB_SYNC_VERT_HIGH_ACT,
> and the horizontal polarity line was commented out or missing.
>
> This patch corrects the logic by properly assigning:
>
> vertical_sync_polarity -> from FB_SYNC_VERT_HIGH_ACT
> horizontal_sync_polarity -> from FB_SYNC_HOR_HIGH_ACT
>
> Please let me know your feedback.
> Thanks,
> Alok
> ---
> Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
Did you find this copy and paste bug by testing or reviewing the code?
How does this bug look like to a user? Please put that in your commit
message.
This looks reasonable to me, but the patch is badly formatted.
1) It should say [PATCH] in the subject.
2) The body of the email should be the commit message.
3) the --- should only come after the Signed-off-by line.
Try applying your patch with `git am` and review the log to see what I
mean.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [External] : Re: [bug report] staging: sm750fb: Fix polarity assignment for vertical and horizontal mode
2025-07-31 16:11 ` Dan Carpenter
@ 2025-07-31 16:33 ` ALOK TIWARI
2025-07-31 18:13 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: ALOK TIWARI @ 2025-07-31 16:33 UTC (permalink / raw)
To: Dan Carpenter
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
On 7/31/2025 9:41 PM, Dan Carpenter wrote:
> On Wed, Jul 23, 2025 at 12:24:31PM -0700, Alok Tiwari wrote:
>> In drivers/staging/sm750fb/sm750_hw.c,
>> the vertical and horizontal sync polarity assignments were incorrectly
>> ordered.
>> The assignment for modparm.vertical_sync_polarity was mistakenly using
>> the FB_SYNC_HOR_HIGH_ACT bit instead of FB_SYNC_VERT_HIGH_ACT,
>> and the horizontal polarity line was commented out or missing.
>>
>> This patch corrects the logic by properly assigning:
>>
>> vertical_sync_polarity -> from FB_SYNC_VERT_HIGH_ACT
>> horizontal_sync_polarity -> from FB_SYNC_HOR_HIGH_ACT
>>
>> Please let me know your feedback.
>> Thanks,
>> Alok
>> ---
>> Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
>> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
>> ---
>
> Did you find this copy and paste bug by testing or reviewing the code?
> How does this bug look like to a user? Please put that in your commit
> message.
>
> This looks reasonable to me, but the patch is badly formatted.
>
> 1) It should say [PATCH] in the subject.
> 2) The body of the email should be the commit message.
> 3) the --- should only come after the Signed-off-by line.
>
> Try applying your patch with `git am` and review the log to see what I
> mean.
>
> regards,
> dan carpenter
>
Thanks Dan. By reviewing the code, I noticed some awkward assignment.
However, I was not sure about this code, so instead of sending a formal
patch, I just removed my SB and marked it as a [bug report].
I will send formal patch with proper SB.
Thanks,
Alok
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [External] : Re: [bug report] staging: sm750fb: Fix polarity assignment for vertical and horizontal mode
2025-07-31 16:33 ` [External] : " ALOK TIWARI
@ 2025-07-31 18:13 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2025-07-31 18:13 UTC (permalink / raw)
To: ALOK TIWARI
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
On Thu, Jul 31, 2025 at 10:03:46PM +0530, ALOK TIWARI wrote:
>
>
> On 7/31/2025 9:41 PM, Dan Carpenter wrote:
> > On Wed, Jul 23, 2025 at 12:24:31PM -0700, Alok Tiwari wrote:
> > > In drivers/staging/sm750fb/sm750_hw.c,
> > > the vertical and horizontal sync polarity assignments were incorrectly
> > > ordered.
> > > The assignment for modparm.vertical_sync_polarity was mistakenly using
> > > the FB_SYNC_HOR_HIGH_ACT bit instead of FB_SYNC_VERT_HIGH_ACT,
> > > and the horizontal polarity line was commented out or missing.
> > >
> > > This patch corrects the logic by properly assigning:
> > >
> > > vertical_sync_polarity -> from FB_SYNC_VERT_HIGH_ACT
> > > horizontal_sync_polarity -> from FB_SYNC_HOR_HIGH_ACT
> > >
> > > Please let me know your feedback.
> > > Thanks,
> > > Alok
> > > ---
> > > Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
> > > Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> > > ---
> >
> > Did you find this copy and paste bug by testing or reviewing the code?
> > How does this bug look like to a user? Please put that in your commit
> > message.
> >
> > This looks reasonable to me, but the patch is badly formatted.
> >
> > 1) It should say [PATCH] in the subject.
> > 2) The body of the email should be the commit message.
> > 3) the --- should only come after the Signed-off-by line.
> >
> > Try applying your patch with `git am` and review the log to see what I
> > mean.
> >
> > regards,
> > dan carpenter
> >
>
>
> Thanks Dan. By reviewing the code, I noticed some awkward assignment.
> However, I was not sure about this code, so instead of sending a formal
> patch, I just removed my SB and marked it as a [bug report].
> I will send formal patch with proper SB.
>
Good eye. Put "I noticed this in review and haven't tested under the
--- cut off line". If we apply it and it breaks then we've been
properly warned. Something needs to be changed, if it's only to rename
the variables or add a comment. But I think your patch is correct.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-31 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 19:24 [bug report] staging: sm750fb: Fix polarity assignment for vertical and horizontal mode Alok Tiwari
2025-07-31 16:11 ` Dan Carpenter
2025-07-31 16:33 ` [External] : " ALOK TIWARI
2025-07-31 18:13 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).