Received: by 10.223.176.5 with SMTP id f5csp851464wra; Fri, 2 Feb 2018 07:09:47 -0800 (PST) X-Google-Smtp-Source: AH8x227gYoEYp+inwmhXEsAyptpFOdj47PuLml6gglAdJMckzCjwYdTpZEVOZGUEY712KdRF400q X-Received: by 10.99.190.76 with SMTP id g12mr15292017pgo.235.1517584187147; Fri, 02 Feb 2018 07:09:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517584187; cv=none; d=google.com; s=arc-20160816; b=Z10Ij7VtzDal0qkZMZADEFiQRDub5q6fD0hLmqDdtihd7Qtbdo7+cUPOQJHg44xc6L /Su9shGQExWjsjeUsdfP9vGcV+BklLYTmakNpjn7w4cid6wu1+gQqW3vZW0W3vo4p1wP IZa9kJe2B80N35H8pHpsrboFt8+bRU9T2XOMbFEMqqM8tgCiMTEK7raIfZDHUju0jC8S dxwEO9rBvKizd5n77D2dfldy+0iXbNoc1RnTXJDvXYjdZTPx87HYGVP9liFAFNVqT9Yz QvNTKYhIJs6LNlZWwES8zXJ251cxC8+uzkiNjbLN6oYa0c8gF/DjrC4NmhyhyXPfRu5B xbGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=xqipw2+jQQgU87tZn0g4vuBJTcfYj9g/f6yPWa3pdaw=; b=Ht0Iibz7cxt7K3mSTv8rOEwc0tw4W6pPOEobV50CcZDu6uTpCstUPj5GapfybcxWFj 8sgAaL12CFoxmZ4aQpegVTOLDQcszR/LlY7WIO9hfb0XUC+dbjblr4s1I6o4xZZsNk4m vKU84xoonvIE52DDUcXjXEz7OMCkm7kCXnVaasXw5yjh+vrMKt/C5V/hFKkNvXTgsvXZ qrVzQPRmw0avuBEprlp2ZgFKJ+Ua4zM53get5lELtwygvjzJ0Z71V0KwR5eVIglGVzAd V0Mo9+FFRKqIEWWqThHLHOwCyrhsbfU43RIm9fpg2wp3JBFEcJLnD3B8k6fj6x1OO5XN G4pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=BL+fcz20; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f91-v6si1955521plb.377.2018.02.02.07.09.31; Fri, 02 Feb 2018 07:09:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=BL+fcz20; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290AbeBBPIQ (ORCPT + 99 others); Fri, 2 Feb 2018 10:08:16 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:35189 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbeBBPIJ (ORCPT ); Fri, 2 Feb 2018 10:08:09 -0500 Received: by mail-io0-f196.google.com with SMTP id m11so23241644iob.2 for ; Fri, 02 Feb 2018 07:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xqipw2+jQQgU87tZn0g4vuBJTcfYj9g/f6yPWa3pdaw=; b=BL+fcz20L/4wDHq2JNKdoM/yzz3acze+AJMtW+ISSyDkaiErIgAX3lHOdu/39ujAhx p+LoPcp2I7KVUe7PTaZUFiE2cZJTY7tRKbj7sjY35d5J96oHO52AFiIdj98oV1fc9oUf Ax9n55VZh3BZAohAgw/X4K84erjm85LaXVZckXZjOCMBThvG6BY4yJolndh6WnGQbjjG qa173SrjWl6jy90OvRkwYyoG1J78CAi+RnxgBPbCtpi9nsyoGQgHJPXDUMfguz5KHNbc 31WG5+UyUf8/ddTVBCaYy0JwkNb4Y41LEaxxdRa6rYwuS6N39z0c8ZJaZir6tSgo81Wr x2fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xqipw2+jQQgU87tZn0g4vuBJTcfYj9g/f6yPWa3pdaw=; b=kUcP3gJQjf8rqjw+xx8utk3jrMVOwa/gVizBY+Q1ecKn8LYymoD9H444q2RKHKck2G +Z7j07Bc1dYxdJp0SOcW+Q+T3BewxQmvYhDXbBz8QiUro1oxdU0pn7/itaGOXFqHsSIx 66EMKgDY7lUlvWoy+doBbsyO7G4IZ9j3LVf8e6veNBD5bK2PUThXAwyOe7VRE4t3UWMV /E7bwCneS492vfMl4D1WPyNzwLS+8pQwYH6QHJoGXewmxzxdKoeteKkgjIEAwjPKilQc Z+d6730IzGSbBuiMKcDev1RuvVroYWfi03eWHckag4KmjYEoe62DLn4Sm4CN7l+rQZ6Y UtSA== X-Gm-Message-State: AKwxytdWX6sXdxgYycYwe0oTBBM2xE2OWis6Bsys9vvU0lD87X4QaX7M 4Y/LrvUqn1iMAgnUMXPTwTzft5YC20c= X-Received: by 10.107.140.88 with SMTP id o85mr41964326iod.219.1517584088483; Fri, 02 Feb 2018 07:08:08 -0800 (PST) Received: from [192.168.1.154] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id r203sm1194734itb.38.2018.02.02.07.08.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Feb 2018 07:08:07 -0800 (PST) Subject: Re: [PATCH] block: skd: fix incorrect linux/slab_def.h inclusion To: Arnd Bergmann , Bart Van Assche Cc: Nicolas Pitre , Andi Kleen , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180202150326.344024-1-arnd@arndb.de> From: Jens Axboe Message-ID: Date: Fri, 2 Feb 2018 08:08:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 MIME-Version: 1.0 In-Reply-To: <20180202150326.344024-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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