linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: deller@gmx.de, daniel@ffwll.ch, javierm@redhat.com,
	sam@ravnborg.org, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 3/7] fbdev/core: Fix style of code for boot-up logo
Date: Tue, 29 Aug 2023 16:15:42 +0200	[thread overview]
Message-ID: <20230829142109.4521-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20230829142109.4521-1-tzimmermann@suse.de>

Fix a number of warnings from checkpatch.pl in this code before
moving it into a separate file. This includes

 * Prefer 'unsigned int' to bare use of 'unsigned'
 * space required after that ',' (ctx:VxV)
 * space prohibited after that open parenthesis '('
 * suspect code indent for conditional statements (16, 32)
 * braces {} are not necessary for single statement blocks

No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/fbdev/core/fbmem.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index ee44a46a66be..98e1847e4287 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -186,7 +186,7 @@ EXPORT_SYMBOL(fb_get_buffer_offset);
 
 #ifdef CONFIG_LOGO
 
-static inline unsigned safe_shift(unsigned d, int n)
+static inline unsigned int safe_shift(unsigned int d, int n)
 {
 	return n < 0 ? d >> -n : d << n;
 }
@@ -229,7 +229,9 @@ static void  fb_set_logo_truepalette(struct fb_info *info,
 					    const struct linux_logo *logo,
 					    u32 *palette)
 {
-	static const unsigned char mask[] = { 0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff };
+	static const unsigned char mask[] = {
+		0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff
+	};
 	unsigned char redmask, greenmask, bluemask;
 	int redshift, greenshift, blueshift;
 	int i;
@@ -247,7 +249,7 @@ static void  fb_set_logo_truepalette(struct fb_info *info,
 	greenshift = info->var.green.offset - (8 - info->var.green.length);
 	blueshift  = info->var.blue.offset  - (8 - info->var.blue.length);
 
-	for ( i = 0; i < logo->clutsize; i++) {
+	for (i = 0; i < logo->clutsize; i++) {
 		palette[i+32] = (safe_shift((clut[0] & redmask), redshift) |
 				 safe_shift((clut[1] & greenmask), greenshift) |
 				 safe_shift((clut[2] & bluemask), blueshift));
@@ -371,7 +373,7 @@ static void fb_rotate_logo_cw(const u8 *in, u8 *out, u32 width, u32 height)
 
 	for (i = 0; i < height; i++)
 		for (j = 0; j < width; j++)
-				out[height * j + h - i] = *in++;
+			out[height * j + h - i] = *in++;
 }
 
 static void fb_rotate_logo_ccw(const u8 *in, u8 *out, u32 width, u32 height)
@@ -636,9 +638,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate)
 	/* Return if no suitable logo was found */
 	fb_logo.logo = fb_find_logo(depth);
 
-	if (!fb_logo.logo) {
+	if (!fb_logo.logo)
 		return 0;
-	}
 
 	if (rotate == FB_ROTATE_UR || rotate == FB_ROTATE_UD)
 		yres = info->var.yres;
-- 
2.41.0


  parent reply	other threads:[~2023-08-29 14:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 14:15 [PATCH 0/7] fbdev: Split off code for boot-up logo Thomas Zimmermann
2023-08-29 14:15 ` [PATCH 1/7] fbdev/au1200fb: Do not display " Thomas Zimmermann
2023-09-06  9:45   ` Javier Martinez Canillas
2023-08-29 14:15 ` [PATCH 2/7] fbdev/mmp/mmpfb: " Thomas Zimmermann
2023-09-06  9:54   ` Javier Martinez Canillas
2023-09-07  6:56     ` Thomas Zimmermann
2023-08-29 14:15 ` Thomas Zimmermann [this message]
2023-09-06  9:59   ` [PATCH 3/7] fbdev/core: Fix style of code for " Javier Martinez Canillas
2023-08-29 14:15 ` [PATCH 4/7] fbdev/core: Move logo functions into separate source file Thomas Zimmermann
2023-08-29 15:55   ` kernel test robot
2023-09-01 20:09   ` kernel test robot
2023-09-01 20:20   ` kernel test robot
2023-09-06 10:10   ` Javier Martinez Canillas
2023-08-29 14:15 ` [PATCH 5/7] fbdev/core: Build fb_logo iff CONFIG_LOGO has been selected Thomas Zimmermann
2023-09-01  8:22   ` Helge Deller
2023-09-04  7:08     ` Thomas Zimmermann
2023-09-07  8:06       ` Thomas Zimmermann
2023-09-06 10:12   ` Javier Martinez Canillas
2023-09-07  8:07     ` Thomas Zimmermann
2023-08-29 14:15 ` [PATCH 6/7] fbdev/core: Remove empty internal helpers from fb_logo.c Thomas Zimmermann
2023-09-06 10:13   ` Javier Martinez Canillas
2023-08-29 14:15 ` [PATCH 7/7] fbdev/core: Clean up include statements in fbmem.c Thomas Zimmermann
2023-09-06 10:13   ` Javier Martinez Canillas

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=20230829142109.4521-4-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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 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).