Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1444719rdg; Sat, 12 Aug 2023 01:13:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGP2rcOK9WtQbiFMN2TaXbB0fj7I5dNzcDEEYzUY+LGoJ9zPwBJckP7fllm0kU4rHKu71OJ X-Received: by 2002:a19:f819:0:b0:4fe:1b7b:3cc9 with SMTP id a25-20020a19f819000000b004fe1b7b3cc9mr2618220lff.38.1691827986229; Sat, 12 Aug 2023 01:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691827986; cv=none; d=google.com; s=arc-20160816; b=ejxVRe488QWTxlPPvHo4Arxj7GfhkgvYJW406A3p00+wtG/W/i+IILt6liwbwEbQ/c AxSA+kZ/dKy9d2wZIb3r07yDSV660Bk+kKHbvcRMULgSgVqYvIV/U+ylsleycek9M/aF ueVz5lJDu7GClGwKACD3rhOybqIkKeRCCzZAUKVGHlyZk5p2P2qavAkbZDATsmZzMy0L ME+FSRU30kGGJzuD+JAOhmfJ52Jy0w45YfclEn7iAknMOpJa9AyTnKNiOJcBwt1HvtpX 9r+nRALGxbHOP3iH/SR4GroYysHMGYCW0ZhzNhU6/uCTV222Vi8mvDgG9nHxo74hxVqt ZRkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=1R5ctzAAcNQB2V3jKP5T5hiyB+DhvFuEPACbmvPmK50=; fh=riRD0jRNayGHFFlMFwQ9DEn8anzdvXEgwAsT1ARJgpY=; b=AyicQyGhcuOWzLLi7EpjdOo8b8s/fCoLL5XEUIV4uuwSy+0BOpu0E79pjtmzG+y8qS 7Plcvhk3yMxALi7wfEqLJ4f6ZT/TmXsf9FIftC+cqy/o/xxL57HaoIXEr48fPpXKJ3pa LP32sU1XCPC7l2u2yen+FhGPrU9R9HcoUf3UO+gDyYcZnjdjXK/y1IbbsQkPKdYILK7k vrpQwWGMFgEpUw27z4oGg+kIJ3g0IWWo3IZtAkhmOIHyh8BG8iqGBFB8mpSLL3DTPbrM hfvO0y/eWir6JorZcEm/1+AT6RsbOMCdd7yRyp9BBVqBuaL0rukYypkzK72zwAROXolX k4hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=nutKGvY0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=diWSONk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c25-20020aa7df19000000b00523d17c2095si2175079edy.479.2023.08.12.01.12.40; Sat, 12 Aug 2023 01:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=nutKGvY0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=diWSONk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234277AbjHLHqe (ORCPT + 99 others); Sat, 12 Aug 2023 03:46:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjHLHqc (ORCPT ); Sat, 12 Aug 2023 03:46:32 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF33419A4; Sat, 12 Aug 2023 00:46:34 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 208215C0107; Sat, 12 Aug 2023 03:46:35 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Sat, 12 Aug 2023 03:46:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1691826395; x=1691912795; bh=1R5ctzAAcNQB2V3jKP5T5hiyB+DhvFuEPAC bmvPmK50=; b=nutKGvY0eL724xeuBxbBKl0Lec4UQ/Xr1efX8oPnh3bNyR0UoNO v9Q12UKvjSXBbu1l17dDf0VeRYYb0vXDtpXo+AhMNW17vQtsq/L75I7dqtD19i0N P2ntguCjM5MM5W0/YwsFakxFRPMgy6XlaEG0LWeJEDrFEA9qQSznAvNUZUs4FcQl u1KIoMb6ZAn1VXGb8/MFetNgd1tsG3uefwtHIyOPFoGuUqIdHJvyXo82DM5U5I+x SPfb5zRu50Gk1rEvEQqHRDYprHdMe/b7Ve1FKBVrNBpX+174T3eSodjhwVRxQr+q c5l3rdBpbLYcpZEg9Ol1rHUpmPW5dpzQw1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1691826395; x=1691912795; bh=1R5ctzAAcNQB2V3jKP5T5hiyB+DhvFuEPAC bmvPmK50=; b=diWSONk0HiGIuLezERYrIYMjKKhl3BQP8CTGfYdlqm4QtJLGRCv PVGdgm7W7PrF92/cjijSeY/GwmlJoby0jMMcilXK0FDsjx3hQpnBkLTPgwxpZJ+8 Rms2gABVgt74xlWLBeh32YC5FAFJhTwGwxXiaGscO8F4aeCzB79rfxBSdKu95G62 0bOtEeKhGJr4tnc+AszIZCae7zHYXbYdE/tAx+NuCWDXAT9+b4rDI6hUl+YuKTPE DUkZb7Jm5s5UIELgg398zJrI1ehkCOpVgKk0t1wu85St3q90PMrP4xayfvVmfxvB +mq87fa4hw3scj5WO9Ui/nn56oPhDcKaGTw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrleelgdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeegfeejhedvledvffeijeeijeeivddvhfeliedvleevheejleetgedukedt gfejveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E936CB60089; Sat, 12 Aug 2023 03:46:31 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: <3a1c5033-5ce2-4d0b-91be-3b612512f53c@app.fastmail.com> In-Reply-To: References: <20230810141947.1236730-1-arnd@kernel.org> <20230810141947.1236730-16-arnd@kernel.org> Date: Sat, 12 Aug 2023 09:46:11 +0200 From: "Arnd Bergmann" To: "Masahiro Yamada" , "Arnd Bergmann" Cc: "Andrew Morton" , linux-kernel@vger.kernel.org, "Richard Henderson" , "Ivan Kokshaysky" , "Matt Turner" , "Huacai Chen" , "WANG Xuerui" , "David S . Miller" , "Alexander Viro" , "Steven Rostedt" , "Qing Zhang" , "Donglin Peng" , "Qi Hu" , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org Subject: Re: [PATCH 15/17] arch: fix asm-offsets.c building with -Wmissing-prototypes Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 12, 2023, at 00:12, Masahiro Yamada wrote: > On Sat, Aug 12, 2023 at 3:30=E2=80=AFAM Arnd Bergmann wrote: >> >> From: Arnd Bergmann >> >> When -Wmissing-prototypes is enabled, the some asm-offsets.c files fa= il >> to build, even when this warning is disabled in the Makefile for norm= al >> files: >> >> arch/sparc/kernel/asm-offsets.c:22:5: error: no previous prototype fo= r 'sparc32_foo' [-Werror=3Dmissing-prototypes] >> arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype fo= r 'foo' [-Werror=3Dmissing-prototypes] >> >> Address this by making use of the same trick we have on other archite= ctures, >> renaming the unused global function to main(), which has an implicit >> prototype. > > > main() only works for one function call, but > there are some cases where splitting the code > into some functions makes the code cleaner. Right, I went with main() as that is already used on a couple of architectures. >> On loongarch, there are many functions in this file, so the trick does >> not work, adding explicit declarations works around it in a slightly >> more ugly way but is the best I could come up with here. > > I do not like repeating the function names. > > Could you try "static + __used" as in > arch/x86/kernel/asm-offsets.c ? Sure, that should work, I had not noticed x86 doing it like this and I agree it's slightly nicer. In this case, Thomas Bogendoerfer already merged my patch for MIPS in 6.5. The loongarch file I change here is a copy of the same file, so we probably want them to stay consistent, either keeping my change for now, or reworking mips along the same lines. Arnd