Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1534724pxu; Tue, 24 Nov 2020 02:44:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCuaIvkCibtnwndwQCnr8uvQpnaRt1OmT+ZWN/YjhG4v6iE7AkvWn9UVssT8tZh65BKHwM X-Received: by 2002:a50:a689:: with SMTP id e9mr3260437edc.233.1606214694574; Tue, 24 Nov 2020 02:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606214694; cv=none; d=google.com; s=arc-20160816; b=D0MkSL6pJf2WT2DGYMNFnWAEDHUSDT1zvWNB5ss9vjwiCEERHeWSNOMGQOVOobN+4J lobFGLLnKw2HwNFcudgFxWm5TApBNX8IViylSSBT161Ic234qkaRO5fKaibIJ2umsVYU NcsvvvWy1WujGNUxMXkunsQgbmPAU1G/cIbmDmGbEmOwslrVe35n9sYtP0T+9naxMVqb BekxXi8eKVFZDK5b7vAbYGIpVWGPYex4FIzoIpDvclTQ83z73iExPWLHYf0nwWr6V5Uq ggusrCQRywcPWARb9xwkSXbuzNcc161QpRlKccFl+bOCmNO18agQaRwrdsQKq2lnFmbH 5rwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=npqzxLRCrGkHUhaQyNRoZgZ1pTCF4pQdXZS5ZUJCVmk=; b=n+RjEvxMK/M33AOdfNpo7hPwSuvOUFO7B0UBuyhkFDQZCAc4Bpg2KKAYsMyoKDrUQz YQqP7TQPNBWkyd5jqM/AUqn9z6mX72gyWkd2bio2JeXBKepe9FNzIS2500QoYPBBeUVs 7c9w4bjOxiGQNuXNh3fi7lUleXIBBjA0bLk099tEWUGEQYC9ksPtNq0LYodnrD1X2Lt4 GI3qPz1UVSHUem/lRpNY8bCV2iAN5YpPMdKMsJPJbbco0CzMW2FMtjEjKwkRr+SDXPCN GaT1odDLebB+v+hwsprjUzY1sUD5K1jaw7XYtO3j2SGUrBsIAWsOu59Oprc/3Vc2pZOr EmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hbkiGZR9; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r19si8477922ejc.668.2020.11.24.02.44.31; Tue, 24 Nov 2020 02:44:54 -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=@gmail.com header.s=20161025 header.b=hbkiGZR9; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732047AbgKXKku (ORCPT + 99 others); Tue, 24 Nov 2020 05:40:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731175AbgKXKks (ORCPT ); Tue, 24 Nov 2020 05:40:48 -0500 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64274C0613D6; Tue, 24 Nov 2020 02:40:48 -0800 (PST) Received: by mail-wm1-x342.google.com with SMTP id x22so1958934wmc.5; Tue, 24 Nov 2020 02:40:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=npqzxLRCrGkHUhaQyNRoZgZ1pTCF4pQdXZS5ZUJCVmk=; b=hbkiGZR9tHc/NOEtjYDZIgDgro/CH0D+yAAjMYULMLK0xoOXAXmf8ZqyqiP4ygGerb /E70Y2ZhprBxsS+hXEbk4XBYnika9CsVYgvvUOXMYM5y3g1vPCxiKmNcQdF3nTBkaW8M h/ezO0yjtPNPU1Z3Qb0SdbwoNN6Nwpip2xwaLjMGKXAahZT6kfkKzNyGea7QwBXmF6gQ vc6l07KTOSwMvFtKGNaIJA5xvBXn6nZLp/PwcMOujrkSMURQkE7i5Xdswq//vhbt+yrF 2sDEnW/bc9sps9zPHNSlJk5YqEf5cenlWBT9TohxLySGTVT87GmpQ8ZTnkAd94RqQMlF XyQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=npqzxLRCrGkHUhaQyNRoZgZ1pTCF4pQdXZS5ZUJCVmk=; b=h4wm5Vik1JkqKuY4owS082VG2bSBEQGVvXSNMRWtXGgDuxbP0/7na4Mh5rQ+pcMJ4N TMTztsNJOkCtUgy8NmU9PenUwxAjxgYdgHaCimhYMxbtBUDSc14Kaxj2kq4nqG5gUx1p urltrgCNGxtPPTgni+ErPMPj5tQvs/R4BkvSXGoGrqAHoxY+u5HCMrPuSX9aVWMEttWo 441+IAufbR+w/whZFv9KGg5xoZE22TuRgMh1lwxu4JtYRxinJ54Sms4etOzKRv6N1TXK /Y3dL3WSdtVNwxBUPXrdY+oCxTOIFMK2rYy5WIakIFfUWsl/8eOcpApo9KKnpM2dvdWN Zh9g== X-Gm-Message-State: AOAM531Bjseyf9tZTkwTUjtVKjnQQh/+3fjhmYX1689JzR2aHyCK88vC RJA1l5CSPmiYAZ2fR8CywvI= X-Received: by 2002:a7b:ca4c:: with SMTP id m12mr2759253wml.11.1606214447117; Tue, 24 Nov 2020 02:40:47 -0800 (PST) Received: from felia.fritz.box ([2001:16b8:2daf:7e00:40d0:5d6f:88a2:6c4f]) by smtp.gmail.com with ESMTPSA id w1sm4359378wmi.24.2020.11.24.02.40.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 02:40:46 -0800 (PST) From: Lukas Bulwahn To: Jann Horn , Andrew Morton Cc: Arnd Bergmann , Tom Rix , Nathan Chancellor , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH] zlib: define get_unaligned16() only when used Date: Tue, 24 Nov 2020 11:40:30 +0100 Message-Id: <20201124104030.903-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- applies cleanly on current master and next-20201124 Jann, please ack. Andrew, please pick this minor non-urgent clean-up patch. lib/zlib_inflate/inffast.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c index ed1f3df27260..ca66d9008228 100644 --- a/lib/zlib_inflate/inffast.c +++ b/lib/zlib_inflate/inffast.c @@ -15,7 +15,8 @@ union uu { unsigned char b[2]; }; -/* Endian independed version */ +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +/* Endian independent version */ static inline unsigned short get_unaligned16(const unsigned short *p) { @@ -26,6 +27,7 @@ get_unaligned16(const unsigned short *p) mm.b[1] = b[1]; return mm.us; } +#endif /* Decode literal, length, and distance codes and write out the resulting -- 2.17.1