mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Arnd Bergmann <arnd@arndb.de>, Bart Van Assche <bart.vanassche@wdc.com>
Cc: Nicolas Pitre <nico@linaro.org>, Andi Kleen <ak@linux.intel.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: skd: fix incorrect linux/slab_def.h inclusion
Date: Fri, 2 Feb 2018 08:08:06 -0700	[thread overview]
Message-ID: <ecfc1c6e-1d01-29d2-d418-b086f9089abc@kernel.dk> (raw)
In-Reply-To: <20180202150326.344024-1-arnd@arndb.de>

On 2/2/18 8:03 AM, Arnd Bergmann wrote:
> skd includes slab_def.h to get access to the slab cache object size.
> However, including this header breaks when we use SLUB or SLOB instead of
> the SLAB allocator, since the structure layout is completely different,
> as shown by this warning when we build this driver in one of the invalid
> configurations with link-time optimizations enabled:
> 
> include/linux/slab.h:715:0: error: type of 'kmem_cache_size' does not match original declaration [-Werror=lto-type-mismatch]
>  unsigned int kmem_cache_size(struct kmem_cache *s);
> 
> mm/slab_common.c:77:14: note: 'kmem_cache_size' was previously declared here
>  unsigned int kmem_cache_size(struct kmem_cache *s)
>               ^
> mm/slab_common.c:77:14: note: code may be misoptimized unless -fno-strict-aliasing is used
> include/linux/slab.h:147:0: error: type of 'kmem_cache_destroy' does not match original declaration [-Werror=lto-type-mismatch]
>  void kmem_cache_destroy(struct kmem_cache *);
> 
> mm/slab_common.c:858:6: note: 'kmem_cache_destroy' was previously declared here
>  void kmem_cache_destroy(struct kmem_cache *s)
>       ^
> mm/slab_common.c:858:6: note: code may be misoptimized unless -fno-strict-aliasing is used
> include/linux/slab.h:140:0: error: type of 'kmem_cache_create' does not match original declaration [-Werror=lto-type-mismatch]
>  struct kmem_cache *kmem_cache_create(const char *name, size_t size,
> 
> mm/slab_common.c:534:1: note: 'kmem_cache_create' was previously declared here
>  kmem_cache_create(const char *name, size_t size, size_t align,>  ^
> 
> This removes the header inclusion and instead uses the kmem_cache_size()
> interface to get the size in a reliable way.

Thanks Arnd, applied.

-- 
Jens Axboe

      reply	other threads:[~2018-02-02 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 15:03 Arnd Bergmann
2018-02-02 15:08 ` Jens Axboe [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=ecfc1c6e-1d01-29d2-d418-b086f9089abc@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=ak@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bart.vanassche@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nico@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome