From patchwork Fri Jul 19 11:31:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 169242 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3734554ilk; Fri, 19 Jul 2019 04:32:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZTMr6ZGCV8+AEAGqD1/YuO/LEo45IxF1N6yWVIYAkgpfMDA3OnM3mo8dTZSF+Y+NsTtb1 X-Received: by 2002:a63:1455:: with SMTP id 21mr10175127pgu.116.1563535939470; Fri, 19 Jul 2019 04:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563535939; cv=none; d=google.com; s=arc-20160816; b=TnFqG6PE0cHaNkY5oIfbf2ydAPZg+6azIN4noxSO9OJgAJS7DrlvzpIUBWTYXvcXO6 6imTnpdy8gilSLvBKRrBTWZyn2m8ht7h9xu18BaAVGiZyCbzzNZMpFp2E5l6e2pBzSwG fKxuuLR6omaVliMRMZwG67G6JTIFOS2aSvGCQWhXIjRxwoa6P7xqRYThFGOpguAgeqlY 0Y15DnC986TXPiXkomPGlBDl8V3jnBtTfXKWWlSvVw7l7s3mYpPQ7r69s9hXdA7AX15Q f2Kob9ekRlEZiMDLbGU827+JX5VVe1QpmTbman+11J18Sq3/GiprWqM3hHriZiZace5I uzgA== 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:mime-version :message-id:date:subject:cc:to:from; bh=Cz9SkGlPSLYIAwU6pIyeREeTLAuOg3LVFzm7GHbJmb4=; b=W9SJSmMcw4+CJeQZET+bBeLVEcURHuN7sP0USISfiqIDdD2Xc0NdqjlFgrVXP61OMc 5pXZQOsSOi1fMfih4R2AhyHU4TGSX8+L0rWWY25rEjFyd5o0s92dhrZWTID4SoR67yDY zCx1sFu8L3ZdI2jSct6SypUbZukZWZpy94xlHhx7xvGAPe2WZVjL3AWDDqywzjESsOe1 hkP3CHf0nBSydX3Lqa8c+H//DafR/GAyz0FDaNyDrknHfGjvaRsQCQhX+pZ2BwqahiAq 2WjXgP7qH5/0j7prfolohR4C1ezW7aQwp4pme67nLnH9o3PspbPML5Et1SU7PrmWgpR+ MAlw== ARC-Authentication-Results: i=1; mx.google.com; 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 l64si1223996pjb.93.2019.07.19.04.32.19; Fri, 19 Jul 2019 04:32:19 -0700 (PDT) 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; 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 S1727618AbfGSLcR (ORCPT + 29 others); 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 X-Provags-ID: V03:K1:Vmcxqz1+zEC4Gz6MD7qxPE6OvaMIZxoiZywAbPjeNNR5AZUtT2+ +rfnevMk1EgxsXJurkbh8MjLDWrZ8gHLODetIapgvkq3WJuzsanCjfwpsdc6I7UAoPODYST e4CuWsI1cWg7chal0vqGKqISZAJxF4wt5wFpeZ2T83pN61CdvHkanJUFplVU/HEI+KiI6IL 3NNUfLtBMCGVeMMdNsADw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:rxjEIKNOxbo=:3knNSkYGwlgeMBNhwhifSm jilkYZ/AJkClQOMIzvdln5LqT6DE+j9D3SjGQd6LdxsaeX44E29Wp6QQS205jpY5o9F1bC8tk MG++tt4QoT1gwZPNgNI3o3PTeLwXLcNCvUS5F0+WHIyXdmtVLvQsToa/JUoAs02Pgczc6ngIv fBqqsV32a+DrgnIZBxz61S6Zs0LHkUXGduH1DFjyUOr/a0U+9BqsH1OHCSsFWpZsD5D/AcDs2 6PwEAikML8CdlwNQ9MepTYknmmePDWpN/TDfwBgCvD/8aEZuRFz8cYY5GYdjCTAVHJK+CqeEz A8PLpSBllLsqSgLweMKVAZNjOA04yeJU3gluqToGzBSlMJ21AbXJAf6S7RF+C4sOGbzrqKwTu DZjA50LTI9Z9fH46VUmxt1i/f8cAA5PLz19z4q0bz0Zpb4CpgcdbR6ssbUec6MbejQ+vqqMZr dqRQOkuz4iue1VjiVISllaBCGnpm5XwPGyNeFUfWyiYkkUXRsFQqLn4JsvpeS/fgMOtMfuyTQ DhyGW+/7Ajtwe2ME/+vpZ3bHRZevJKX7V8+gcc0/sO7usX8qfXPaXq72ZITw1nxK/vYHqTdzX HzWORafEMdGaFzxV/iSnpntcsIIY04kjL62jZZ9WiDPqNwhkuBLEJWIhvbOrGZrao7NgdkmIt KY5OC4vJKHLDUIxPbXXg62JeiypBO+8VWpBdpbOCuXCxGKlR+cPYjAkZ8PByQUQthJAkcGL0I dNY3ATK0ZuCfuy3vpMw8aP2woWfopPmK8+jaJA== Sender: 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(-) -- 2.20.0 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