Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1132794ybt; Tue, 7 Jul 2020 08:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrd9UYQdJbWyixcnVsmBve1f98OIFOiSfS+MDOL5Q1s6odJGSs4SaSdYGqXs+DNJFGPFsP X-Received: by 2002:a17:906:b2c8:: with SMTP id cf8mr47982286ejb.132.1594135746150; Tue, 07 Jul 2020 08:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594135746; cv=none; d=google.com; s=arc-20160816; b=ROxlIdq/ugW/WQqHJegZWMZHSxjcM2GQmG79rSisGtnaPV80HX0nU0p509Sy92UGOh euKe+c9NbvI6LQsrL0lZUeiAtjhL23MUrXAEi9B3mw6buc5FvySseyjF+psqxJiDGu/1 VoEeAXA2GiTTKg+9cGEln8TkBZqrPJ6SmhZ+DEHbPWFOWf4wAJxXl7NyNglubXZIK1j4 X6BuFbBbcRUezSVEXv2BVf64U0nIKScufqYz4fKGZf3AoaKhYAGI3nU5rIbGRC87HhM7 /ZxdDFwj9nAK3JuHzL7QocEzS8Ac/eUz4G8t/w7iIm4JL028n+3/9k1RoJDVTXG8u+De cqzg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nuttS9PAMcSBibrYM1b37185B7M7w8tk2NcjyYOTJJs=; b=qRcLedUrfYM6iFvv/EgOKYUrcAjGEH/8WQBKZiVKgkSZmnoFT0h7faAMyTVsKm/EMZ gBwPijojJCySLJQwpio2M12oICNJmI3OHJRvAtuJ3RJDovgyt/WPG+USUrzlH01j/0/A 1j17C8qjKDCVWrEOqxxsSuVDf6kw9Tt2on+oLfOguKdM1wAZbJQiZASAS5c0vWdVsMs+ JktI4u5lHom7QUM4Jssjdg8Vl8/oi3Y4NaJ40OG3m2wgTFDhCDvDLkRoU9M8pvPLJnu4 9gDbOPYMLg8eoK14AAiJSGCOnk+4xcgfL5n3Qbf+VVjBmb5n+P4te1zJi5kTu63H3QcJ sIgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jmtS064g; 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 r25si15727452edo.46.2020.07.07.08.28.42; Tue, 07 Jul 2020 08:29:06 -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=default header.b=jmtS064g; 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 S1730240AbgGGPZn (ORCPT + 99 others); Tue, 7 Jul 2020 11:25:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729802AbgGGPZi (ORCPT ); Tue, 7 Jul 2020 11:25:38 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1159A2078D; Tue, 7 Jul 2020 15:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594135537; bh=m3Bg9p0WjwVIantLqzPG6EBi0zosw5xGhOVnfB8M3xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jmtS064gYluHYTJm5gdzxEIJIdr2QNu6yEJoiUoDUdlTkAJLNGSmH1OlZ51hYJfo2 SYSzwllWBcOGXABBNEvexNz6Fk7lk1fB+VXtZFER876DBV4bAuxR2+CYBIVpIdq9eN nEforVnespfYIFeL90gsTx9COjy1LLR7CmvfjGq8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Andrew Morton , Miklos Szeredi , Al Viro , David Howells , Linus Torvalds , Sasha Levin Subject: [PATCH 5.7 080/112] samples/vfs: avoid warning in statx override Date: Tue, 7 Jul 2020 17:17:25 +0200 Message-Id: <20200707145804.800466959@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200707145800.925304888@linuxfoundation.org> References: <20200707145800.925304888@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook [ Upstream commit c3eeaae9fd736b7f2afbda8d3cbb1cbae06decf3 ] Something changed recently to uncover this warning: samples/vfs/test-statx.c:24:15: warning: `struct foo' declared inside parameter list will not be visible outside of this definition or declaration 24 | #define statx foo | ^~~ Which is due the use of "struct statx" (here, "struct foo") in a function prototype argument list before it has been defined: int # 56 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" foo # 56 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4 (int __dirfd, const char *__restrict __path, int __flags, unsigned int __mask, struct # 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" foo # 57 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4 *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 5))); Add explicit struct before #include to avoid warning. Fixes: f1b5618e013a ("vfs: Add a sample program for the new mount API") Signed-off-by: Kees Cook Signed-off-by: Andrew Morton Cc: Miklos Szeredi Cc: Al Viro Cc: David Howells Link: http://lkml.kernel.org/r/202006282213.C516EA6@keescook Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- samples/vfs/test-statx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/vfs/test-statx.c b/samples/vfs/test-statx.c index a3d68159fb510..507f09c38b49f 100644 --- a/samples/vfs/test-statx.c +++ b/samples/vfs/test-statx.c @@ -23,6 +23,8 @@ #include #define statx foo #define statx_timestamp foo_timestamp +struct statx; +struct statx_timestamp; #include #undef statx #undef statx_timestamp -- 2.25.1