From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>,
gregkh@linuxfoundation.org, miguel.ojeda.sandonis@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] auxdisplay: constify charlcd_ops.
Date: Fri, 14 Jul 2017 19:39:15 +0300 [thread overview]
Message-ID: <1500050355.29303.10.camel@linux.intel.com> (raw)
In-Reply-To: <d7155882d7cdac9e95d40dafd2601ce5968b5458.1500049165.git.arvind.yadav.cs@gmail.com>
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 <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
>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
(As long as it has been compile tested)
> 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,
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
prev parent reply other threads:[~2017-07-14 16:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 16:34 [PATCH] auxdisplay: constify charlcd_ops Arvind Yadav
2017-07-14 16:39 ` Andy Shevchenko [this message]
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=1500050355.29303.10.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arvind.yadav.cs@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.