From patchwork Tue Jul 25 13:48:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 125630 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2488030vqg; Tue, 25 Jul 2023 06:59:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlGiPS1uSjZDx5ViRkBOzS2Hirl1j0KQr7WChe6l2GO/BkRLKTHSnJkOSrOezpQwXEu71a6I X-Received: by 2002:a05:6512:3242:b0:4fd:c762:722c with SMTP id c2-20020a056512324200b004fdc762722cmr7074031lfr.19.1690293546629; Tue, 25 Jul 2023 06:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690293546; cv=none; d=google.com; s=arc-20160816; b=Ix0144YjCFh3BjQ5DZI93icza3MrWqw+/sHaimnS6bhjPy2mCuRWjGeJXc52rCoHmn AiwW6wjvMBO19NKjeJHNiYvlSGO3uDU+KO+2cxL8pDISchw5gob5PDYwY6fZUmPY7tVC YwBpJDLycIc6qa8E/khU3TxQAySnnDXBKo1BSDfNXVUubpJszaMNexkYA8ENMYdI5/mC TGdNqg00tcKjJ1+dIxE6fcPFaZdNgMjsuyoMB56Y3Z5nSPSKSE0xDngd7gC/LX01pgVq WAHUjxdgpuCyxtZuitNc+zJ1SOtgkypNwNLEdPdeXvFqwP0Px5Sj424Or/U/oq/Kfesf 5g6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LRhsHgUsRHK8N/Uf/5iQjmoXkEzplKU7aLwK1K5jM3o=; fh=R523ZnP4N7O48iGEbgKYBfM0eoofLeWRxo/bWq35Los=; b=lal480i+EIh+WYiZagEXRXb2pppTvwRkeA7sykJ94zirXYsR3c3Kv+lmsg/feoaPhS 7z3Evrp7xU+k9F9lHdC22tNTsCo2TGoqFMg1OZ9nH+z5j68zXUQk+BA+WwmS0Roq5wvH +JQX5VS5GykXomj3lmqXnDmo/Q5pvJM/mbGxfey2ytP3FeEBD1yRMzVVKlBwzeqPR+ZH VkD2N7vLJ8QANIA1IN5mE0Oti/Cs/a+1w3aveYkslIT9R9TiY6hPtWyJySU/nGYBAgxv YEJP9n+PzPUMSIB0/XO2yOfEEmjUarZD/hneTZZRGmpx/BJC70fw0jlkxSO9hDYjoTo3 NRdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E5EJ5sFE; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d24-20020a17090694d800b00992bfd00fdbsi7785920ejy.971.2023.07.25.06.58.40; Tue, 25 Jul 2023 06:59: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=@kernel.org header.s=k20201202 header.b=E5EJ5sFE; 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 S231663AbjGYNtP (ORCPT + 99 others); Tue, 25 Jul 2023 09:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbjGYNtE (ORCPT ); Tue, 25 Jul 2023 09:49:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F241FF7 for ; Tue, 25 Jul 2023 06:48:57 -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 7A84C6170C for ; Tue, 25 Jul 2023 13:48:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E522C433C9; Tue, 25 Jul 2023 13:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690292936; bh=rn5AmJ5E/u7lh73YUSkNYYV834iPfRhN7MTY5kuEYCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E5EJ5sFExzL+l6ZHXgg7hLHU7rqWQA/ZT1COpzpppHrOGcDkiH6orSN/Rm9g/Rspz X+mTZwvX7S10EtizGzoOqonpuVw12/qXHokPsgiyabe1j0THXHLqdkkUguxVBaUbPJ 9gzfJh2FG3ThHGVj/PGS+eB3U2V9/vnIICo2dpFUBZ/q8MnRtu2pGNNoIoia+2+eqS OG8ETn9mz2HduZMTeoiRW54UED6y2Ewu8T8bcZ7tvmT3cCkaxBv6JfJ9A2CScDc6xS ZFv0SlajI3hptFRrcSxspED7h8hLREWIa28NpE4guqJF91O+vmUmPyjibDxPS0GEoo QdjeVM1AmT3yw== From: Arnd Bergmann To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH 4/5] [RESEND] x86: purgatory: include header for warn() declaration Date: Tue, 25 Jul 2023 15:48:36 +0200 Message-Id: <20230725134837.1534228-5-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230725134837.1534228-1-arnd@kernel.org> References: <20230725134837.1534228-1-arnd@kernel.org> MIME-Version: 1.0 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772401246036650773 X-GMAIL-MSGID: 1772401246036650773 From: Arnd Bergmann The purgatory code has uses parts of the decompressor and provides its own warn() function, but has to include the corresponding header file to avoid a -Wmissing-prototypes warning. It turns out that this the function prototype actually differs from the declaration, so change it to get a constant pointer in the declaration and the other definition as well. Signed-off-by: Arnd Bergmann --- arch/x86/boot/compressed/error.c | 2 +- arch/x86/boot/compressed/error.h | 2 +- arch/x86/purgatory/purgatory.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/compressed/error.c b/arch/x86/boot/compressed/error.c index 5313c5cb2b802..19a8251de506a 100644 --- a/arch/x86/boot/compressed/error.c +++ b/arch/x86/boot/compressed/error.c @@ -7,7 +7,7 @@ #include "misc.h" #include "error.h" -void warn(char *m) +void warn(const char *m) { error_putstr("\n\n"); error_putstr(m); diff --git a/arch/x86/boot/compressed/error.h b/arch/x86/boot/compressed/error.h index 86fe33b937154..31f9e080d61a8 100644 --- a/arch/x86/boot/compressed/error.h +++ b/arch/x86/boot/compressed/error.h @@ -4,7 +4,7 @@ #include -void warn(char *m); +void warn(const char *m); void error(char *m) __noreturn; void panic(const char *fmt, ...) __noreturn __cold; diff --git a/arch/x86/purgatory/purgatory.c b/arch/x86/purgatory/purgatory.c index 7558139920f8c..aea47e7939637 100644 --- a/arch/x86/purgatory/purgatory.c +++ b/arch/x86/purgatory/purgatory.c @@ -14,6 +14,7 @@ #include #include +#include "../boot/compressed/error.h" #include "../boot/string.h" u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(".kexec-purgatory");