All of lore.kernel.org
 help / color / mirror / Atom feed
* [renesas-drivers:topic/renesas-overlays 23/92] drivers/of/dynamic.c:1141:13: sparse: incorrect type in assignment (different base types)
@ 2017-12-14 21:37 kbuild test robot
  2017-12-15  8:38 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2017-12-14 21:37 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: kbuild-all, linux-renesas-soc, Geert Uytterhoeven

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, &val, sizeof(val));
  1143	}
  1144	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [renesas-drivers:topic/renesas-overlays 23/92] drivers/of/dynamic.c:1141:13: sparse: incorrect type in assignment (different base types)
  2017-12-14 21:37 [renesas-drivers:topic/renesas-overlays 23/92] drivers/of/dynamic.c:1141:13: sparse: incorrect type in assignment (different base types) kbuild test robot
@ 2017-12-15  8:38 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2017-12-15  8:38 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Pantelis Antoniou, kbuild-all, Linux-Renesas, Geert Uytterhoeven

Hi Fengguang,

On Thu, Dec 14, 2017 at 10:37 PM, kbuild test robot
<fengguang.wu@intel.com> 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, &val, sizeof(val));
>   1143  }

Thank you, folding

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

into the offending commit.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-15  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14 21:37 [renesas-drivers:topic/renesas-overlays 23/92] drivers/of/dynamic.c:1141:13: sparse: incorrect type in assignment (different base types) kbuild test robot
2017-12-15  8:38 ` Geert Uytterhoeven

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.