From patchwork Wed May 17 13:19:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 95267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1154719vqo; Wed, 17 May 2023 06:57:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ626DQzMSeDy8OuMSty5s/1T0EBGYliQKbfYBVf2ocMtrYykR4m0b4yELph31vXhnczt1Xt X-Received: by 2002:a05:6a20:938d:b0:105:b4e:ed71 with SMTP id x13-20020a056a20938d00b001050b4eed71mr19690317pzh.32.1684331830676; Wed, 17 May 2023 06:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684331830; cv=none; d=google.com; s=arc-20160816; b=OBfiVx38DX+b9Pd1/3Z9MxMLos3+FKuLsi6KQOE99cz6ndPZG9uTmhJ5iD/9wvYl41 XqrgVuSdtrQOwASCQe7P7cFoVL8NGvKPOQtsu4og3jbvKpWmygmwZAkFZ+IivFIgP1lT dS20uDbYwqVm46bdja/PgQm/Qsvv37SQeyrEnUaCTZDhFgcCqLlE6TStN+GPGZah8Eur x+QubQ0D02rO/CTuprCNzRGQaiAL9tjjUxrBRNNAQSaMwqC2c6FzKdhD7d7sKr3d0TbN adT8sJZjOKX5XUMv0mklwjnqz14V+6EEqxAoYSV8c0H9sHm0mkgrpHZT+Pp8XKGRJX8h k4bA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=uXcpxHEQxtZ9MtQl3RG7vLkgZndWbXH3pQWmktUqB5o=; b=E4Ek0Ocn1cqymgEs8Kzn8QgCBoOSFONM0+O53MDqVNvJFWTPwlNs1ELaUhQkwzu9+9 bpOztq1pBOVctQvjcZLJ2UUsUz/JcCQUmYT1ZUUOlVWOYEit6X7R/eFegNTYlQyJ1+ed DR5hgE9mBBEbX0VblIgzOMY02qCPRZozoebSNeh4ORQo3fYGqmvbprZNvC3EBlm3Yjw0 Rmu8E/1oRMNfBk1FOs6yBDmuS7rrhtkKKSoP1uCSrtYT5CWARXfP7DIBpr8agmuDx7c+ bqoLxQgoOtgzm29RnyZN9P1SX68IfBEmHC1EVsaY+sjJjzp/DSjq/+0vicKQuymkRsyV 1emw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZvaPaFRk; 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 f29-20020a63381d000000b0051f17a517adsi22568561pga.492.2023.05.17.06.56.57; Wed, 17 May 2023 06:57:10 -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=ZvaPaFRk; 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 S231684AbjEQNUE (ORCPT + 99 others); Wed, 17 May 2023 09:20:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231487AbjEQNTn (ORCPT ); Wed, 17 May 2023 09:19:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04108173F for ; Wed, 17 May 2023 06:19:43 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 9423363BDA for ; Wed, 17 May 2023 13:19:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF762C433EF; Wed, 17 May 2023 13:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684329582; bh=aywvvDRPNw0N00F0h3QEaRNcGvMODB+TxD21Tej3Lsk=; h=From:To:Cc:Subject:Date:From; b=ZvaPaFRkLsehNX2loEbOvDVae+1gWgD0Ic2WOkv7wxF1IPFtcmlrUL0im6guBRNxR +nkj2hepVCk7Vijdc0PYTMFjBI+/tbCyFFYyC2z7ntZ7SOh+IzX1gCsAo0UoETwQcx t/XuI179xCx4vHxkPY0hEAokDqksHrgjMzNL6808mhV9F2tTenRXJY8hEVs8gd8duu 8/nSBouTPWLGEiHh01kNSsfMuFcd8gk+5ggFpmqrPp8YhxDQw5m5c2WM7jbYkDPAX+ 85t3QZEdPuLNBImnMpJqCD2JAeERkLfZmmPIqQQWjLanTAnT6T9iQuJop1StyB9F6Z sZe4Ql1zzScbQ== From: Arnd Bergmann To: Andrew Morton , Nick Terrell Cc: linux-mm@kvack.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] decompressor: provide missing prototypes Date: Wed, 17 May 2023 15:19:31 +0200 Message-Id: <20230517131936.936840-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766149933729880583?= X-GMAIL-MSGID: =?utf-8?q?1766149933729880583?= From: Arnd Bergmann The entry points for the decompressor don't always have a prototype included in the .c file: lib/decompress_inflate.c:42:17: error: no previous prototype for '__gunzip' [-Werror=missing-prototypes] lib/decompress_unxz.c:251:17: error: no previous prototype for 'unxz' [-Werror=missing-prototypes] lib/decompress_unzstd.c:331:17: error: no previous prototype for 'unzstd' [-Werror=missing-prototypes] include the correct headers for unxz and unzstd, and mark the inflate function above as unconditionally 'static' to avoid these warnings. Signed-off-by: Arnd Bergmann --- lib/decompress_inflate.c | 2 +- lib/decompress_unxz.c | 2 ++ lib/decompress_unzstd.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c index 6130c42b8e59..e19199f4a684 100644 --- a/lib/decompress_inflate.c +++ b/lib/decompress_inflate.c @@ -39,7 +39,7 @@ static long INIT nofill(void *buffer, unsigned long len) } /* Included from initramfs et al code */ -STATIC int INIT __gunzip(unsigned char *buf, long len, +static int INIT __gunzip(unsigned char *buf, long len, long (*fill)(void*, unsigned long), long (*flush)(void*, unsigned long), unsigned char *out_buf, long out_len, diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c index 9f4262ee33a5..353268b9f129 100644 --- a/lib/decompress_unxz.c +++ b/lib/decompress_unxz.c @@ -102,6 +102,8 @@ */ #ifdef STATIC # define XZ_PREBOOT +#else +#include #endif #ifdef __KERNEL__ # include diff --git a/lib/decompress_unzstd.c b/lib/decompress_unzstd.c index a512b99ae16a..bba2c0bb10cb 100644 --- a/lib/decompress_unzstd.c +++ b/lib/decompress_unzstd.c @@ -69,6 +69,8 @@ # define UNZSTD_PREBOOT # include "xxhash.c" # include "zstd/decompress_sources.h" +#else +#include #endif #include