Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6728968pxv; Fri, 30 Jul 2021 00:28:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt4YEAVXgMfSVvgPVcoZG9xhgki37Sf6JGsKniGO1ludAwT6FuJko86SDMXPX6rMBEbWV3 X-Received: by 2002:a05:6e02:1c2d:: with SMTP id m13mr183499ilh.137.1627630126565; Fri, 30 Jul 2021 00:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627630126; cv=none; d=google.com; s=arc-20160816; b=x17QTJDn/CYyzPil7TNCTs882ffvc6q/9WgGMFL2Uy2HIrM0G+kuUR6jSx5TLdkc5u BATZF23zVt8elauyXJ0CTXrDvz7c5C7eqIVyaesPikNeIT0NXo4HJmzEhq/JK1ggTgS4 8LmJvcxoKeSRHoLzjBqCLX9DH2aWpBDj8tx0gPWO6Ze61RRPMnqFZX40dYircShjdXEW pYp0tnfiVcLe5vQKOn6JqIOv6sSZCkSHVUh3kB6IKLdwqblBDKiKsu4OPEgnq7PJxyzZ KO2Tf0RwPZslfEIZN35rNr5FsyrpGJ9dMORTdqkk5YlFSn12piveRubQeF5dalVHPPgo qpjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gPPQDNXHJzthAttDKW87ozfupCcyHaIWxr0SlW3rHFk=; b=hziG6lXNPDap5ZGw6qBk9q7LXxvpqTB8CP2+zTl6ze76OQVvg42DXNWYSYHlDqnmOZ P3WfTiMVYgPtBE/9UuMjHj5moe8f4ijcWzFXB05hqrzJE0Re2NV8YtHxIjyd8eFQL4fU B3yiCff1Cv9LZHupBT+LlVCR1ZCkLvpePn9ssU8uyIUiZMbTFsDfCM8VAVWKMLvPodaO 8QOXrMonAGJ35nH1fn+UE79ogfP1TZUwBor+73nZDDHjjfVa4jhN5LfZzJFZN45XGRE7 GamL+WRWrDrHjLIuPIpaNW0DILPUUrmGRQGBTz+YquIic4RkNraAdqgDXrzS9YVkESpc 464g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si1062232jat.41.2021.07.30.00.28.35; Fri, 30 Jul 2021 00:28:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237783AbhG3H1P (ORCPT + 99 others); Fri, 30 Jul 2021 03:27:15 -0400 Received: from verein.lst.de ([213.95.11.211]:59853 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237370AbhG3H1P (ORCPT ); Fri, 30 Jul 2021 03:27:15 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 243F467373; Fri, 30 Jul 2021 09:27:08 +0200 (CEST) Date: Fri, 30 Jul 2021 09:27:07 +0200 From: Christoph Hellwig To: Nathan Chancellor Cc: FUJITA Tomonori , "Martin K. Petersen" , Christoph Hellwig , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH] bsg: Fix build error with CONFIG_BLK_DEV_BSG_COMMON=m Message-ID: <20210730072707.GA23847@lst.de> References: <20210730012108.3385990-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210730012108.3385990-1-nathan@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 29, 2021 at 06:21:08PM -0700, Nathan Chancellor wrote: > When CONFIG_BLK_DEV_BSG_COMMON is enabled as a module, which can happen > when CONFIG_SCSI=m and CONFIG_BLK_DEV_BSGLIB=n, the following error > occurs: > > In file included from arch/x86/kernel/asm-offsets.c:13: > In file included from include/linux/suspend.h:5: > In file included from include/linux/swap.h:9: > In file included from include/linux/memcontrol.h:22: > In file included from include/linux/writeback.h:14: > In file included from include/linux/blk-cgroup.h:23: > include/linux/blkdev.h:539:26: error: field has incomplete type 'struct > bsg_class_device' > struct bsg_class_device bsg_dev; > ^ > include/linux/blkdev.h:539:9: note: forward declaration of 'struct > bsg_class_device' > struct bsg_class_device bsg_dev; > ^ > 1 error generated. > > The definition of struct bsg_class_device is kept under an #ifdef > directive, which does not work when CONFIG_BLK_DEV_BSG_COMMON is a > module, as the define is CONFIG_BLK_DEV_BSG_COMMON_MODULE. > > Use IS_ENABLED instead, which evaluates to 1 when > CONFIG_BLK_DEV_BSG_COMMON is y or m. > > Fixes: 78011042684d ("scsi: bsg: Move bsg_scsi_ops to drivers/scsi/") > Reported-by: kernel test robot > Signed-off-by: Nathan Chancellor Looks fine. Although I have a larger series pending here: https://lore.kernel.org/linux-scsi/20210729064845.1044147-1-hch@lst.de/T/#t that should also fix this issue as a byproduct.