All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fbdev: fbmem: Fix logo center image dx issue
@ 2022-06-28 16:36 ` Guiling Deng
  0 siblings, 0 replies; 4+ messages in thread
From: Guiling Deng @ 2022-06-28 16:36 UTC (permalink / raw)
  To: daniel, deller; +Cc: linux-fbdev, dri-devel, linux-kernel, Guiling Deng

Image.dx gets wrong value because of missing '()'.

If xres == logo->width and n == 1, image.dx = -16.

Signed-off-by: Guiling Deng <greens9@163.com>
---
 drivers/video/fbdev/core/fbmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index c4a18322dee9..1fd2bdb11266 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -511,7 +511,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 
 		while (n && (n * (logo->width + 8) - 8 > xres))
 			--n;
-		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
+		image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
 		image.dy = y ?: (yres - logo->height) / 2;
 	} else {
 		image.dx = 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] fbdev: fbmem: Fix logo center image dx issue
@ 2022-06-28 16:36 ` Guiling Deng
  0 siblings, 0 replies; 4+ messages in thread
From: Guiling Deng @ 2022-06-28 16:36 UTC (permalink / raw)
  To: daniel, deller; +Cc: linux-fbdev, Guiling Deng, linux-kernel, dri-devel

Image.dx gets wrong value because of missing '()'.

If xres == logo->width and n == 1, image.dx = -16.

Signed-off-by: Guiling Deng <greens9@163.com>
---
 drivers/video/fbdev/core/fbmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index c4a18322dee9..1fd2bdb11266 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -511,7 +511,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 
 		while (n && (n * (logo->width + 8) - 8 > xres))
 			--n;
-		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
+		image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
 		image.dy = y ?: (yres - logo->height) / 2;
 	} else {
 		image.dx = 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fbdev: fbmem: Fix logo center image dx issue
  2022-06-28 16:36 ` Guiling Deng
@ 2022-06-30  6:51   ` Helge Deller
  -1 siblings, 0 replies; 4+ messages in thread
From: Helge Deller @ 2022-06-30  6:51 UTC (permalink / raw)
  To: Guiling Deng, daniel; +Cc: linux-fbdev, dri-devel, linux-kernel

On 6/28/22 18:36, Guiling Deng wrote:
> Image.dx gets wrong value because of missing '()'.
>
> If xres == logo->width and n == 1, image.dx = -16.
>
> Signed-off-by: Guiling Deng <greens9@163.com>

Nice catch!

applied to the fbdev tree.

Thanks,
Helge

> ---
>  drivers/video/fbdev/core/fbmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index c4a18322dee9..1fd2bdb11266 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -511,7 +511,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
>
>  		while (n && (n * (logo->width + 8) - 8 > xres))
>  			--n;
> -		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
> +		image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
>  		image.dy = y ?: (yres - logo->height) / 2;
>  	} else {
>  		image.dx = 0;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fbdev: fbmem: Fix logo center image dx issue
@ 2022-06-30  6:51   ` Helge Deller
  0 siblings, 0 replies; 4+ messages in thread
From: Helge Deller @ 2022-06-30  6:51 UTC (permalink / raw)
  To: Guiling Deng, daniel; +Cc: linux-fbdev, linux-kernel, dri-devel

On 6/28/22 18:36, Guiling Deng wrote:
> Image.dx gets wrong value because of missing '()'.
>
> If xres == logo->width and n == 1, image.dx = -16.
>
> Signed-off-by: Guiling Deng <greens9@163.com>

Nice catch!

applied to the fbdev tree.

Thanks,
Helge

> ---
>  drivers/video/fbdev/core/fbmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
> index c4a18322dee9..1fd2bdb11266 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -511,7 +511,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
>
>  		while (n && (n * (logo->width + 8) - 8 > xres))
>  			--n;
> -		image.dx = (xres - n * (logo->width + 8) - 8) / 2;
> +		image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
>  		image.dy = y ?: (yres - logo->height) / 2;
>  	} else {
>  		image.dx = 0;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-30  6:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 16:36 [PATCH] fbdev: fbmem: Fix logo center image dx issue Guiling Deng
2022-06-28 16:36 ` Guiling Deng
2022-06-30  6:51 ` Helge Deller
2022-06-30  6:51   ` Helge Deller

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.