All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [efi:next 2/3] arch/x86/boot/compressed/eboot.c:26:16: sparse: incorrect type in return expression (different modifiers)
Date: Wed, 12 Nov 2014 11:31:58 +0100	[thread overview]
Message-ID: <CAKv+Gu8Jk4z6Q+8ZstNrA5e0ictYnzq9XOeq8zbr8ADo5DyWow@mail.gmail.com> (raw)
In-Reply-To: <201411120724.PdeIjimc%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

On 12 November 2014 00:48, kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git next
> head:   8266e31ed0fedb7ee16ebc86e80468f7cc1bbb4e
> commit: 243b6754cd17112bbf0724ed3c13446b48cf6a28 [2/3] efi/x86: Move x86 back to libstub
> reproduce:
>   # apt-get install sparse
>   git checkout 243b6754cd17112bbf0724ed3c13446b48cf6a28
>   make ARCH=x86_64 allmodconfig
>   make C=1 CF=-D__CHECK_ENDIAN__
>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> arch/x86/boot/compressed/eboot.c:26:16: sparse: incorrect type in return expression (different modifiers)
>    arch/x86/boot/compressed/eboot.c:26:16:    expected struct efi_config const [pure] *
>    arch/x86/boot/compressed/eboot.c:26:16:    got struct efi_config *static [toplevel] efi_early
>

This smells like a sparse bug: __pure applies to functions only, so
there is no way we could ever return something with the __pure
modifier attached.

-- 
Ard.


> vim +26 arch/x86/boot/compressed/eboot.c
>
>     10  #include <linux/efi.h>
>     11  #include <linux/pci.h>
>     12  #include <asm/efi.h>
>     13  #include <asm/setup.h>
>     14  #include <asm/desc.h>
>     15
>     16  #undef memcpy                   /* Use memcpy from misc.c */
>     17
>     18  #include "eboot.h"
>     19
>     20  static efi_system_table_t *sys_table;
>     21
>     22  static struct efi_config *efi_early;
>     23
>     24  __pure const struct efi_config *__efi_early(void)
>     25  {
>   > 26          return efi_early;
>     27  }
>     28
>     29  #define BOOT_SERVICES(bits)                                             \
>     30  static void setup_boot_services##bits(struct efi_config *c)             \
>     31  {                                                                       \
>     32          efi_system_table_##bits##_t *table;                             \
>     33          efi_boot_services_##bits##_t *bt;                               \
>     34                                                                          \
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

       reply	other threads:[~2014-11-12 10:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201411120724.PdeIjimc%fengguang.wu@intel.com>
     [not found] ` <201411120724.PdeIjimc%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-12 10:31   ` Ard Biesheuvel [this message]
     [not found]     ` <1415799312.14686.332.camel@mfleming-mobl1.ger.corp.intel.com>
     [not found]       ` <1415799312.14686.332.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-12 15:22         ` [efi:next 2/3] arch/x86/boot/compressed/eboot.c:26:16: sparse: incorrect type in return expression (different modifiers) Christopher Li
     [not found]           ` <CANeU7Qn8J2dn4V5Mx1WzUM9q+m=K66yUuEkN39bH_djRoBzqNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-12 15:34             ` Ard Biesheuvel
     [not found]               ` <CAKv+Gu-L2EoqioZamh9arLSkXzQF4y=FDykk0YK1XvNkRGC-xg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-16 10:13                 ` Christopher Li
2014-11-16 17:58                   ` Ard Biesheuvel
     [not found]                     ` <CAKv+Gu8DB6tCrpTqiCSWDGU4cRO1u3hqO9-K-cON5ODDMgsx1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-17  0:38                       ` Christopher Li
2014-11-17 15:35                         ` Christopher Li
     [not found]                           ` <CANeU7QkZKv+c1y-_9DsvV-EqKnmm+NjUEGxhZBqSF_5AJ+XT1g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-17 16:24                             ` Ard Biesheuvel
     [not found]                               ` <CAKv+Gu-c4qk-Snkc6Vs=LKwCnxVTMeBmgGjWT4qxapi-nTYX+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-18 16:09                                 ` Christopher Li
2014-11-18 16:38                                   ` Ard Biesheuvel
     [not found]                                     ` <CAKv+Gu_2uwTdDT=7ghM6e2-=TpH652Q-JOOwF6oFsGFLxeKueg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-19  2:53                                       ` Christopher Li
     [not found]                                         ` <CANeU7Q=uCR6P41F72J0X6c2=fgU5eefPj1NrzfnoYRtCuzYxYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-19 11:31                                           ` Ard Biesheuvel
2014-11-16 18:22                   ` Josh Triplett
2014-11-17  0:59                     ` Christopher Li

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=CAKv+Gu8Jk4z6Q+8ZstNrA5e0ictYnzq9XOeq8zbr8ADo5DyWow@mail.gmail.com \
    --to=ard.biesheuvel-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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.