Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1714812 > unrolled thread

[PATCH] auxdisplay: constify charlcd_ops structures

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-18 13:30 +0200
Last post2017-08-18 13:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] auxdisplay: constify charlcd_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-18 13:30 +0200

#1714812 — [PATCH] auxdisplay: constify charlcd_ops structures

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-18 13:30 +0200
Subject[PATCH] auxdisplay: constify charlcd_ops structures
Message-ID<ufNDs-30g-21@gated-at.bofh.it>
charlcd_ops are not supposed to change at runtime. All functions
working with charlcd_ops provided by <misc/charlcd.h> work with
const charlcd_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/auxdisplay/panel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index 7a8b8fb..df126dc 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -877,21 +877,21 @@ static void lcd_clear_fast_tilcd(struct charlcd *charlcd)
 	spin_unlock_irq(&pprt_lock);
 }
 
-static struct charlcd_ops charlcd_serial_ops = {
+static const struct charlcd_ops charlcd_serial_ops = {
 	.write_cmd	= lcd_write_cmd_s,
 	.write_data	= lcd_write_data_s,
 	.clear_fast	= lcd_clear_fast_s,
 	.backlight	= lcd_backlight,
 };
 
-static struct charlcd_ops charlcd_parallel_ops = {
+static const struct charlcd_ops charlcd_parallel_ops = {
 	.write_cmd	= lcd_write_cmd_p8,
 	.write_data	= lcd_write_data_p8,
 	.clear_fast	= lcd_clear_fast_p8,
 	.backlight	= lcd_backlight,
 };
 
-static struct charlcd_ops charlcd_tilcd_ops = {
+static const struct charlcd_ops charlcd_tilcd_ops = {
 	.write_cmd	= lcd_write_cmd_tilcd,
 	.write_data	= lcd_write_data_tilcd,
 	.clear_fast	= lcd_clear_fast_tilcd,
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web