Skip to content

Commit

Permalink
remoteproc: qcom: fix initializers for qcom_mss_reg_res array
Browse files Browse the repository at this point in the history
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: 19f902b ("remoteproc: qcom: Initialize and enable proxy and active regulators.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
arndb authored and andersson committed Feb 1, 2017
1 parent 2099c77 commit ec671b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/remoteproc/qcom_q6v5_pil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit ec671b5

Please sign in to comment.