From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com,
gregkh@linuxfoundation.org, outreachy-kernel@googlegroups.com,
mike.rapoport@gmail.com, kushalkothari2850@gmail.com
Cc: Kushal Kothari <kushalkothari285@gmail.com>,
Kushal Kothari <kushalkothari285@gmail.com>
Subject: Re: [Outreachy kernel] [PATCH] staging: sm750fb: make pointers in array const
Date: Mon, 18 Oct 2021 18:54:34 +0200 [thread overview]
Message-ID: <163460335.XzdQGyDEVH@localhost.localdomain> (raw)
In-Reply-To: <20211018164431.26462-1-kushalkothari285@gmail.com>
On Monday, October 18, 2021 6:44:31 PM CEST Kushal Kothari wrote:
> Change the parameters of functions from const char *g_fbmode[] to
> const char * const g_fbmode[]. This additional const is needed to
> allow us to fix checkpatch warning, as well as being good
> programming practice.
>
> For the checkpatch warnings, if we have a set of command line
> args that we want to check defined as:
> static const char * g_fbmode[] = {NULL, NULL};
>
> checkpatch will complain:
> WARNING: static const char * array should probably be static const
char * const
>
> Signed-off-by: Kushal Kothari <kushalkothari285@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/
sm750.c
> index dbd1159a2ef0..3d9b4b0efcb1 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -33,7 +33,7 @@
> static int g_hwcursor = 1;
> static int g_noaccel;
> static int g_nomtrr;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
You have introduced a logical change (g_fbmode[] entries cannot be assigned
any more) and a build error (because there is code somewhere that assigns
values to those slots).
Please, build the code after you've changed it.
Thanks,
Fabio
> static const char *g_def_fbmode = "1024x768-32@60";
> static char *g_settings;
> static int g_dualview;
> --
> 2.25.1
>
> --
> You received this message because you are subscribed to the Google Groups
"outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/
outreachy-kernel/20211018164431.26462-1-kushalkothari285%40gmail.com.
>
next prev parent reply other threads:[~2021-10-18 16:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 16:44 [PATCH] staging: sm750fb: make pointers in array const Kushal Kothari
2021-10-18 16:54 ` Fabio M. De Francesco [this message]
2021-10-18 17:01 ` [Outreachy kernel] " Julia Lawall
2021-10-18 17:18 ` Fabio M. De Francesco
2021-10-18 18:22 ` Joe Perches
2021-10-18 18:34 ` Fabio M. De Francesco
2021-10-18 18:43 ` Julia Lawall
2021-10-18 18:56 ` kushal kothari
2021-10-18 19:53 ` Alison Schofield
2021-10-18 18:56 ` Fabio M. De Francesco
2021-10-18 18:52 ` Joe Perches
2021-10-18 19:01 ` Fabio M. De Francesco
2021-10-18 18:18 ` Fabio M. De Francesco
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=163460335.XzdQGyDEVH@localhost.localdomain \
--to=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kushalkothari2850@gmail.com \
--cc=kushalkothari285@gmail.com \
--cc=mike.rapoport@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.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.