Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1729485 > unrolled thread

[PATCH] extcon: make extcon_info static const, fixes warning

Started byColin King <colin.king@canonical.com>
First post2017-09-09 19:00 +0200
Last post2017-09-11 02:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] extcon: make extcon_info static const, fixes warning Colin King <colin.king@canonical.com> - 2017-09-09 19:00 +0200
    Re: [PATCH] extcon: make extcon_info static const, fixes warning Chanwoo Choi <cw00.choi@samsung.com> - 2017-09-11 02:50 +0200

#1729485 — [PATCH] extcon: make extcon_info static const, fixes warning

FromColin King <colin.king@canonical.com>
Date2017-09-09 19:00 +0200
Subject[PATCH] extcon: make extcon_info static const, fixes warning
Message-ID<unRgR-8bO-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1730093

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-09-11 02:50 +0200
Message-ID<uol5f-3ps-1@gated-at.bofh.it>
In reply to#1729485
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web