* [PATCH] extcon: make extcon_info static const, fixes warning
@ 2017-09-09 16:51 ` Colin King
2017-09-11 0:43 ` Chanwoo Choi
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-09-09 16:51 UTC (permalink / raw)
To: MyungJoo Ham, Chanwoo Choi; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The array extcon_info is read only, local to the source and does not
need to be in global scope, so make it static const.
Cleans up sparse warning:
symbol 'extcon_info' was not declared. Should it be static?
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/extcon/extcon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index 35e9fb885486..cb38c2747684 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -36,7 +36,7 @@
#define SUPPORTED_CABLE_MAX 32
-struct __extcon_info {
+static const struct __extcon_info {
unsigned int type;
unsigned int id;
const char *name;
--
2.14.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: make extcon_info static const, fixes warning
2017-09-09 16:51 ` [PATCH] extcon: make extcon_info static const, fixes warning Colin King
@ 2017-09-11 0:43 ` Chanwoo Choi
0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2017-09-11 0:43 UTC (permalink / raw)
To: Colin King, MyungJoo Ham; +Cc: kernel-janitors, linux-kernel
On 2017년 09월 10일 01:51, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The array extcon_info is read only, local to the source and does not
> need to be in global scope, so make it static const.
>
> Cleans up sparse warning:
> symbol 'extcon_info' was not declared. Should it be static?
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/extcon/extcon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 35e9fb885486..cb38c2747684 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -36,7 +36,7 @@
>
> #define SUPPORTED_CABLE_MAX 32
>
> -struct __extcon_info {
> +static const struct __extcon_info {
> unsigned int type;
> unsigned int id;
> const char *name;
>
Applied it for v4.15. Thanks.
--
Best Regards,
Chanwoo Choi
Samsung Electronics
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-11 0:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20170909165107epcas3p169935c5e37c5b21a9ffecf4cf01d5256@epcas3p1.samsung.com>
2017-09-09 16:51 ` [PATCH] extcon: make extcon_info static const, fixes warning Colin King
2017-09-11 0:43 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox