Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1784150pxb; Mon, 20 Sep 2021 05:21:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMGvs9SqE854qH66c4rGhd0Trff8awnDABxaVAIAjstbgJWyPKUNCxjysAnYX2yMnGo4ap X-Received: by 2002:a05:6638:2385:: with SMTP id q5mr19248750jat.5.1632140504004; Mon, 20 Sep 2021 05:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632140503; cv=none; d=google.com; s=arc-20160816; b=a1pCMlErJ2kZw0EBnoOPUKlabLWPBl7/SERX3fMlcChrGFIlVbP/iYjlk8oQalXbWS YxRRQuNhFwVmktC+DIkx+GIZf6UsDaLXNGVIA0C+iYarwJ2ltUBwZBsmyWmPQehhso+9 2k5PN3gaIdOnp/13PXJS1hEmrIC2fbukuFV9lPvAuY558kWuxOoa36j2Dc/qSrfWIDx8 R3Jte5u4ZKyexnSGB76/d2pvhUWGstEtmYZ5W6GzCfJScALLO4CgCFm37bu9Av5MFmF2 nNfJCLRGA6BxPaZMm60owtKp2Be5wz0ODVtlgHj+/5R4bzZYpxRl1RF8ku4onlMerIxo lD6g== 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=cQE2/PpXpj0sLZf82v7T54MFG2H19Ic8/mVHC/BiJBI=; b=0sPyx1BAMQw4XVgnRV9AD8VLq82cdIVw6fzDpRqjI1Qt3Efr6B/5tT/oqVYKFqyJG7 m/puqs4xHrZgQJjCikfr6RdRSG2Vfm1QVk3sq2JjnXUE+PyAN9YXwdTHprc0MaJMkKjD hZqVbXststbEc0YaQujpD8RVU7HREt7yOCuDlyDhzDA7SRT9lycx1RINbopMMFdf+JGN hbY7SDd4Y28QUeTpOHmxBtzBk2KlvYAe0SXllvt8N/NyBuiKEsRH1y45yaguw3IDqBhE JB8Pu2/7HYzxxucDeoQhZIvZifdqo1xxd1FMuy6GtZGZcO9n8kFTTx5mHHFgk1DwJ/iw yDeg== 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 15si15115168ilt.96.2021.09.20.05.21.20; Mon, 20 Sep 2021 05:21:43 -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 S235133AbhITHsv (ORCPT + 99 others); Mon, 20 Sep 2021 03:48:51 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:48275 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229839AbhITHsv (ORCPT ); Mon, 20 Sep 2021 03:48:51 -0400 Received: from localhost.localdomain (ip5f5aef72.dynamic.kabel-deutschland.de [95.90.239.114]) (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 6ED0F61E5FE00; Mon, 20 Sep 2021 09:47:22 +0200 (CEST) From: Paul Menzel To: Nathan Chancellor , Nick Desaulniers Cc: Christophe Leroy , 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 v2] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning Date: Mon, 20 Sep 2021 09:46:33 +0200 Message-Id: <20210920074633.13089-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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c index f19c4fbe1be7..fb87a3120f0f 100644 --- a/lib/zlib_inflate/inffast.c +++ b/lib/zlib_inflate/inffast.c @@ -254,11 +254,8 @@ 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++ = IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) ? + *sfrom++ : get_unaligned16(sfrom++); while (--loops); out = (unsigned char *)sout; from = (unsigned char *)sfrom; -- 2.33.0