Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B6CAC64EC4 for ; Fri, 10 Mar 2023 07:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229597AbjCJHdw (ORCPT ); Fri, 10 Mar 2023 02:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjCJHdc (ORCPT ); Fri, 10 Mar 2023 02:33:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAD07A17E7 for ; Thu, 9 Mar 2023 23:33:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 522A7B821D7 for ; Fri, 10 Mar 2023 07:33:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90791C433D2; Fri, 10 Mar 2023 07:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678433608; bh=Kx+BDe1jj2PQd4Hhf9JwHAB9M6lZZP0d/puti5RVhkg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FXjkydKXM2fguL5Y+8/sZLV63Z6kZD5KpAEg1VmSgMXHgKakCEctq5LB7RwZBmpIS gDKvfniBZ0Lbbwiw/II73bA+W/Xn7ZypsSpDKp6fI4tyKbO0c0x5ztYfCP36VkqwC9 5wBczJWJJaok2keaiSkNxXQhz+LIotTw4AAOJAh4= Date: Fri, 10 Mar 2023 08:33:26 +0100 From: Greg KH To: Vincenzo Palazzo Cc: x86@kernel.org, luto@kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v1] x86: suppress warning generated by W=1 Message-ID: References: <20230309174854.350143-1-vincenzopalazzodev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230309174854.350143-1-vincenzopalazzodev@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-hardening@vger.kernel.org On Thu, Mar 09, 2023 at 06:48:54PM +0100, Vincenzo Palazzo wrote: > suppress unused warnings and fix the error that there is > with the W=1 enabled. Why are you building with that option enabled? It's not a normal one at all. > > Warning generated > > arch/x86/entry/common.c:238:24: error: no previous prototype for ‘do_SYSENTER_32’ [-Werror=missing-prototypes] > 238 | __visible noinstr long do_SYSENTER_32(struct pt_regs *regs) > > Signed-off-by: Vincenzo Palazzo > --- > arch/x86/entry/common.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c > index 6c2826417b33..8f17b2c3e9de 100644 > --- a/arch/x86/entry/common.c > +++ b/arch/x86/entry/common.c > @@ -234,6 +234,9 @@ __visible noinstr long do_fast_syscall_32(struct pt_regs *regs) > #endif > } > > +/* prototype is a placeholder to suppress the missing prototype worning */ > +long do_SYSENTER_32(struct pt_regs *regs); This feels wrong, sorry, and you have a spelling error in your comment. > + > /* Returns 0 to return using IRET or 1 to return using SYSEXIT/SYSRETL. */ > __visible noinstr long do_SYSENTER_32(struct pt_regs *regs) It's wrong because look, you define it right here so why do you need a prototype? thanks, greg k-h