From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28105ECC for ; Mon, 18 Jul 2022 10:48:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD243C341C0; Mon, 18 Jul 2022 10:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658141294; bh=JAyGeINuZXCg47n62w2E/ixYwa1Du2XE/Y1lWIoSMdE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rW0/T4C6bZMKvYq43tVe+QU8x4NRLisHaxlfXXShlGDeEIGVVBk2C9gkENolyJE3x ny1EttvNgNb4PgvIymkjkAWl6IcIgndnfFLJnaX9eJFNI5zl47QBo2c7ByJPoobTiX lhA61sVJBVTaxHMuT11ZJCdCwr91ysfSQzJU7wQ40SrZaWPtKCU5l6GznQnZ0s8VJd JWhHLqq5XslVJd6Yww7/lrBF+Actmd3Rf5QuLjT0RuNbWHbdYFF9GWpRysSXqNyGEQ T+ZjULCo7+XoWM3ze1rElnBtDFWrVRRmxakjthoT/8q7oSDY1OoY3s8GjVUKVAv8tP /7e1Ahui+YoFA== Date: Mon, 18 Jul 2022 10:48:11 +0000 From: Tzung-Bi Shih To: Guenter Roeck Cc: Benson Leung , Guenter Roeck , "open list:CHROME HARDWARE PLATFORM SUPPORT" , linux-kernel , kernel test robot Subject: Re: [PATCH] platform/chrome: cros_kbd_led_backlight: fix build warning Message-ID: References: <20220718061608.2303425-1-tzungbi@kernel.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Jul 17, 2022 at 11:54:31PM -0700, Guenter Roeck wrote: > On Sun, Jul 17, 2022 at 11:16 PM Tzung-Bi Shih wrote: > > > > drivers/platform/chrome/cros_kbd_led_backlight.c got a new build warning > > when using the randconfig in [1]: > > >>> warning: unused variable 'keyboard_led_drvdata_ec_pwm' > > > > The warning happens when CONFIG_CROS_EC is set but CONFIG_OF is not set. > > Reproduce: > > - mkdir build_dir > > - wget [1] -O build_dir/.config > > - COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 \ > > O=build_dir ARCH=s390 SHELL=/bin/bash drivers/platform/chrome/ > > > > Have you tried the following ? > CONFIG_ACPI=y > CONFIG_CROS_EC=n > CONFIG_OF=y > > That should be possible, but with your patch it should now result in a > build error because keyboard_led_drvdata_ec_pwm is no longer defined. Hmm, just got another lkp robot's warning about the undeclared symbol. Will fix it by using __maybe_unused in next version. > Also, with your patch, CONFIG_CROS_EC=y, CONFIG_ACPI=y, and > CONFIG_OF=n (ie Intel/AMD systems) would result in the code not being > compiled, which would be wrong. Intel and AMD systems rely on `keyboard_led_drvdata_acpi` but not `keyboard_led_drvdata_ec_pwm` for now. They shouldn't be affected by the patch. In any cases, let's use __maybe_unused in next version.