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]
Date:   Tue, 6 Aug 2019 20:40:55 -0500
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        Linux Next Mailing List <linux-next@...r.kernel.org>
Subject: Re: [PATCH] soc: qcom: socinfo: Annotate switch cases with fall
 through

Hi,

On 8/6/19 8:24 PM, Bjorn Andersson wrote:
> Introduce fall through annotations in the switch statements of
> socinfo_debugfs_init() to silence compiler warnings.
> 

This is enough to silence all the warnings:

diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index 855353bed19e..a39ea5061dc5 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -323,6 +323,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
                debugfs_create_x32("raw_device_number", 0400,
                                   qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.raw_device_num);
+               /* Fall through */
        case SOCINFO_VERSION(0, 11):
        case SOCINFO_VERSION(0, 10):
        case SOCINFO_VERSION(0, 9):
@@ -330,10 +331,12 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,

                debugfs_create_u32("foundry_id", 0400, qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.foundry_id);
+               /* Fall through */
        case SOCINFO_VERSION(0, 8):
        case SOCINFO_VERSION(0, 7):
                DEBUGFS_ADD(info, pmic_model);
                DEBUGFS_ADD(info, pmic_die_rev);
+               /* Fall through */
        case SOCINFO_VERSION(0, 6):
                qcom_socinfo->info.hw_plat_subtype =
                        __le32_to_cpu(info->hw_plat_subtype);
@@ -341,6 +344,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
                debugfs_create_u32("hardware_platform_subtype", 0400,
                                   qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.hw_plat_subtype);
+               /* Fall through */
        case SOCINFO_VERSION(0, 5):
                qcom_socinfo->info.accessory_chip =
                        __le32_to_cpu(info->accessory_chip);
@@ -348,23 +352,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
                debugfs_create_u32("accessory_chip", 0400,
                                   qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.accessory_chip);
+               /* Fall through */
        case SOCINFO_VERSION(0, 4):
                qcom_socinfo->info.plat_ver = __le32_to_cpu(info->plat_ver);

                debugfs_create_u32("platform_version", 0400,
                                   qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.plat_ver);
+               /* Fall through */
        case SOCINFO_VERSION(0, 3):
                qcom_socinfo->info.hw_plat = __le32_to_cpu(info->hw_plat);

                debugfs_create_u32("hardware_platform", 0400,
                                   qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.hw_plat);
+               /* Fall through */
        case SOCINFO_VERSION(0, 2):
                qcom_socinfo->info.raw_ver  = __le32_to_cpu(info->raw_ver);

                debugfs_create_u32("raw_version", 0400, qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.raw_ver);
+               /* Fall through */
        case SOCINFO_VERSION(0, 1):
                DEBUGFS_ADD(info, build_id);
                break;

--
Gustavo


> Fixes: 9c84c1e78634 ("soc: qcom: socinfo: Expose custom attributes")
> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> ---
>  drivers/soc/qcom/socinfo.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
> index 855353bed19e..f0ca9d7c7966 100644
> --- a/drivers/soc/qcom/socinfo.c
> +++ b/drivers/soc/qcom/socinfo.c
> @@ -323,17 +323,23 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
>  		debugfs_create_x32("raw_device_number", 0400,
>  				   qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.raw_device_num);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 11):
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 10):
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 9):
>  		qcom_socinfo->info.foundry_id = __le32_to_cpu(info->foundry_id);
>  
>  		debugfs_create_u32("foundry_id", 0400, qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.foundry_id);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 8):
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 7):
>  		DEBUGFS_ADD(info, pmic_model);
>  		DEBUGFS_ADD(info, pmic_die_rev);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 6):
>  		qcom_socinfo->info.hw_plat_subtype =
>  			__le32_to_cpu(info->hw_plat_subtype);
> @@ -341,6 +347,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
>  		debugfs_create_u32("hardware_platform_subtype", 0400,
>  				   qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.hw_plat_subtype);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 5):
>  		qcom_socinfo->info.accessory_chip =
>  			__le32_to_cpu(info->accessory_chip);
> @@ -348,23 +355,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
>  		debugfs_create_u32("accessory_chip", 0400,
>  				   qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.accessory_chip);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 4):
>  		qcom_socinfo->info.plat_ver = __le32_to_cpu(info->plat_ver);
>  
>  		debugfs_create_u32("platform_version", 0400,
>  				   qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.plat_ver);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 3):
>  		qcom_socinfo->info.hw_plat = __le32_to_cpu(info->hw_plat);
>  
>  		debugfs_create_u32("hardware_platform", 0400,
>  				   qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.hw_plat);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 2):
>  		qcom_socinfo->info.raw_ver  = __le32_to_cpu(info->raw_ver);
>  
>  		debugfs_create_u32("raw_version", 0400, qcom_socinfo->dbg_root,
>  				   &qcom_socinfo->info.raw_ver);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 1):
>  		DEBUGFS_ADD(info, build_id);
>  		break;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ