Skip to content

Commit 7b948f1

Browse files
ArvindYadavCsgregkh
authored andcommitted
auxdisplay: constify charlcd_ops.
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. File size before: text data bss dec hex filename 12750 560 362 13672 3568 drivers/auxdisplay/panel.o File size After adding 'const': text data bss dec hex filename 12942 368 362 13672 3568 drivers/auxdisplay/panel.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent caa97be commit 7b948f1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/auxdisplay/panel.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,21 +877,21 @@ static void lcd_clear_fast_tilcd(struct charlcd *charlcd)
877877
spin_unlock_irq(&pprt_lock);
878878
}
879879

880-
static struct charlcd_ops charlcd_serial_ops = {
880+
static const struct charlcd_ops charlcd_serial_ops = {
881881
.write_cmd = lcd_write_cmd_s,
882882
.write_data = lcd_write_data_s,
883883
.clear_fast = lcd_clear_fast_s,
884884
.backlight = lcd_backlight,
885885
};
886886

887-
static struct charlcd_ops charlcd_parallel_ops = {
887+
static const struct charlcd_ops charlcd_parallel_ops = {
888888
.write_cmd = lcd_write_cmd_p8,
889889
.write_data = lcd_write_data_p8,
890890
.clear_fast = lcd_clear_fast_p8,
891891
.backlight = lcd_backlight,
892892
};
893893

894-
static struct charlcd_ops charlcd_tilcd_ops = {
894+
static const struct charlcd_ops charlcd_tilcd_ops = {
895895
.write_cmd = lcd_write_cmd_tilcd,
896896
.write_data = lcd_write_data_tilcd,
897897
.clear_fast = lcd_clear_fast_tilcd,

0 commit comments

Comments
 (0)