Received: by 10.192.165.148 with SMTP id m20csp418523imm; Wed, 2 May 2018 02:35:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp10V8JHk2BhJPGl8y62gjHZHoLSUsSLbFgdZvqnKZ7DYvZHehtC00IMr9FwyOP1gtXe4Xn X-Received: by 2002:a17:902:7596:: with SMTP id j22-v6mr19611817pll.334.1525253714822; Wed, 02 May 2018 02:35:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525253714; cv=none; d=google.com; s=arc-20160816; b=q9n6hD9blxpu2GOZ12RS2IIjOu55t1gzxZKGoPoaU5m7pH7V51I9eVxU3hvDZwjrQV qIGD3X59b0KjZOOWKp2HJ1QQru6hqHQiYnUpNl5N9GWDG0eRyIVPdNgbSGnAYMRgj7Kl OWuq5RfZedBlppAKf2GnXpK8iZ6Hjk/1IwWcoLhYy3lAldnDCfi8wZ/WImJTyLSIzKGV l+p0SIDDg5A+O+r1jVmagvUn7rP9swOZUuUCfOpxk1knw0waCL6bwhhUdMZE5ivw7NiD csGt+WV4Ee6/ftuC4wU5YByqXE4gWZZM6Hv/rQfrYMwrPqbQZ8HUHLan9Ng4bzBdzA7G 2SSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=01TIXTZSDABg8Ulbxy8f6Cekix2R56KH22cvKmx5Zm8=; b=fzQs4X3frga2xjLmui2Mk32At0YFkSjpszqiFclsdhYtx1GAhhasLqzsOkVOdg4Qlp cNG8IlJ49XwaoC3GBcbU+rebu0m7/39iS2I3ioVe3k3fmRawf4d8T6KAT69jjCyqXpcy c0OESj7HlFdqUWUKXty74w6KSDwQzR++tVRdjxQ7R/Sv4ImC9zVpie/MeB8IJXBEXson zFkQdoDQ+McFaWJJ5UygSVDZSnYEhlDMqlPqPZBHaaBuwTfuA7M9A+5pShIx8nAZCT5S 5RKh8BWwkqqKtCuOnt7XS8Lv7hcuethBBTRB/+XRoW0MdD+siM88wl8deZIxGu7Qb+gP FwSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si10857513plt.55.2018.05.02.02.35.00; Wed, 02 May 2018 02:35:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbeEBJeL (ORCPT + 99 others); Wed, 2 May 2018 05:34:11 -0400 Received: from mga17.intel.com ([192.55.52.151]:6878 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbeEBJeJ (ORCPT ); Wed, 2 May 2018 05:34:09 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 02:34:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,354,1520924400"; d="scan'208";a="47657396" Received: from gvt-dell.bj.intel.com (HELO intel.com) ([10.238.154.59]) by orsmga003.jf.intel.com with SMTP; 02 May 2018 02:34:05 -0700 Date: Wed, 2 May 2018 17:24:09 +0800 From: "Du, Changbin" To: Mark Brown Cc: changbin.du@intel.com, yamada.masahiro@socionext.com, michal.lkml@markovi.net, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, x86@kernel.org, lgirdwood@gmail.com, arnd@arndb.de, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 2/5] regulator: add dummy of_find_regulator_by_node Message-ID: <20180502092409.ymjoykektm5kxgfc@intel.com> References: <1525179614-14571-1-git-send-email-changbin.du@intel.com> <1525179614-14571-3-git-send-email-changbin.du@intel.com> <20180501204033.GB2714@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180501204033.GB2714@sirena.org.uk> User-Agent: NeoMutt/20180323-6-5ca392 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 02, 2018 at 05:40:36AM +0900, Mark Brown wrote: > On Tue, May 01, 2018 at 09:00:11PM +0800, changbin.du@intel.com wrote: > > From: Changbin Du > > > > If device tree is not enabled, of_find_regulator_by_node() should have > > a dummy function since the function call is still there. > > > > Signed-off-by: Changbin Du > > This appears to have no obvious connection with the cover letter for the > series... The first question here is if this is something best fixed > with a stub or by fixing the users - is the lack of a stub pointing out > some bugs in them? I'm a bit worried about how we've been managing to > avoid any build test issues here though, surely the various builders > would have spotted a problem? This is to fix build error after NO_AUTO_INLINE is introduced. If this option is enabled, GCC will not auto-inline functions that are not explicitly marked as inline. In this case (no CONFIG_OF), the copmiler will report error in regulator_dev_lookup(). W/o NO_AUTO_INLINE, function of_get_regulator() is auto-inlined and then the call to of_find_regulator_by_node() is optimized out since of_get_regulator() always return NULL. W/ NO_AUTO_INLINE, the return value of of_get_regulator() is a variable so the call to of_find_regulator_by_node() cannot be optimized out. static struct regulator_dev *regulator_dev_lookup(struct device *dev, const char *supply) { struct regulator_dev *r = NULL; struct device_node *node; struct regulator_map *map; const char *devname = NULL; regulator_supply_alias(&dev, &supply); /* first do a dt based lookup */ if (dev && dev->of_node) { node = of_get_regulator(dev, supply); if (node) { r = of_find_regulator_by_node(node); if (r) return r; .... It is safe we just provide a stub of_find_regulator_by_node() if no CONFIG_OF. -- Thanks, Changbin Du