All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>,
	Wei Yongjun <weiyj.lk@gmail.com>,
	linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remoteproc: qcom: fix initializers for qcom_mss_reg_res array
Date: Wed, 1 Feb 2017 01:22:15 -0800	[thread overview]
Message-ID: <20170201092215.GF31134@builder> (raw)
In-Reply-To: <20170201165723.2615554-1-arnd@arndb.de>

On Wed 01 Feb 08:56 PST 2017, Arnd Bergmann wrote:

> The recently added initialization is rather unusual because it uses a constructor for
> a variable-length array to assign a constant structure to a member that uses a fixed-length
> array. This confuses clang and breaks the build.
> 
> drivers/remoteproc/qcom_q6v5_pil.c:1024:18: error: incompatible pointer types initializing 'const char *' with an expression of type
> :%s      'struct qcom_mss_reg_res [4]' [-Werror,-Wincompatible-pointer-types]
>         .proxy_supply = (struct qcom_mss_reg_res[]) {
>                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/remoteproc/qcom_q6v5_pil.c:1024:18: warning: suggest braces around initialization of subobject [-Wmissing-braces]
>         .proxy_supply = (struct qcom_mss_reg_res[]) {
>                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> We can either turn this constructor into a regular initializer by removing
> the 'struct qcom_mss_reg_res[])', or we can make the array variable length.
> 
> The latter approach is used for the arrays of strings in the same structure,
> so let's use that here too.
> 
> Fixes: 19f902b53b47 ("remoteproc: qcom: Initialize and enable proxy and active regulators.")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Looked at it, but figured it wasn't worth an extra respin...

Applied.

Thanks,
Bjorn

> ---
>  drivers/remoteproc/qcom_q6v5_pil.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
> index 9a5149573298..8d60ad2a2851 100644
> --- a/drivers/remoteproc/qcom_q6v5_pil.c
> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
> @@ -107,8 +107,8 @@ struct qcom_mss_reg_res {
>  
>  struct rproc_hexagon_res {
>  	const char *hexagon_mba_image;
> -	struct qcom_mss_reg_res proxy_supply[4];
> -	struct qcom_mss_reg_res active_supply[2];
> +	struct qcom_mss_reg_res *proxy_supply;
> +	struct qcom_mss_reg_res *active_supply;
>  	char **proxy_clk_names;
>  	char **active_clk_names;
>  };
> -- 
> 2.9.0
> 

      reply	other threads:[~2017-02-01  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 16:56 [PATCH] remoteproc: qcom: fix initializers for qcom_mss_reg_res array Arnd Bergmann
2017-02-01  9:22 ` Bjorn Andersson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170201092215.GF31134@builder \
    --to=bjorn.andersson@linaro.org \
    --cc=akdwived@codeaurora.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=weiyj.lk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.