From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751930AbdGAMLS (ORCPT ); Sat, 1 Jul 2017 08:11:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:45214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbdGAMLR (ORCPT ); Sat, 1 Jul 2017 08:11:17 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0478122BC9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 1 Jul 2017 13:11:12 +0100 From: Jonathan Cameron To: Linus Walleij Cc: Matthias Kaehlcke , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Doug Anderson Subject: Re: [PATCH] iio: magnetometer: Only declare ACPI table when ACPI is enable Message-ID: <20170701131112.7dbfa118@kernel.org> In-Reply-To: References: <20170627002533.97293-1-mka@chromium.org> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Jun 2017 14:51:56 +0200 Linus Walleij wrote: > On Tue, Jun 27, 2017 at 2:25 AM, Matthias Kaehlcke wrote: > > > Don't inflate the kernel size with data that isn't used. The conditional > > declaration also fixes the following warning when building with clang: > > > > drivers/iio/magnetometer/ak8975.c:704:36: error: variable 'ak_acpi_match' > > is not needed and will not be emitted > > [-Werror,-Wunneeded-internal-declaration] > > > > Signed-off-by: Matthias Kaehlcke > > Acked-by: Linus Walleij > > Yours, > Linus Walleij Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. I'm curious though... Can the compiler not optimize this away? I'd always assumed the main reason for these warnings was that the presence of unused data might represent a bug rather than it actually making any difference to the size...