Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp30837imm; Fri, 6 Jul 2018 13:21:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd8p3r1lBaN7mWeWtpFwCZgcWeZHqWbGWmy99NElmwQBvrusfixW+Rwji4W6v3l1QxXKOia X-Received: by 2002:a65:5b08:: with SMTP id y8-v6mr10344058pgq.297.1530908482610; Fri, 06 Jul 2018 13:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530908482; cv=none; d=google.com; s=arc-20160816; b=iSGgVXqhORCCurcRLZdWyF59G0CFwJPhW5426dFxwC14eN+IzIqOgm4ANeSG/Mn/Vu j4ntap87Ie0BQtNxHgKIus69aySLSLPTHOWAe3+wXr7O/vdi0zAY+A1w8jptty6ND340 YaNRQBv1UTgc8e173IAVXHScYiAAYUflT8Jn0pKKIRVaZw2ByOX6n6tYzaHUVaMHks+F 1eP1RjL+9It77erbYGM4fDe2b3CE7Ag6sPrLqiv+WF5jqOoRMhU4JD9B+SXZppZoig6N MOEZROtV+Sp3v9TP3XkS9bizsV20biJg/2CZoR4odi18mWjWMk8GD6tKo5q8LzAopHpb iWQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=C0XkJJ7qEtcQsOcdLyb5PBXqP0C342Fz5aL5h29SSoI=; b=0HKp1ml6JGz3lcdwHRtyICEyhpVsrOrINtLld1zz7sp0/j/ThwK0q/RmGIGo7wdqDJ 1syaOqMqNw8T+rbpwYdisB7u0yX28kWtGCS/3KTYerD3KwTsOdGAyHLAI6TGPYLAcGuI IuSz6pEnMH6T2ykOElB6GKlD1kvrUtCcOnoE2+Zj0elTBsPQz1sbbX284xB4wdA3vR3+ NeJT/wzIO88kC/03xntTa0JjM2NZ0EN7oSVcCZJLwnYbplM9DX51yhF6/IXoWl4iERHo QUGAVJaXPdpfoDjUa6cjyP3ekwYqwyYMPhMPP6JCy6lq3qgY7nVB7YAazg5Uv3oTVNas BmOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FhBRfor8; 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 bi1-v6si8820507plb.126.2018.07.06.13.21.00; Fri, 06 Jul 2018 13:21:22 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FhBRfor8; 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 S1754217AbeGFUSg (ORCPT + 99 others); Fri, 6 Jul 2018 16:18:36 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:37036 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754058AbeGFUSc (ORCPT ); Fri, 6 Jul 2018 16:18:32 -0400 Received: by mail-lf0-f68.google.com with SMTP id j8-v6so10720576lfb.4; Fri, 06 Jul 2018 13:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=C0XkJJ7qEtcQsOcdLyb5PBXqP0C342Fz5aL5h29SSoI=; b=FhBRfor82xUhVqfdCY9PF6QZ3+NjGx5NPKdgPWQO4CquZjXX6DpYPn8R+CuKSs6p8X TUrl4vheCJ8vMCy4T9DK7mAq5/BvF8zkkJLK3qgcFBB262XClfyxTAKRCXaitsIxoRXx hYRJpET/psYctCK4oi2TKPzmkKtND1S7w04syLuz0Jkbnkcjue5/nwKnyo6y315ncWU4 ygUv7/mtqyoNHzUpup++wEU392gHeVqNytghtnytsxPZHrOnjgwryXFzYnp5dLjERddC foZtFdcJvd06zd6beV3UxPWPWO3v96IWHRH8wT5LgAgWkjF4PLA302Sprd+Bjt49Z1YL +mhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=C0XkJJ7qEtcQsOcdLyb5PBXqP0C342Fz5aL5h29SSoI=; b=fHDCfDXRt8yLSz9Wz7+LWqcZC3dq/uLaL6PuNvwkuregSLDQRrDWcw4lzPfvsWkpAY IAnEOsOYkOkUs/o0qS5+qoSFLwnVz7gyZyCV9mtmc+UUOOFW0oSMEkfjhsRKLcVJrWSt cr4Z1CK5kJ7zDYmGXUb7NdM/OdkW5i6tgg2UR9JA1uJv0YMS9JQ7/5cr9QTqAw5ct42O eTEMTFCky8LxGV2GOQsDtILu5Xj27RH5rIbxcMXZW2Gg5LzvF3tYFV/we/CRhs0+2epj hVV7gb0OTMDdKGkDLb0wgDC9v0ZCiOANFDgJMztbVecmQn4lPYZ9eCRv+4peHVyAo3of 9MYg== X-Gm-Message-State: APt69E2zyPTOL9/Nd2MdY1ebZBfWQl3EJssLZXO3uzE5tADoWkMn+Czh EfDdMivyPw3gvzOAE1hqItObZyhSRToFRN+tV8U= X-Received: by 2002:a19:9cca:: with SMTP id f193-v6mr8204335lfe.60.1530908311203; Fri, 06 Jul 2018 13:18:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:41c1:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 13:18:30 -0700 (PDT) In-Reply-To: <47d87d9ca498687344fcb18067ffe5e7bc313616.camel@wdc.com> References: <20180706132407.4069001-1-arnd@arndb.de> <47d87d9ca498687344fcb18067ffe5e7bc313616.camel@wdc.com> From: Arnd Bergmann Date: Fri, 6 Jul 2018 22:18:30 +0200 X-Google-Sender-Auth: ZZdCRUra7upTwUJ8KEF8oQHJMh4 Message-ID: Subject: Re: [PATCH] sbitmap, scsi/target: add seq_file forward declaration To: Bart Van Assche Cc: "martin.petersen@oracle.com" , "linux-kernel@vger.kernel.org" , "felipe.balbi@linux.intel.com" , "willy@infradead.org" , "paolo.valente@linaro.org" , "ming.lei@redhat.com" , "axboe@kernel.dk" , "linux-scsi@vger.kernel.org" , "osandov@fb.com" , "jejb@linux.vnet.ibm.com" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 6, 2018 at 7:07 PM, Bart Van Assche wrote: > On Fri, 2018-07-06 at 15:23 +0200, Arnd Bergmann wrote: >> The target core runs into a warning in the linux/sbitmap.h >> file in some configurations: >> >> In file included from include/target/target_core_base.h:7, >> from drivers/target/target_core_fabric_lib.c:41: >> include/linux/sbitmap.h:331:46: error: 'struct seq_file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] >> void sbitmap_show(struct sbitmap *sb, struct seq_file *m); >> ^~~~~~~~ >> >> In general, headers should not depend on others being included first, >> so this fixes it with a forward declaration for that struct name, but >> we probably want to merge the patch through the scsi tree to help >> bisection. >> >> Fixes: 10e9cbb6b531 ("scsi: target: Convert target drivers to use sbitmap") >> Signed-off-by: Arnd Bergmann >> --- >> include/linux/sbitmap.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/include/linux/sbitmap.h b/include/linux/sbitmap.h >> index e6539536dea9..cc54b9f7ff8b 100644 >> --- a/include/linux/sbitmap.h >> +++ b/include/linux/sbitmap.h >> @@ -321,6 +321,8 @@ static inline int sbitmap_test_bit(struct sbitmap *sb, unsigned int bitnr) >> >> unsigned int sbitmap_weight(const struct sbitmap *sb); >> >> +struct seq_file; >> + >> /** >> * sbitmap_show() - Dump &struct sbitmap information to a &struct seq_file. >> * @sb: Bitmap to show. > > In many Linux kernel header files all forward declarations are grouped near > the start of the header file (after #includes and #defines and before structure > definitions). Should we follow that pattern in ? I couldn't find any other such declaration in this header, so I just put it close to where it's first used, which is the other common way to do it. I checked all of include/linux and found that you are right, a clear majority of the headers just pull all struct declarations in the front. Arnd