Re: [renesas-drivers:topic/renesas-overlays 23/92] drivers/of/dynamic.c:1141:13: sparse: incorrect type in assignment (different base types)

2017-12-15 Thread Geert Uytterhoeven
Hi Fengguang,

On Thu, Dec 14, 2017 at 10:37 PM, kbuild test robot
 wrote:
> tree:   
> https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git 
> topic/renesas-overlays
> head:   47d433a558bb60587eb9f86a4d010ef74e03fa0d
> commit: e068b1eab7180587d15bbc55abdc5851b7f216dc [23/92] of: changesets: 
> Introduce changeset helper methods
> reproduce:
> # apt-get install sparse
> git checkout e068b1eab7180587d15bbc55abdc5851b7f216dc
> make ARCH=x86_64 allmodconfig
> make C=1 CF=-D__CHECK_ENDIAN__
>
>
> sparse warnings: (new ones prefixed by >>)
>
>
> vim +1141 drivers/of/dynamic.c
>
>   1124
>   1125  /**
>   1126   * of_changeset_add_property_u32 - Create a new u32 property
>   1127   *
>   1128   * @ocs:changeset pointer
>   1129   * @np: device node pointer
>   1130   * @name:   name of the property
>   1131   * @val:value in host endian format
>   1132   *
>   1133   * Adds a u32 property to the changeset.
>   1134   *
>   1135   * Returns zero on success, a negative error value otherwise.
>   1136   */
>   1137  int of_changeset_add_property_u32(struct of_changeset *ocs,
>   1138  struct device_node *np, const char *name, u32 val)
>   1139  {
>   1140  /* in place */
>> 1141  val = cpu_to_be32(val);
>   1142  return of_changeset_add_property_copy(ocs, np, name, , 
> sizeof(val));
>   1143  }

Thank you, folding

+   __be32 x;
+
/* in place */
-   val = cpu_to_be32(val);
-   return of_changeset_add_property_copy(ocs, np, name, , sizeof(val));
+   x = cpu_to_be32(val);
+   return of_changeset_add_property_copy(ocs, np, name, , sizeof(x));

into the offending commit.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


[renesas-drivers:topic/renesas-overlays 23/92] drivers/of/dynamic.c:1141:13: sparse: incorrect type in assignment (different base types)

2017-12-14 Thread kbuild test robot
tree:   
https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git 
topic/renesas-overlays
head:   47d433a558bb60587eb9f86a4d010ef74e03fa0d
commit: e068b1eab7180587d15bbc55abdc5851b7f216dc [23/92] of: changesets: 
Introduce changeset helper methods
reproduce:
# apt-get install sparse
git checkout e068b1eab7180587d15bbc55abdc5851b7f216dc
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)


vim +1141 drivers/of/dynamic.c

  1124  
  1125  /**
  1126   * of_changeset_add_property_u32 - Create a new u32 property
  1127   *
  1128   * @ocs:changeset pointer
  1129   * @np: device node pointer
  1130   * @name:   name of the property
  1131   * @val:value in host endian format
  1132   *
  1133   * Adds a u32 property to the changeset.
  1134   *
  1135   * Returns zero on success, a negative error value otherwise.
  1136   */
  1137  int of_changeset_add_property_u32(struct of_changeset *ocs,
  1138  struct device_node *np, const char *name, u32 val)
  1139  {
  1140  /* in place */
> 1141  val = cpu_to_be32(val);
  1142  return of_changeset_add_property_copy(ocs, np, name, , 
sizeof(val));
  1143  }
  1144  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation