Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1233605ybt; Wed, 1 Jul 2020 23:42:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIlVHXi3QXR97bx3JhGzEz1iegxr+SrYz2PSVHBPZREB7EWgTIyt5+MppSZiv24Fr8nv0h X-Received: by 2002:aa7:c545:: with SMTP id s5mr20678455edr.19.1593672147615; Wed, 01 Jul 2020 23:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593672147; cv=none; d=google.com; s=arc-20160816; b=o5Ao5j0AWHrFOQNH/5zVgk6My9NRImf+ZrOiPjn111gIdQs5WaLcykKtgrWii9I/c7 OqvscyQI7K/ivUYVE7IrM3jhgUnwWhkVg7yP9BRX5PtvBjsIbKpuRLifX78r/RvFgwWA PaAHZ85Yb/um/8LxHQZN/0IEe1V+wotuxtTBylyBq2vsXp1hYcBJ8twq9Uik51QOmU+S z8/280vfFbUZ6D4QnZNzVy7ljyiBOAfdYvKPNlTqQ1DqcAacPk5IJwl2K24RQnFLxLtf rNO9qnfkNJgxRPrGMFGaEH/hJAD4Rn6bQbrX288t1U0I8WJYHMhK6dSLyFjqkFn+yCbx 524w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uZyzkTpWxxyp2jCpCr/H7AQhJTt+1oFIYiYjR40e5k8=; b=Yc8nAx7/4RopqKTfAJUV+vj0jZWnC6UhMS3c67L57PNm9f4EHBazRIJ4EznAzwdEVS 01qcscNIlgkne0MJIr8xqM9cWfL57XnxSCMBu7j7coh3v47ziYk09CWf9vZ9AlCi1C+J q3qZaIlnnGRJ7mMUvAb4cdl59QWA+Bg2/AJ7j/fCUZFFih0di11p05KLTzYxG1LSKHHO vrhMlGDmZyyvNE3UerLUHroeGMe7bLP7YAUg2XksWbwWuHJjruVn59zSFopHPqIwWDgq my+a5BGdPZT4TAX8WpLhAPeI84pQFiM7UXiBd/sReZdVwanggF1dvbm7EUdZaHK510aq nAXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ef+WvaDI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si5407647edt.572.2020.07.01.23.42.05; Wed, 01 Jul 2020 23:42:27 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ef+WvaDI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbgGBGkC (ORCPT + 99 others); Thu, 2 Jul 2020 02:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbgGBGkC (ORCPT ); Thu, 2 Jul 2020 02:40:02 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2AA4C08C5C1; Wed, 1 Jul 2020 23:40:01 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id o18so23460704eje.7; Wed, 01 Jul 2020 23:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uZyzkTpWxxyp2jCpCr/H7AQhJTt+1oFIYiYjR40e5k8=; b=ef+WvaDI5Nclj/K3DxyTqSSIiMNT70CBd5IP2Oh8mSLH15FENPmZiNclUE54Cef5Y1 6RdTuKtBentGIP3A2y8+jhPffGc8jn/LJ9ZRvpS5+cdnzDueqkGsNMqAdcQ2qDgBL5Wo TR4r7Hj7hcW9Fa31FslEK/MC3djVQaGhgL5PXCN9hyKpqXfd/D5LUR9QMeFLkJwfYtGr c1VXFt8rx4+GEz8F2KbqvYBf/wvZh0x/lbvGYN/D1ov/QRi+rZmxUa3/YX4Lp7CDGsUp Sn3a39dv13S3DaJ9HcJYmVLqtzeQxsXEN+7YZhkVNi19zDnEO52Wpn6Vu3zpvqI6+MYJ bJGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uZyzkTpWxxyp2jCpCr/H7AQhJTt+1oFIYiYjR40e5k8=; b=uKWo4w+TlCG5dFN3sc9xxZU++xqI6+87TKZoy3rDiDlXPvkug6vh4idyUrWH8KSa9x TeR7GOmt4ejRkYoNT95R6LxhmbbVeUZgVaT4Es2QC0iWThGoBeiJNj9dlcfREKglpfTy O1inPAXrMt4NA4ywBkmkkDLlTXMFztqcRozHMWVDyGWHGlGtyLAnvTlA56LyCPJ7zfIz CinBHN62PKgJkZtUxID+8O1q67T+UxS9fDsx0BsJTzRKdYrwuSBVsJNYkuYkryU5SO1t AbgEmxMM5RiZ+BO60ja2c3L0rmn6YHrdLJxaZaQpMj9TMYXlEwufv+4L1/dHfmcxdQTe yFzA== X-Gm-Message-State: AOAM533y0TlOKBeIZiVmxpV7mqE/3UtZedfMj77/rn+zOSZrXfdkwtuA rui9s2GNWSZ/5Enj/1aDc10aKgWx4nCLoPoJJBs= X-Received: by 2002:a17:907:7245:: with SMTP id ds5mr27575294ejc.67.1593672000556; Wed, 01 Jul 2020 23:40:00 -0700 (PDT) MIME-Version: 1.0 References: <1593656074-10092-1-git-send-email-Anson.Huang@nxp.com> <1593656074-10092-4-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Dong Aisheng Date: Thu, 2 Jul 2020 14:25:58 +0800 Message-ID: Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock driver as module To: Anson Huang Cc: Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , Peng Fan , Arnd Bergmann , Abel Vesa , Aisheng Dong , Andy Duan , Daniel Baluta , YueHaibing , Stephen Rothwell , linux-clk , open list , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 2, 2020 at 2:11 PM Anson Huang wrote: > > > Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock > > driver as module > > > > On Thu, Jul 2, 2020 at 11:26 AM Anson Huang > > wrote: > > [...] > > > > > @@ -143,16 +148,18 @@ void imx_cscmr1_fixup(u32 *val) static int > > > > > imx_keep_uart_clocks; static struct clk ** const > > > > > *imx_uart_clocks; > > > > > > > > > > -static int __init imx_keep_uart_clocks_param(char *str) > > > > > +static int __maybe_unused imx_keep_uart_clocks_param(char *str) > > > > > { > > > > > imx_keep_uart_clocks = 1; > > > > > > > > > > return 0; > > > > > } > > > > > +#ifndef MODULE > > > > > __setup_param("earlycon", imx_keep_uart_earlycon, > > > > > imx_keep_uart_clocks_param, 0); > > > > > __setup_param("earlyprintk", imx_keep_uart_earlyprintk, > > > > > imx_keep_uart_clocks_param, 0); > > > > > > > > I feel not only the __setup_param, the whole logic of > > > > keep_uart_clocks are not needed for Module case. Is it true? > > > > > > Yes, but the 'keep_uart_clocks' is false by default and the function > > > imx_keep_uart_clocks_param() already has '__maybe_unused', it does NOT > > > impact anything if it is for module build, so I did NOT add the #ifndef check > > for them, just to keep code easy and clean. > > > > > > > IMHO do not compile them is a more easy and clean way. Then users don't > > have to look into the code logic which is meaingless for Module case. > > > > BTW, it really does not make any sense to only condionally compile > > __setup_parm() but left > > the param functions definition to be handled by __maybe_unnused. > > They're together part of code, aren't they? > > I am fine of adding the '#ifndef MODULE' to imx_clk_disable_uart() and imx_keep_uart_clocks_param() > as well in next patch series. Others like ' imx_keep_uart_clocks ' and imx_register_uart_clocks() need to > be kept always built, since they are used by each clock driver no matter built-in or module build. > > So that means I have to add another 'ifndef MODULE' or I need to adjust some code sequence to make > those code can be built-out in same block and just use single 'ifndef MODULE', I think adjust the code > sequence should be better, will go with this way. What if we condionally compile it in clk.h? Will that be easiser? Regards Aisheng > > Anson