From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marc-Andre Lureau <mlureau@redhat.com>
Cc: "kbuild test robot" <fengguang.wu@intel.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
kbuild-all@01.org, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org
Subject: Re: [vhost:vhost 24/24] drivers/firmware/qemu_fw_cfg.c:499:22: error: storage size of 'files' isn't known
Date: Thu, 15 Feb 2018 20:26:26 +0200 [thread overview]
Message-ID: <20180215202603-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAMxuvawhzjNA8gQSCpVtff-A6-Umg6fPz37nPhqRrDiRwKqUCQ@mail.gmail.com>
On Thu, Feb 15, 2018 at 10:46:50AM +0100, Marc-Andre Lureau wrote:
> Hi
>
> On Wed, Feb 14, 2018 at 9:27 PM, kbuild test robot
> <fengguang.wu@intel.com> wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost
> > head: 5d457fe6aeaab9d0a1665eafc8af7139bc6b6f2e
> > commit: 5d457fe6aeaab9d0a1665eafc8af7139bc6b6f2e [24/24] fw_cfg: fix sparse warnings around FW_CFG_FILE_DIR read
> > config: i386-randconfig-x015-201806 (attached as .config)
> > compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
> > reproduce:
> > git checkout 5d457fe6aeaab9d0a1665eafc8af7139bc6b6f2e
> > # save the attached .config to linux build tree
> > make ARCH=i386
> >
> > All errors (new ones prefixed by >>):
> >
> > drivers/firmware/qemu_fw_cfg.c: In function 'fw_cfg_register_dir_entries':
> >>> drivers/firmware/qemu_fw_cfg.c:499:22: error: storage size of 'files' isn't known
> > struct fw_cfg_files files;
> > ^~~~~
>
> struct fw_cfg_files {
> __be32 count; /* number of entries */
> struct fw_cfg_file f[];
> };
>
> Interesting, I don't have that warning with 7.3.1.
>
> I thought the size would be sizeof(count) by standard.
>
> I replaced it with a __be32 files_count variable instead.
>
> > drivers/firmware/qemu_fw_cfg.c:499:22: warning: unused variable 'files' [-Wunused-variable]
> >
>
> files.count is used 3 lines below, that looks like a compiler bug to me.
No - i tried dropping one patch out of series, this did not work out.
So whole series is out for now.
> > vim +499 drivers/firmware/qemu_fw_cfg.c
> >
> > 493
> > 494 /* iterate over all fw_cfg directory entries, registering each one */
> > 495 static int fw_cfg_register_dir_entries(void)
> > 496 {
> > 497 int ret = 0;
> > 498 u32 count, i;
> > > 499 struct fw_cfg_files files;
> > 500 struct fw_cfg_file *dir;
> > 501 size_t dir_size;
> > 502
> > 503 fw_cfg_read_blob(FW_CFG_FILE_DIR, &files.count, 0, sizeof(files.count));
> > 504 count = be32_to_cpu(files.count);
> > 505 dir_size = count * sizeof(struct fw_cfg_file);
> > 506
> > 507 dir = kmalloc(dir_size, GFP_KERNEL);
> > 508 if (!dir)
> > 509 return -ENOMEM;
> > 510
> > 511 fw_cfg_read_blob(FW_CFG_FILE_DIR, dir, sizeof(files.count), dir_size);
> > 512
> > 513 for (i = 0; i < count; i++) {
> > 514 ret = fw_cfg_register_file(&dir[i]);
> > 515 if (ret)
> > 516 break;
> > 517 }
> > 518
> > 519 kfree(dir);
> > 520 return ret;
> > 521 }
> > 522
> >
> > ---
> > 0-DAY kernel test infrastructure Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all Intel Corporation
prev parent reply other threads:[~2018-02-15 18:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-14 20:27 [vhost:vhost 24/24] drivers/firmware/qemu_fw_cfg.c:499:22: error: storage size of 'files' isn't known kbuild test robot
2018-02-15 9:46 ` Marc-Andre Lureau
2018-02-15 18:26 ` Michael S. Tsirkin
2018-02-15 18:26 ` Michael S. Tsirkin [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=20180215202603-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=fengguang.wu@intel.com \
--cc=kbuild-all@01.org \
--cc=kvm@vger.kernel.org \
--cc=marcandre.lureau@redhat.com \
--cc=mlureau@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.