lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <514833A6.5010502@samsung.com>
Date:	Tue, 19 Mar 2013 18:45:10 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Jingoo Han <jg1.han@...sung.com>
Cc:	'MyungJoo Ham' <myungjoo.ham@...sung.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] extcon: max8997: add missing const

On 03/19/2013 02:31 PM, Jingoo Han wrote:
> Fixed the checkpatch warning as below:
>
>   WARNING: static const char * array should probably be static const char * const
>   #163: FILE: drivers/extcon/extcon-max8997.c:163:
>   +static const char *max8997_extcon_cable[] = {
>
> Also, const is added to variable 'supported_cable' to prevent
> build warning as below:
>
>   drivers/extcon/extcon-max8997.c: In function 'max8997_muic_probe':
>   drivers/extcon/extcon-max8997.c:708:30: warning: assignment discards 'const' qualifier from pointer target type [enabled by
> default]
>
> Signed-off-by: Jingoo Han <jg1.han@...sung.com>
> ---
> Changes since v1:
> - Added const to variable 'supported_cable'
>
>  drivers/extcon/extcon-max8997.c |    2 +-
>  include/linux/extcon.h          |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
> index 20772ad..b82a591 100644
> --- a/drivers/extcon/extcon-max8997.c
> +++ b/drivers/extcon/extcon-max8997.c
> @@ -160,7 +160,7 @@ enum {
>  	_EXTCON_CABLE_NUM,
>  };
>  
> -static const char *max8997_extcon_cable[] = {
> +static const char * const max8997_extcon_cable[] = {
OK.
>  	[EXTCON_CABLE_USB]			= "USB",
>  	[EXTCON_CABLE_USB_HOST]			= "USB-Host",
>  	[EXTCON_CABLE_TA]			= "TA",
> diff --git a/include/linux/extcon.h b/include/linux/extcon.h
> index fcb51c8..741a491 100644
> --- a/include/linux/extcon.h
> +++ b/include/linux/extcon.h
> @@ -113,7 +113,7 @@ struct extcon_cable;
>  struct extcon_dev {
>  	/* --- Optional user initializing data --- */
>  	const char	*name;
> -	const char **supported_cable;
> +	const char * const *supported_cable;
I understand your intention to fix build warning.
But, I don't agree this coding style. I think this coding
style is not general method.

Thanks,
Chanwoo Choi




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ