Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbdGNQmf (ORCPT ); Fri, 14 Jul 2017 12:42:35 -0400 Received: from mga07.intel.com ([134.134.136.100]:38812 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753842AbdGNQmd (ORCPT ); Fri, 14 Jul 2017 12:42:33 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,359,1496127600"; d="scan'208";a="993053831" Message-ID: <1500050355.29303.10.camel@linux.intel.com> Subject: Re: [PATCH] auxdisplay: constify charlcd_ops. From: Andy Shevchenko To: Arvind Yadav , gregkh@linuxfoundation.org, miguel.ojeda.sandonis@gmail.com Cc: linux-kernel@vger.kernel.org Date: Fri, 14 Jul 2017 19:39:15 +0300 In-Reply-To: References: Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2037 Lines: 61 On Fri, 2017-07-14 at 22:04 +0530, Arvind Yadav wrote: > 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. > > 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 > Reviewed-by: Andy Shevchenko (As long as it has been compile tested) > 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, -- Andy Shevchenko Intel Finland Oy