From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5885C76188 for ; Fri, 19 Jul 2019 11:32:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACE2A2173B for ; Fri, 19 Jul 2019 11:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727618AbfGSLcR (ORCPT ); Fri, 19 Jul 2019 07:32:17 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:32889 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbfGSLcR (ORCPT ); Fri, 19 Jul 2019 07:32:17 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M7v18-1hkbMf1elO-0052h7; Fri, 19 Jul 2019 13:31:47 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: Masahiro Yamada , Jani Nikula , Randy Dunlap , Arnd Bergmann , "Darrick J. Wong" , Christoph Hellwig , Jens Axboe , Hannes Reinecke , Omar Sandoval , "Martin K. Petersen" Subject: [PATCH] [v2] blkdev: always export SECTOR_SHIFT Date: Fri, 19 Jul 2019 13:31:18 +0200 Message-Id: <20190719113139.4005262-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: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linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_BLOCK is disabled, SECTOR_SHIFT is unknown, and this leads to a failure in the testing infrastructure added from commit c93a0368aaa2 ("kbuild: do not create wrappers for header-test-y"): In file included from :3: include/linux/iomap.h:76:48: error: use of undeclared identifier 'SECTOR_SHIFT' return (iomap->addr + pos - iomap->offset) >> SECTOR_SHIFT; If we want to keep build testing all headers, the macro needs to either be defined, or not used. Move it out of the #ifdef section to ensure it is visible. Fixes: db074436f421 ("iomap: move the direct IO code into a separate file") Link: https://lore.kernel.org/lkml/20190718125509.775525-1-arnd@arndb.de/T/ Signed-off-by: Arnd Bergmann --- The discussion about the build testing is still going on, but I promised to send this version anyway for reference. I see no other header-test failures in randconfig builds with this patch. --- include/linux/blkdev.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0ec4f975437e..9c22d8bc6bf9 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -5,6 +5,19 @@ #include #include +/* + * The basic unit of block I/O is a sector. It is used in a number of contexts + * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9 + * bytes. Variables of type sector_t represent an offset or size that is a + * multiple of 512 bytes. Hence these two constants. + */ +#ifndef SECTOR_SHIFT +#define SECTOR_SHIFT 9 +#endif +#ifndef SECTOR_SIZE +#define SECTOR_SIZE (1 << SECTOR_SHIFT) +#endif + #ifdef CONFIG_BLOCK #include @@ -889,19 +902,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) return bdev->bd_disk->queue; /* this is never NULL */ } -/* - * The basic unit of block I/O is a sector. It is used in a number of contexts - * in Linux (blk, bio, genhd). The size of one sector is 512 = 2**9 - * bytes. Variables of type sector_t represent an offset or size that is a - * multiple of 512 bytes. Hence these two constants. - */ -#ifndef SECTOR_SHIFT -#define SECTOR_SHIFT 9 -#endif -#ifndef SECTOR_SIZE -#define SECTOR_SIZE (1 << SECTOR_SHIFT) -#endif - /* * blk_rq_pos() : the current sector * blk_rq_bytes() : bytes left in the entire request -- 2.20.0