From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DD14C56202 for ; Tue, 24 Nov 2020 11:57:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B6BF220782 for ; Tue, 24 Nov 2020 11:57:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ubr93Bgq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733174AbgKXL4s (ORCPT ); Tue, 24 Nov 2020 06:56:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:44246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728791AbgKXL4s (ORCPT ); Tue, 24 Nov 2020 06:56:48 -0500 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4659A2076B; Tue, 24 Nov 2020 11:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606219007; bh=y7hNCHDhOzCdJOZUojv/G3eF5vHntYRU1MQ8NUR/VkE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Ubr93BgqQ9elnxKRaC9Uy7kW6GwLt9O4FCZNYRLejie3j/brR5HVW5ioNG+KN2IuL sUw9acNqGq7fbsqGEMgVwe2KVq/Y8+eGyRkBRIdjrTxo806Wp+dVMLh5vXOB4uozLC y6nIIF4TUE5N+aZA/krt5hTNXOMM4uegvBpiYbw4= Received: by mail-ot1-f49.google.com with SMTP id z24so5058288oto.6; Tue, 24 Nov 2020 03:56:47 -0800 (PST) X-Gm-Message-State: AOAM530rHvvpBrg2sSerYl252eTJ1Su4xRcEBrPPunAUxQhqm3TCQpES NiGo5dxS3V0RzDT+EmIcb/c07j1frO7CGbcYhrs= X-Google-Smtp-Source: ABdhPJyIlbxK8kUI/Gd+t4sq0176BR9e9qJAqPwFGr3P2q+YWGeihJdMWgrJLWFUEZQLFdVjeb1/n3JnWGVkwsHznUo= X-Received: by 2002:a9d:6317:: with SMTP id q23mr2756972otk.251.1606219006415; Tue, 24 Nov 2020 03:56:46 -0800 (PST) MIME-Version: 1.0 References: <20201124104030.903-1-lukas.bulwahn@gmail.com> <20201124115058.GA32060@infradead.org> In-Reply-To: <20201124115058.GA32060@infradead.org> From: Arnd Bergmann Date: Tue, 24 Nov 2020 12:56:30 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] zlib: define get_unaligned16() only when used To: Christoph Hellwig Cc: Jann Horn , Lukas Bulwahn , Andrew Morton , Arnd Bergmann , Tom Rix , Nathan Chancellor , Nick Desaulniers , clang-built-linux , kernel-janitors@vger.kernel.org, kernel list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 12:51 PM Christoph Hellwig wrote: > On Tue, Nov 24, 2020 at 12:08:40PM +0100, Jann Horn wrote: > > > Since commit acaab7335bd6 ("lib/zlib: remove outdated and incorrect > > > pre-increment optimization"), get_unaligned16() is only used when > > > !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS. > > > > > > Hence, make CC=clang W=1 warns: > > > > > > lib/zlib_inflate/inffast.c:20:1: > > > warning: unused function 'get_unaligned16' [-Wunused-function] > > > > > > Define get_unaligned16() only when it is actually used. > > > > > > Signed-off-by: Lukas Bulwahn > > > > AFAICS a nicer option would be to "#include " and > > then use "get_unaligned", which should automatically do the right > > thing everywhere and remove the need for defining get_unaligned16() > > and checking CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS entirely? > > Yes, that is the right thing to do. It's possible that this didn't work when the code was originally added: The decompressor functions are called from the compressed boot path, which is a bit limited regarding which headers it can include, at least on some architectures. I would recommend test-building this for all architectures that include ../../../../lib/decompress_inflate.c from their boot code. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Tue, 24 Nov 2020 11:56:30 +0000 Subject: Re: [PATCH] zlib: define get_unaligned16() only when used Message-Id: List-Id: References: <20201124104030.903-1-lukas.bulwahn@gmail.com> <20201124115058.GA32060@infradead.org> In-Reply-To: <20201124115058.GA32060@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christoph Hellwig Cc: Jann Horn , Lukas Bulwahn , Andrew Morton , Arnd Bergmann , Tom Rix , Nathan Chancellor , Nick Desaulniers , clang-built-linux , kernel-janitors@vger.kernel.org, kernel list On Tue, Nov 24, 2020 at 12:51 PM Christoph Hellwig wrote: > On Tue, Nov 24, 2020 at 12:08:40PM +0100, Jann Horn wrote: > > > Since commit acaab7335bd6 ("lib/zlib: remove outdated and incorrect > > > pre-increment optimization"), get_unaligned16() is only used when > > > !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS. > > > > > > Hence, make CC=clang W=1 warns: > > > > > > lib/zlib_inflate/inffast.c:20:1: > > > warning: unused function 'get_unaligned16' [-Wunused-function] > > > > > > Define get_unaligned16() only when it is actually used. > > > > > > Signed-off-by: Lukas Bulwahn > > > > AFAICS a nicer option would be to "#include " and > > then use "get_unaligned", which should automatically do the right > > thing everywhere and remove the need for defining get_unaligned16() > > and checking CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS entirely? > > Yes, that is the right thing to do. It's possible that this didn't work when the code was originally added: The decompressor functions are called from the compressed boot path, which is a bit limited regarding which headers it can include, at least on some architectures. I would recommend test-building this for all architectures that include ../../../../lib/decompress_inflate.c from their boot code. Arnd