Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1550630pxu; Tue, 24 Nov 2020 03:12:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOztlCWvdAIHk+c8PdDz/T1Fz1MlEZYd6RniD0Ozq2Bqsvo5I8x851F6Pta/KEBOfALCu4 X-Received: by 2002:a17:906:5243:: with SMTP id y3mr3819979ejm.273.1606216359197; Tue, 24 Nov 2020 03:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606216359; cv=none; d=google.com; s=arc-20160816; b=0OuYXrtQMMnxS73FiGhbXvl4nnSQoZYCfn8bsBFa7N4EySwV8uIu9aecFmNugGIBQc /0dnGcaE377eXf6P9ZGP5ne3fzclUvP6xQq8aZeh7LLk/WkckYqruI3sqamUNDFu9ICN Cq+m8EQqOGe3o6hvoqfodVCwaYnAEeQes4z65rO9PWyI/RpZNDFG7slCcdTE8AyDrJ+t KUwjNmXDdPW96pIQ8vDpZiuxIKECwTfKsOOEXY0qaeFEQT8AHm/nH6fII7xzjcde4HuE 21KxrHfp/JGJLRM1IQo0A/+ZdnJaodErviZtt5M+RdT9Y8WL1GFDmzMqT6lPh1tFCmBr 3MYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rZAwLjr8KspoBjmgRNrm6A/fZBDnUklQGOp47xcRZqg=; b=F+B6TW8yPNns22bnHHdoPdZopIDTnzQtvqnpi25ebuqN6u2cyVLVqilv1X993Unvg+ 4Ja/4FbIOCPNSXyOf8RgcE+sZg3ku7YZzRfQ/KC0Chj4y8OawycOn9FuJWlvwtDSjNi7 mA5cKqzhrGN9Odl8Wg9PDay6AEdZp9Bp5/5YNcbgwIg04swyuPAW65ndT2j1mfzrb2iF dWFbdJY+8YqVlGxjZmZ2viuvqLM4n/X7zmOMflPvEPynbX/ejkKs7XsiKQMnwMD/Tu9E FRoWCXNKxwGYJ9gHgz6pLSP779+qvobZ4G3F2m39D5N4OKmaEPXRcj1Mzw8WJaGvmkP4 +/LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WcfZkfh0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si8506318edu.277.2020.11.24.03.12.16; Tue, 24 Nov 2020 03:12:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WcfZkfh0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732831AbgKXLJK (ORCPT + 99 others); Tue, 24 Nov 2020 06:09:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732418AbgKXLJI (ORCPT ); Tue, 24 Nov 2020 06:09:08 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5026CC0617A6 for ; Tue, 24 Nov 2020 03:09:08 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id y7so6619519lji.8 for ; Tue, 24 Nov 2020 03:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rZAwLjr8KspoBjmgRNrm6A/fZBDnUklQGOp47xcRZqg=; b=WcfZkfh0eVFoUsipHhn2lIdyQn1PvNhsvhIPb0FasBYXL9/QetbPypJYvKNpVizywP bUPURugPlZVNnS7rAvrCG/98igP0I2KoeV2gw/43m4xhABdGXigoUR7kYcqeWFC1zMGP H3GnzG7+TRk+q7OyzXU9bc5pGpTzMwNL3qlc8blBhyl8hukuNCGJSd5GbJV1j+V8xefX SILZfna+YhM0C8gb85B0IHiHYOAG1OGlSBkaadULkJNfqCL00b/2iNSs1sMaOpj2qIrP 7+GiAxzoT9d0m8+XPyiYe5ho2F/5P073x+LFX+kpLfLLsHz3282jVkt3hiM+PJ0XcQx7 8gfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rZAwLjr8KspoBjmgRNrm6A/fZBDnUklQGOp47xcRZqg=; b=HMNQmezpXoTScpA8/dHg8rUAmIh4D2uJNP2d8SRKXGT3/PqSpUE2FP4w4KYgrI0CB6 6m5pXbzhnRyBUOb3jMN4zi4u8XnFKJE5bcVHsKL2bKkoECDt524yD7TV9b40FYr10KDi Z6XLMO35N19UbKwFhvlgFsOKB/xAwGmbLiKRTlC/uqReqpc7SMKFBczuvxLYtqU7iXOa fZpj1CYDYcnRQE/VFlsKhF7oGJ+zlZdE4LsujmTASgj+4/MSSjPpWYgPQgLNKl5+ccum pa9aE4hnvM9w5szTL8/HQ9DVQh4jz5sgw5j+Ei8HYCHIqfaLsfAjusXM4E+jZr+G6mXj u1gQ== X-Gm-Message-State: AOAM53056U+uM1y5Q9ZwNB9EUAK49nCC8S0KSuKOO5gLMCjlvSwTsimC DTTyLdT1KDh98o+3kmNkWNAsIRqjyh4qtNp9kJVejQ== X-Received: by 2002:a2e:9d8d:: with SMTP id c13mr1606129ljj.160.1606216146604; Tue, 24 Nov 2020 03:09:06 -0800 (PST) MIME-Version: 1.0 References: <20201124104030.903-1-lukas.bulwahn@gmail.com> In-Reply-To: <20201124104030.903-1-lukas.bulwahn@gmail.com> From: Jann Horn Date: Tue, 24 Nov 2020 12:08:40 +0100 Message-ID: Subject: Re: [PATCH] zlib: define get_unaligned16() only when used To: Lukas Bulwahn Cc: 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 11:40 AM Lukas Bulwahn 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?