Skip to contentSkip to conversation

linux-next: build warning after merge of the pm tree

DISCUSSION Stephen Rothwell 4 participants 7 messages Oct 14, 2019 – Oct 16, 2019 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the pm tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:

In file included from include/linux/irqchip.h:14,

                 from arch/arm/kernel/irq.c:26:
include/linux/acpi.h:682:31: warning: 'struct acpi_device' declared inside parameter list will not be visible outside of this definition or declaration
  682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2)
      |                               ^~~~~~~~~~~

and many more.

Introduced by commit

d1748b57dc88 ("ACPI / utils: Introduce acpi_dev_hid_uid_match() helper")

CONFIG_ACPI is not set for this build.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

linux-next: build failure after merge of the pm tree (Was: linux-next: build warning after merge of the pm tree)

Hi all,

Quoted 10 lines · On Tue, 15 Oct 2019 10:08:55 +1100 Stephen Rothwell <[email protected]>…

After merging the pm tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:

In file included from include/linux/irqchip.h:14,

                 from arch/arm/kernel/irq.c:26:
include/linux/acpi.h:682:31: warning: 'struct acpi_device' declared inside parameter list will not be visible outside of this definition or declaration
  682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2)
      |                               ^~~~~~~~~~~
Quoted 7 lines

and many more.

Introduced by commit

d1748b57dc88 ("ACPI / utils: Introduce acpi_dev_hid_uid_match() helper")

CONFIG_ACPI is not set for this build.

This became a build failure for the powerpc ppc64_allmodconfig build:

In file included from include/linux/i2c.h:13,
from arch/powerpc/platforms/pasemi/misc.c:14:
include/linux/acpi.h:682:31: error: 'struct acpi_device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2)

      |                               ^~~~~~~~~~~

cc1: all warnings being treated as errors

(and many more)

I have used the pm tree from next-20191014 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#2 lore raw

Re: linux-next: build failure after merge of the pm tree (Was: linux-next: build warning after merge of the pm tree)

Quoted 39 lines · CEST Stephen Rothwell

--Sig_/6GS1h5au_w04qPbsgg/ztsa
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hi all,

Quoted 7 lines · On Tue, 15 Oct 2019 10:08:55 +1100 Stephen Rothwell <[email protected]> =…

After merging the pm tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:
=20
In file included from include/linux/irqchip.h:14,

                 from arch/arm/kernel/irq.c:26:

include/linux/acpi.h:682:31: warning: 'struct acpi_device' declared insid=

e parameter list will not be visible outside of this definition or declarat= ion

Quoted 1 line

682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2=

, const char *uid2)

Quoted 9 lines
      |                               ^~~~~~~~~~~

=20
and many more.
=20
Introduced by commit
=20
d1748b57dc88 ("ACPI / utils: Introduce acpi_dev_hid_uid_match() helper")
=20
CONFIG_ACPI is not set for this build.

This became a build failure for the powerpc ppc64_allmodconfig build:

In file included from include/linux/i2c.h:13,
from arch/powerpc/platforms/pasemi/misc.c:14:
include/linux/acpi.h:682:31: error: 'struct acpi_device' declared inside pa= rameter list will not be visible outside of this definition or declaration = [-Werror]
682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, =
const char *uid2)

Quoted 6 lines
      |                               ^~~~~~~~~~~

cc1: all warnings being treated as errors

(and many more)

I have used the pm tree from next-20191014 for today.

So this looks weird, because there is an acpi_dev_put() stub in include/linux/acpi.h too in the same #else block and it takes a (struct acpi_device *) pointer too and it has not been touched by the commit in question. So why has it built successfully so far?

Also I wonder why 0-day didn't warn about that commit.

Anyway, I've added an extra declaration of struct acpi_device to the #else block in question to suppress the warning(s).

#3 lore raw

Re: linux-next: build failure after merge of the pm tree (Was: linux-next: build warning after merge of the pm tree)

Hi Rafael,

Quoted 36 lines · Rafael J. Wysocki
Quoted 35 lines · CEST Stephen Rothwell
Quoted 7 lines · On Tue, 15 Oct 2019 10:08:55 +1100 Stephen Rothwell <[email protected]> =…

After merging the pm tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:
=20
In file included from include/linux/irqchip.h:14,

                 from arch/arm/kernel/irq.c:26:

include/linux/acpi.h:682:31: warning: 'struct acpi_device' declared insid=

e parameter list will not be visible outside of this definition or declarat= ion

Quoted 1 line

682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2=

, const char *uid2)

Quoted 9 lines
      |                               ^~~~~~~~~~~

=20
and many more.
=20
Introduced by commit
=20
d1748b57dc88 ("ACPI / utils: Introduce acpi_dev_hid_uid_match() helper")
=20
CONFIG_ACPI is not set for this build.

This became a build failure for the powerpc ppc64_allmodconfig build:

In file included from include/linux/i2c.h:13,
from arch/powerpc/platforms/pasemi/misc.c:14:
include/linux/acpi.h:682:31: error: 'struct acpi_device' declared inside pa= rameter list will not be visible outside of this definition or declaration = [-Werror]
682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, =
const char *uid2)

      |                               ^~~~~~~~~~~

cc1: all warnings being treated as errors

Quoted 8 lines
Quoted 3 lines

(and many more)

I have used the pm tree from next-20191014 for today.

So this looks weird, because there is an acpi_dev_put() stub in include/linux/acpi.h too in the same #else block and it takes a (struct acpi_device *) pointer too and it has not been touched by the commit in question. So why has it built successfully so far?

Looks like that never warned because acpi_dev_put() is located after

    static inline struct acpi_device *
    acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
    {
            return NULL;
    }

Moving acpi_dev_hid_uid_match() down gets rid of the warning, too.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#4 lore raw

Re: linux-next: build failure after merge of the pm tree (Was: linux-next: build warning after merge of the pm tree)

Quoted 28 lines · Geert Uytterhoeven
Quoted 16 lines · Rafael J. Wysocki
Quoted 15 lines · CEST Stephen Rothwell

On Tue, 15 Oct 2019 10:08:55 +1100 Stephen Rothwell <[email protected]> = wrote:

This became a build failure for the powerpc ppc64_allmodconfig build:

In file included from include/linux/i2c.h:13,
from arch/powerpc/platforms/pasemi/misc.c:14:
include/linux/acpi.h:682:31: error: 'struct acpi_device' declared inside pa= rameter list will not be visible outside of this definition or declaration = [-Werror]
682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, =
const char *uid2)

      |                               ^~~~~~~~~~~

cc1: all warnings being treated as errors

Quoted 8 lines
Quoted 3 lines

(and many more)

I have used the pm tree from next-20191014 for today.

So this looks weird, because there is an acpi_dev_put() stub in include/linux/acpi.h too in the same #else block and it takes a (struct acpi_device *) pointer too and it has not been touched by the commit in question. So why has it built successfully so far?

Looks like that never warned because acpi_dev_put() is located after

Quoted 7 lines
    static inline struct acpi_device *
    acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
    {
            return NULL;
    }

Moving acpi_dev_hid_uid_match() down gets rid of the warning, too.

Sounds like a compiler bug.

It thinks that struct acpi_device * is defined as function prototype?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw
In reply to Stephen Rothwell
Quoted 11 lines · Stephen Rothwell

Hi all,

After merging the pm tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:

In file included from include/linux/irqchip.h:14,

                 from arch/arm/kernel/irq.c:26:
include/linux/acpi.h:682:31: warning: 'struct acpi_device' declared inside parameter list will not be visible outside of this definition or declaration
  682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2)
      |                               ^~~~~~~~~~~
Quoted 7 lines

and many more.

Introduced by commit

d1748b57dc88 ("ACPI / utils: Introduce acpi_dev_hid_uid_match() helper")

CONFIG_ACPI is not set for this build.

I'm puzzled. Why it builds before?

Another function has struct acpi_device *adev in its prototype and it was before above mentioned commit.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw
Quoted 16 lines · CEST Andy Shevchenko
Quoted 15 lines · Stephen Rothwell

Hi all,

After merging the pm tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:

In file included from include/linux/irqchip.h:14,

                 from arch/arm/kernel/irq.c:26:
include/linux/acpi.h:682:31: warning: 'struct acpi_device' declared inside parameter list will not be visible outside of this definition or declaration
  682 | acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2)
      |                               ^~~~~~~~~~~

and many more.

Introduced by commit

Quoted 8 lines
Quoted 3 lines

d1748b57dc88 ("ACPI / utils: Introduce acpi_dev_hid_uid_match() helper")

CONFIG_ACPI is not set for this build.

I'm puzzled. Why it builds before?

Another function has struct acpi_device *adev in its prototype and it was before above mentioned commit.

Right.

The very next acpi_dev_get_first_match_dev() returns a pointer to struct acpi_device too and it is not modified by the commit in question.

There may be a bug in there, but commit d1748b57dc88 doesn't look like the source of it.