public inbox for linux-fbdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: gregkh@linuxfoundation.org, deller@gmx.de, sam@ravnborg.org
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 01/13] fbdev: Declare src parameter of fb_pad_ helpers as constant
Date: Wed, 18 Feb 2026 09:15:52 +0100	[thread overview]
Message-ID: <20260218083855.10743-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20260218083855.10743-1-tzimmermann@suse.de>

Fbdev's padding helpers do not modify the source buffer. Declare the
parameter as 'const'.

Fbcon's font-rendering code calls these helpers with the font data.
Declaring src as const will allow for making the font data constant
as well.

While at it, also remove the extern qualifier from the function
declarations in the header file.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/video/fbdev/core/fbmem.c |  6 +++---
 include/linux/fb.h               | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index eff757ebbed1..9c78fd32e7b3 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -91,14 +91,14 @@ EXPORT_SYMBOL(fb_get_color_depth);
 /*
  * Data padding functions.
  */
-void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height)
+void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 s_pitch, u32 height)
 {
 	__fb_pad_aligned_buffer(dst, d_pitch, src, s_pitch, height);
 }
 EXPORT_SYMBOL(fb_pad_aligned_buffer);
 
-void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height,
-				u32 shift_high, u32 shift_low, u32 mod)
+void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 idx, u32 height,
+			     u32 shift_high, u32 shift_low, u32 mod)
 {
 	u8 mask = (u8) (0xfff << shift_high), tmp;
 	int i, j;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index b8b6f54f3312..9a8051f258ac 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -606,9 +606,9 @@ extern int register_framebuffer(struct fb_info *fb_info);
 extern void unregister_framebuffer(struct fb_info *fb_info);
 extern int devm_register_framebuffer(struct device *dev, struct fb_info *fb_info);
 extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
-extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
-				u32 height, u32 shift_high, u32 shift_low, u32 mod);
-extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height);
+void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 idx, u32 height,
+			     u32 shift_high, u32 shift_low, u32 mod);
+void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 s_pitch, u32 height);
 extern void fb_set_suspend(struct fb_info *info, int state);
 extern int fb_get_color_depth(struct fb_var_screeninfo *var,
 			      struct fb_fix_screeninfo *fix);
@@ -625,8 +625,8 @@ static inline void unlock_fb_info(struct fb_info *info)
 	mutex_unlock(&info->lock);
 }
 
-static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
-					   u8 *src, u32 s_pitch, u32 height)
+static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, const u8 *src, u32 s_pitch,
+					   u32 height)
 {
 	u32 i, j;
 
-- 
2.52.0


  reply	other threads:[~2026-02-18  8:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18  8:15 [PATCH 00/13] vc,fbcon,fonts: Proper handling of font data Thomas Zimmermann
2026-02-18  8:15 ` Thomas Zimmermann [this message]
2026-02-18  8:15 ` [PATCH 02/13] vt: Remove trailing whitespaces Thomas Zimmermann
2026-02-18  8:15 ` [PATCH 03/13] vt: Store font in struct vc_font Thomas Zimmermann
2026-02-18  8:15 ` [PATCH 04/13] vt: Calculate font-buffer size with vc_font_size() Thomas Zimmermann
2026-02-18  8:15 ` [PATCH 05/13] lib/fonts: Remove trailing whitespaces Thomas Zimmermann
2026-02-18  8:15 ` [PATCH 06/13] lib/fonts: Remove FNTCHARCNT() Thomas Zimmermann
2026-02-18  8:15 ` [PATCH 07/13] lib/fonts: Store font data as font_data_t; update consoles Thomas Zimmermann
2026-02-18  8:15 ` [PATCH 08/13] lib/fonts: Read font size with font_data_size() Thomas Zimmermann
2026-02-18  8:16 ` [PATCH 09/13] lib/fonts: Compare font data for equality with font_data_is_equal() Thomas Zimmermann
2026-02-18  8:16 ` [PATCH 10/13] lib/fonts: Manage font-data lifetime with font_data_get/_put() Thomas Zimmermann
2026-02-18  8:16 ` [PATCH 11/13] lib/fonts: Create font_data_t from struct console_font with font_data_import() Thomas Zimmermann
2026-02-18  8:16 ` [PATCH 12/13] lib/fonts: Store font data for user space with font_data_export() Thomas Zimmermann
2026-02-18  8:16 ` [PATCH 13/13] lib/fonts: Remove internal symbols and macros from public header file Thomas Zimmermann
2026-02-18 21:47   ` kernel test robot
2026-02-19  2:08   ` kernel test robot
2026-02-23 15:05   ` Helge Deller
2026-03-02 13:45     ` Thomas Zimmermann

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=20260218083855.10743-2-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --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