Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6557288pxv; Thu, 29 Jul 2021 18:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhnVL5sKWL+hfQKR5vr4EExN0Xe/aMXmCIkMcbnAxgxqPTopvLmo6OPfPPHZzURjposeGD X-Received: by 2002:a6b:b883:: with SMTP id i125mr196094iof.104.1627608240683; Thu, 29 Jul 2021 18:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627608240; cv=none; d=google.com; s=arc-20160816; b=cGdFnOojT7Co3M0YJj5rkIlqWZ9xIqxSGcqbMwaGAg6ZjWgdoWO88kj86UUK+VB3UM RTeTXWVJ6rXg6q39f/nTYT5mjfWcO0ZK/tsbFHZMQ8sNQzvkw9H0mH6E0tTZzsBnTbxO 1YQyj95XFldT5lypQQeMTXoKVxlZsnIiQ9cwQSsOVd8zqMy0au5q+xk+AQuaq3tlKC/8 FbgLIA0EEu6QPgONS3CTjjIIwbWgKWtUIA6r2+5an2TNEW+29upWHXUv2qH7BrcPYvq8 eGZ7XtCwLHqW235MZhyXseBS5ge48ksGEpwzRWptEsKfViGYqWyhmzpan6iGOX2PfM9e iOiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RxbfOsB/I/g+SWcquuLJZHiOuOOPgahDG6s5pE6KkwQ=; b=SjRG0hZZ3dYVGca3vdauhopkqNGA8JlEYmeHzYLRq+d0/K+B+/Fw/ozxL8Kno/1S53 dlCGyXhKUnYQN0wparZmR5L5NkH56OmurriwHrYObrVcHF4NU4LxKTMdhWzNvL/uEyQX A6R58GkB7Jhtzgr+mrx9Fs0gv9aV2yOjTwcBXSujTNTqz7GBBTfuNTvVZLVLkZRrLzem kurqitB9mo38Rr78k1jxY9c8xlnrnIjTg6pgpUgKdJ//P3nsNihbTpz/z3eNQA02EC8A 9J3P0hzos5l+hGbLPuDxhHud9TOggfsPKBYgxEk9GzNxHd2Xl3+kiFJs/e3RoN6ju852 0kXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mPkRXG4b; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k14si5340363jad.34.2021.07.29.18.23.48; Thu, 29 Jul 2021 18:24:00 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mPkRXG4b; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233890AbhG3BVb (ORCPT + 99 others); Thu, 29 Jul 2021 21:21:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:43408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233855AbhG3BVa (ORCPT ); Thu, 29 Jul 2021 21:21:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E582660E09; Fri, 30 Jul 2021 01:21:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627608086; bh=KTh+1SvWGrqaP3ZzUAM76b2+rrCHeZnuYTqbOR/wQI0=; h=From:To:Cc:Subject:Date:From; b=mPkRXG4bstZLhu+l0/gTAZuS7sV0j9IQMW/fWBVg3OSMwJmOZ9FOLPaUAmEUmAcrA yw4UIS2GrdPScRxDxYqm9lJz/fXnl3wNn9VGGo4HHzxg129/qL0poB9Cx+eqZGjwXR ia/v+oqk6hE30NlIdKqjPbnmLtfAwKohIf//cLuxidSQVdHP1WJCo9TdhjxkJupOyr p7TUdBQH9orIC6FlC8HQZCEgHuWHPGgNW6kNY8ic3CpGmqiLMyZ5261ls3T12n3SWq 7PMHjGm7kELpkQyS3q4o8jZhGY7mN/D+jS57Sof5k+I/q7KWrNUIbla/ObLsN9q777 wGgP4za1IkVKQ== From: Nathan Chancellor To: FUJITA Tomonori , "Martin K. Petersen" , Christoph Hellwig Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , kernel test robot Subject: [PATCH] bsg: Fix build error with CONFIG_BLK_DEV_BSG_COMMON=m Date: Thu, 29 Jul 2021 18:21:08 -0700 Message-Id: <20210730012108.3385990-1-nathan@kernel.org> X-Mailer: git-send-email 2.32.0.264.g75ae10bc75 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- include/linux/bsg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bsg.h b/include/linux/bsg.h index b887da20bd41..9602ae3ab01b 100644 --- a/include/linux/bsg.h +++ b/include/linux/bsg.h @@ -7,7 +7,7 @@ struct request; struct request_queue; -#ifdef CONFIG_BLK_DEV_BSG_COMMON +#if IS_ENABLED(CONFIG_BLK_DEV_BSG_COMMON) struct bsg_ops { int (*check_proto)(struct sg_io_v4 *hdr); int (*fill_hdr)(struct request *rq, struct sg_io_v4 *hdr, base-commit: 08dc2f9b53afbbc897bc895aa41906194f5af1cf -- 2.32.0.264.g75ae10bc75