Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1266766rdg; Fri, 11 Aug 2023 16:01:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEETPNR2Hbctzb7rwXHQvS2t+Ou6jEf4Q+W7surG0RhXHjHY0+J7IkyRDtI5joN3Bfa62s X-Received: by 2002:a05:6a20:8406:b0:140:ef2a:9b75 with SMTP id c6-20020a056a20840600b00140ef2a9b75mr3687366pzd.61.1691794881904; Fri, 11 Aug 2023 16:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691794881; cv=none; d=google.com; s=arc-20160816; b=E2+DFHJmb6ZT3dN6kr4vCwBsKGYaDwvh+59NjIQQ3cI/UdiKI2tpF0hq4sS0Wh5gWf xUOdAJuWI8CkZfTDIEIExdrxlPk7oMb6c2/3g7YhRC6r3FlDBrXm0hLU86d8hfkf+dva DcxlpFLMjgyqNc7vlzvv4ss7cYCVaJS6j/8wEQ6Yjc5Rxtyi7sbO/XZnNnlLuuvzsvCF OkgaLTIGlH8zUaRV/7QzUkZZen5a1J5EecdHU5TN5YXDAYgsZ26zFMj5q+3N1YG5MdZ4 mkOWCCMw9Uu/yNIg2GqJQTXEtPwuvKQqYXqYP8ZbWtV53McR8KBcKRIJ5vhqT9LLBvp8 rrOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ztw9IXTA9/o6jaHf5DITJvd7l5VINrbwaZzjvo3d3O0=; fh=WZ33d4Cr9XCtzd4C7ryW4++d6JzRkZL07dkzi2rDI6o=; b=xk3/WsHatL1YK+ZVdr9oEUmE9gu9k0338V05vyCx7HEkmLCwGrbszj06EZmS8UwMGx QGga34Oy3Q8rNVrg817/lENFiyYI1BoKVDhsDpHYkc/wT6fu9K2h0zyQFGLvoFkyUBI/ CMFTdPIJ6Cua5UFXU7Ilzso613X9hJ0o84oi2p3jVxF1P8EAlE/5MbBmzWpFyGXxL9FF g6o7nX+O4l4ZGM5YOIuSkqMzx9K4ZrgTZR23Dw7kgc4QTpKUe48aUQ/vRShAKsCzQHNh zLYJ5sem5tKlg9WRuBC+31i7zh1OOQvwFWO4PHb9wVeaG8XW9M5x+9Tpiy5OLhjWNw+G cA3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlZQbnZw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a170902ec8200b001bbd0358ef7si4114360plg.518.2023.08.11.16.01.06; Fri, 11 Aug 2023 16:01:21 -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=@kernel.org header.s=k20201202 header.b=VlZQbnZw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236139AbjHKWMz (ORCPT + 99 others); Fri, 11 Aug 2023 18:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233506AbjHKWMu (ORCPT ); Fri, 11 Aug 2023 18:12:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3C5F2D57; Fri, 11 Aug 2023 15:12:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90EB0671D7; Fri, 11 Aug 2023 22:12:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED1C7C43391; Fri, 11 Aug 2023 22:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691791969; bh=ztw9IXTA9/o6jaHf5DITJvd7l5VINrbwaZzjvo3d3O0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VlZQbnZw09wcQ44V1aBYNpiCQsw138Dcl6b112zHVe5BIoN3dvVeGdcgU4Rgh1539 Po6S35ZNC3Yl5WChH5pjAk5YBd4GkFY1TdIu3kS997MjPh1zxSV5L4owq/fQZJFtKY BFMWwatlZ8USddyC+1WtcWYnc6eMqCNGJu/uNLo8UWxPGDx/ZNhxKSrKr1eVkSdqlX aEp6X7OfW5fsJpsmoOPI024cDbv625iJ03+l4nQxYdlI/9nEi55L8zpS/Q5+VaEjCM bC48iKpO5Zqy6Nz0CdKnQAXZireCptH0kTr8ndtba8Xp373/NoTeXHIiwV7CI9A24X SuDWJ0ghQBcvg== Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6bca38a6618so2231660a34.3; Fri, 11 Aug 2023 15:12:48 -0700 (PDT) X-Gm-Message-State: AOJu0YyV9aRFgF4SZEaX7wA3rV1CVxU/lPB1cM2i5IB6KkroxB3UPeQt oSB283UWAzWGFejwUmKlke+uURgYcfS+CRZBkUQ= X-Received: by 2002:a05:6870:82a4:b0:1c0:d0e8:8ff0 with SMTP id q36-20020a05687082a400b001c0d0e88ff0mr3207005oae.17.1691791968250; Fri, 11 Aug 2023 15:12:48 -0700 (PDT) MIME-Version: 1.0 References: <20230810141947.1236730-1-arnd@kernel.org> <20230810141947.1236730-16-arnd@kernel.org> In-Reply-To: <20230810141947.1236730-16-arnd@kernel.org> From: Masahiro Yamada Date: Sat, 12 Aug 2023 07:12:12 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 15/17] arch: fix asm-offsets.c building with -Wmissing-prototypes To: Arnd Bergmann Cc: Andrew Morton , linux-kernel@vger.kernel.org, Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Huacai Chen , WANG Xuerui , "David S. Miller" , Al Viro , "Steven Rostedt (Google)" , Qing Zhang , Donglin Peng , Qi Hu , linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 3:30=E2=80=AFAM Arnd Bergmann wro= te: > > From: Arnd Bergmann > > When -Wmissing-prototypes is enabled, the some asm-offsets.c files fail > to build, even when this warning is disabled in the Makefile for normal > files: > > arch/sparc/kernel/asm-offsets.c:22:5: error: no previous prototype for 's= parc32_foo' [-Werror=3Dmissing-prototypes] > arch/sparc/kernel/asm-offsets.c:48:5: error: no previous prototype for 'f= oo' [-Werror=3Dmissing-prototypes] > > Address this by making use of the same trick we have on other architectur= es, > 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. > 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 ? -- Best Regards Masahiro Yamada