Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1974535pxu; Tue, 24 Nov 2020 13:35:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwLNKwVz9o/8/IW3orIthHVX6/ekGTkqN3QmrXdtPXKjDLs9+HAMCQVQWHYsoNtzAcEut4 X-Received: by 2002:a17:906:cc84:: with SMTP id oq4mr338675ejb.513.1606253720957; Tue, 24 Nov 2020 13:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606253720; cv=none; d=google.com; s=arc-20160816; b=N36d1bgHG/Q7k1MBNhCaT9OITW1zSc7vCTQraB0ciDAkfTsbCp/UQ2iyb5/2/Qb+fQ vEr+pA80ab2kOkQWkLPCjYHgJp77ZVxxGPc75J6OHsjeSRIHcYl4j2NA2ykrXOBBcW34 pE4mirjl0Q2rnHyR12o64gk4TG/IoIdmwuYIQJHg6FjvAzFdGCjBaESiYlB7ETOf0rjF 7fiBkDDPlN6hQ3sBKpf3D8QqoTvK9WfBtftIohg7fPLB5SXd2EL02WyUY4N6g0rOjRLx Jrppf/gVr0tYtmccHjkAjRCE0GoeP72OAfPt3UCH8+kP/wA3XtDZjo3ViiLJZaUYINd2 wCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5kw0QxLQoOgDyVGj4iKmiuA5NMWKFQFej/HFL8JZlH4=; b=wl4Aa6VyAdq/RoN/bjHH9UifuBhjA1LMb9tPhV2rWaX8jaKMOlwyoaGFEi2Z4DVzsc v5ljnEDBbswXE1D/cmqALd9lzHJOwdHwBDFPCdlrYPtn4kMsXAueWJ1vW6Wa6VaQEGLj jhnrWEFrrVfaWgC1PfKZuC0Low/B2KH++1ESk7+N9Eu+gl8cYwtrFv4aFRhjHk8ZwT8h aOQuEK1/rmZ7qSCX90zpmOZz0tF9nE6Rxv3m8o7ZVAeuJcy+icc3EIR5OKkyQjqOpN+r kYhyB1BvcO6AMWAA0VKeiXogyzywZ6LlLy7OVdrmK2YUB7qXQA7XVpPNGRSn+uK4GPnY 93nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=hKJIBhFP; 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 y18si88338ejb.408.2020.11.24.13.34.56; Tue, 24 Nov 2020 13:35:20 -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=@infradead.org header.s=casper.20170209 header.b=hKJIBhFP; 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 S1733056AbgKXLvF (ORCPT + 99 others); Tue, 24 Nov 2020 06:51:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733039AbgKXLvE (ORCPT ); Tue, 24 Nov 2020 06:51:04 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7645CC0613D6; Tue, 24 Nov 2020 03:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5kw0QxLQoOgDyVGj4iKmiuA5NMWKFQFej/HFL8JZlH4=; b=hKJIBhFP4aGspoOz/5N86hxScK ucjZLQ76V2OlRxEZD9uHaySwMEhir8SlIqu34afox2tfguAdfYYjQMenNlaBOoddmuvmXH20p60kN jXXCfLO4YjJY9EN7nosXyN5sAs5lOr+7iQCfScnN+L3+bXkh7HFSI7+bvhKtjhxNDtFXbyVjkHyHf 1b+nkIcom9n2+t67POw/+ph54B8edFfXKBD76y6n7tAqipRCRWlxC+HHgSZkHrXHfEJ8GKQvQ5sUM sGfcGhnoEX+0d3NS66+3gdoG7szLA0ZcuPp5y9UmVyqBb/tylyIE+PEtHSEHY0/VkY5I0PQ5JMm9W BK63/xPw==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1khWqY-0000NM-3G; Tue, 24 Nov 2020 11:50:58 +0000 Date: Tue, 24 Nov 2020 11:50:58 +0000 From: Christoph Hellwig To: Jann Horn Cc: Lukas Bulwahn , Andrew Morton , Arnd Bergmann , Tom Rix , Nathan Chancellor , Nick Desaulniers , clang-built-linux , kernel-janitors@vger.kernel.org, kernel list Subject: Re: [PATCH] zlib: define get_unaligned16() only when used Message-ID: <20201124115058.GA32060@infradead.org> References: <20201124104030.903-1-lukas.bulwahn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.