* [PATCH v2] Staging: unisys: Change char * array type as static const
@ 2015-02-24 22:39 aybuke ozdemir
2015-02-26 23:18 ` [Outreachy kernel] " Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: aybuke ozdemir @ 2015-02-24 22:39 UTC (permalink / raw)
To: outreachy-kernel; +Cc: aybuke ozdemir
This patch fixes "char * array declaration might be better as static
const" checkpatch.pl warning in visorchipset_main.c
After this exchange that can be accessed pointer, without object
derived from the instance but just just read operation can be done in
pointer.
Signed-off-by: aybuke ozdemir <aybuke.147@gmail.com>
---
Changes since v1:
* Used "static const char *const" instead of "static char const"
---
drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index f606ee9..7e97b8e 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -1009,7 +1009,7 @@ device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd,
struct visorchipset_device_info *pDevInfo =
finddevice(&DevInfoList, busNo, devNo);
- char *envp[] = {
+ static const char *const envp[] = {
"SPARSP_DIAGPOOL_PAUSED_STATE = 1",
NULL
};
@@ -1481,7 +1481,7 @@ int
visorchipset_chipset_selftest(void)
{
char env_selftest[20];
- char *envp[] = { env_selftest, NULL };
+ static const char *const envp[] = { env_selftest, NULL };
sprintf(env_selftest, "SPARSP_SELFTEST=%d", 1);
kobject_uevent_env(&Visorchipset_platform_device.dev.kobj, KOBJ_CHANGE,
@@ -1637,7 +1637,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req)
struct controlvm_message_packet *cmd = &req->msg.cmd;
char env_cmd[40], env_id[40], env_state[40], env_bus[40], env_dev[40],
env_func[40];
- char *envp[] = {
+ static const char *const envp[] = {
env_cmd, env_id, env_state, env_bus, env_dev, env_func, NULL
};
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH v2] Staging: unisys: Change char * array type as static const
2015-02-24 22:39 [PATCH v2] Staging: unisys: Change char * array type as static const aybuke ozdemir
@ 2015-02-26 23:18 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-02-26 23:18 UTC (permalink / raw)
To: aybuke ozdemir; +Cc: outreachy-kernel
On Wed, Feb 25, 2015 at 12:39:42AM +0200, aybuke ozdemir wrote:
> This patch fixes "char * array declaration might be better as static
> const" checkpatch.pl warning in visorchipset_main.c
> After this exchange that can be accessed pointer, without object
> derived from the instance but just just read operation can be done in
> pointer.
>
> Signed-off-by: aybuke ozdemir <aybuke.147@gmail.com>
> ---
> Changes since v1:
> * Used "static const char *const" instead of "static char const"
> ---
> drivers/staging/unisys/visorchipset/visorchipset_main.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Please _always_ compile your changes, this one broke the build so badly
that is is obvious you didn't even try to build it :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-26 23:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 22:39 [PATCH v2] Staging: unisys: Change char * array type as static const aybuke ozdemir
2015-02-26 23:18 ` [Outreachy kernel] " Greg KH
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.