Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1431961pxb; Thu, 16 Sep 2021 07:24:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkzEJyZlpJrMa3a8Gi3ti2HzrzGh29j29yMirfgXIMtCipKR2JS3uY1qjKoR6kQbRKfL7Q X-Received: by 2002:a05:6602:117:: with SMTP id s23mr4657632iot.124.1631802246177; Thu, 16 Sep 2021 07:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631802246; cv=none; d=google.com; s=arc-20160816; b=MNQgKX59y37FMq8pcKIxd9CNBqgk6Q83BT0+lVuqa5ihSgsYI1ltvRaUfmY/zh3ZVK BvLz6DyqJR1owAj711Y1ihv7z0KzCgtxUDuvSuJtCW+g6zzhO7N5ISeorN84brnykqJT a8FBQFAxv6zyxGruwXlORJ6bVxehRNL633Xa6XKzbRMTm8jZdvFpXOfMuCpoHN/QnMC4 TBxmakvKNWzldfsdvhcvLM/CA18Sw+IGaxWf3ST+UzNXyJghGUbVYwKc1sP8XJBC9TZ9 3TgUdQ/gDzYihY5Xn8HaAvG2tAABTSHzDDYDxYYD6Z97ZFE5MH2tZPIaEin63P9ZJOGk z62g== 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; bh=x1FkbLFAhRSayVqhxE7Kn2cq9tPYnLmD30y4khhf9+g=; b=b7RpHZOgkWTfUbVXt1Rf7QPqk7CBrEtIHvG9kjFpCQmbsbGXUp7G777+i7d0o2oMI/ JylYZ7W7vmLuWJfLQE8+6/qonKbD55lJaMUt1ZSdOUHLuucJ5vcuR7RWJ5wBakv7hzT/ cW2kFXOcNMjk6zhbnQExahCeIC4p5nQzevAUywSQrwrEHoFcXemYqRmhaYY03AxDlG2K mqFKKdkql/paH+tMZl+nYS7FVzSATFhVftLxYU7aOvIOYjhKSCWmBhHTLuF8XhuIvklG Bp/PWoluylqBOCC7KwYt0+e+3mnCkAxihNjVIpTttaQl5f3/2KZvMZaVjUJnHtJMVWTN dZgg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si2680311ilc.12.2021.09.16.07.23.51; Thu, 16 Sep 2021 07:24:06 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237425AbhIPOYH (ORCPT + 99 others); Thu, 16 Sep 2021 10:24:07 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:44623 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230243AbhIPOYC (ORCPT ); Thu, 16 Sep 2021 10:24:02 -0400 Received: from ersatz.molgen.mpg.de (g45.guest.molgen.mpg.de [141.14.220.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id C00FB61E64761; Thu, 16 Sep 2021 16:22:39 +0200 (CEST) From: Paul Menzel To: Nathan Chancellor , Nick Desaulniers Cc: Zhen Lei , Andrew Morton , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Paul Menzel , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning Date: Thu, 16 Sep 2021 16:22:10 +0200 Message-Id: <20210916142210.26722-1-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 shows the warning below. arch/powerpc/boot/inffast.c:20:1: warning: unused function 'get_unaligned16' [-Wunused-function] get_unaligned16(const unsigned short *p) ^ 1 warning generated. Fix it, by moving the check from the preprocessor to C, so the compiler sees the use. Signed-off-by: Paul Menzel --- lib/zlib_inflate/inffast.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c index f19c4fbe1be7..444ad3c3ccd3 100644 --- a/lib/zlib_inflate/inffast.c +++ b/lib/zlib_inflate/inffast.c @@ -254,11 +254,7 @@ void inflate_fast(z_streamp strm, unsigned start) sfrom = (unsigned short *)(from); loops = len >> 1; do -#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS - *sout++ = *sfrom++; -#else - *sout++ = get_unaligned16(sfrom++); -#endif + *sout++ = CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS ? *sfrom++ : get_unaligned16(sfrom++); while (--loops); out = (unsigned char *)sout; from = (unsigned char *)sfrom; -- 2.33.0