Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751017AbdHRLXA (ORCPT ); Fri, 18 Aug 2017 07:23:00 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:37424 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbdHRLW7 (ORCPT ); Fri, 18 Aug 2017 07:22:59 -0400 From: Arvind Yadav To: miguel.ojeda.sandonis@gmail.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] auxdisplay: constify charlcd_ops structures Date: Fri, 18 Aug 2017 16:52:46 +0530 Message-Id: <0e4b095147fb3b8eb4692c1b7b77375f8a58e1e4.1503055247.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1336 Lines: 40 charlcd_ops are not supposed to change at runtime. All functions working with charlcd_ops provided by work with const charlcd_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav --- 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