From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933361AbbJHOda (ORCPT ); Thu, 8 Oct 2015 10:33:30 -0400 Received: from mga09.intel.com ([134.134.136.24]:60013 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933276AbbJHOd2 (ORCPT ); Thu, 8 Oct 2015 10:33:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,655,1437462000"; d="scan'208";a="822215046" Message-ID: <56167EB2.9060608@linux.intel.com> Date: Thu, 08 Oct 2015 17:33:22 +0300 From: Jarkko Nikula User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Sudip Mukherjee , Mark Brown CC: Oder Chiou , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Bard Liao Subject: Re: [alsa-devel] [PATCH] ASoC: rt5645: fix build warning References: <1444220532-14199-1-git-send-email-sudipm.mukherjee@gmail.com> <20151007140527.GK12635@sirena.org.uk> <20151008085550.GA3806@sudip-pc> In-Reply-To: <20151008085550.GA3806@sudip-pc> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/08/2015 11:55 AM, Sudip Mukherjee wrote: > On Wed, Oct 07, 2015 at 03:05:27PM +0100, Mark Brown wrote: >> On Wed, Oct 07, 2015 at 05:52:12PM +0530, Sudip Mukherjee wrote: >>> We were getting build warning about "Section mismatch". >>> dmi_platform_intel_broadwell is being referenced from the probe function >>> rt5645_i2c_probe(), but dmi_platform_intel_broadwell was marked with >>> __initdata. >>> >>> Signed-off-by: Sudip Mukherjee >> >>> -static struct dmi_system_id dmi_platform_intel_broadwell[] __initdata = { >>> +static struct dmi_system_id dmi_platform_intel_broadwell[] = { >> >> This doesn't seem like the obvious fix - why are we not annotating the >> probe function suitably (or alternatively if we can't why does >> __initdata still exist)? > > probe function should not be __init. probe can be called anytime after > the module has been loaded. > __initdata still exists as that part of the code was added by > e9159e7577cf ("ASoC: rt5645: Add dmi for Broadwell") which is a very > recent modification and I think that has been added by mistake. > One more argument in my favor: > The use in probe function is > if (dmi_check_system(dmi_platform_intel_braswell) || > dmi_check_system(dmi_platform_intel_broadwell)) > > dmi_platform_intel_braswell is not marked as __initdata but > dmi_platform_intel_broadwell is marked but they both have same use at > the same place. > If one really wants to save a few bytes then one could annotate this it with __initdata_or_module (very low use in kernel) but I don't think it's worth of effort and probably should be done for other sections here too by another patch. To me this patch looks a right thing to do at the moment. Reviewed-by: Jarkko Nikula