LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: "David S . Miller" <davem@davemloft.net>,
	sparclinux <sparclinux@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Laight <David.Laight@aculab.com>,
	Anatoly Pugachev <matorola@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH v2] sparc: mdesc: Fix compile error seen with gcc 11.x
Date: Wed, 15 Sep 2021 16:04:22 +0200	[thread overview]
Message-ID: <CAK8P3a36YHAnDyhy+nQEo9x=c2Dq8pf44sBsksXj2xb+Fnk-bA@mail.gmail.com> (raw)
In-Reply-To: <20210914224709.601156-1-linux@roeck-us.net>

On Wed, Sep 15, 2021 at 12:47 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> sparc64 images fail to compile with gcc 11.x, reporting the following
> errors.
>
> arch/sparc/kernel/mdesc.c:647:22: error:
>         'strcmp' reading 1 or more bytes from a region of size 0
> arch/sparc/kernel/mdesc.c:692:22: error:
>         'strcmp' reading 1 or more bytes from a region of size 0
> arch/sparc/kernel/mdesc.c:719:21:
>         error: 'strcmp' reading 1 or more bytes from a region of size 0
>
> The underlying problem is that node_block() returns a pointer beyond
> the end of struct mdesc_hdr. gcc 11.x detects that and reports the error.
> Adding an additional zero-length field to struct mdesc_hdr and pointing
> to that field fixes the problem.
>
> Cc: Arnd Bergmann <arnd@kernel.org>
> Cc: David Laight <David.Laight@ACULAB.COM>
> Cc: Anatoly Pugachev <matorola@gmail.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> v2: data[0] => data[]
>
> I am not sure if there was agreement to accept this patch or not, but
> I was asked to resend it with the above change, so here it is. An open
> question was if it is acceptable to have a structure named xxx_hdr
> include an element pointing to the data following that header.
>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

      parent reply	other threads:[~2021-09-15 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 22:47 Guenter Roeck
2021-09-15  8:38 ` David Laight
2021-09-15 14:04 ` Arnd Bergmann [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='CAK8P3a36YHAnDyhy+nQEo9x=c2Dq8pf44sBsksXj2xb+Fnk-bA@mail.gmail.com' \
    --to=arnd@kernel.org \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=matorola@gmail.com \
    --cc=sam@ravnborg.org \
    --cc=sparclinux@vger.kernel.org \
    --subject='Re: [PATCH v2] sparc: mdesc: Fix compile error seen with gcc 11.x' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).