Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp170120ybe; Sun, 1 Sep 2019 22:53:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWqor4E++Tz3psHhNYXisXFoWrPx0oRLbj15MLW2TfeWZAoLo4fJ5x6hTl0FuwOik0okx0 X-Received: by 2002:a65:6152:: with SMTP id o18mr22908186pgv.279.1567403603168; Sun, 01 Sep 2019 22:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567403603; cv=none; d=google.com; s=arc-20160816; b=YktEM8bDyjHpTmKyGLrBjch1R8tYUfxtVGcMdG0CLGuFKsoQz0izYJ0R9/21vxUitz xbDpFTvLVjjns9tZ4f+2QHiU/2UmQ3YrO1ClR5ym7JhVxTz/MYR53DyHr3xJnJHM4M1o MwBUe+h5SJnbNDFg4qnZ9JK6Lp+YpNjKsrdt4p42Z3j8hNvjlqCy+66q2uhAAPzVLgi/ KKqGt3Mq6ZE+EDM3JrSYRwUIlIRoPfkLJuMaiwuHN0S8l5Mpgda5teOpuyTOfIVsgzpS s4mQya4Rbj5njBpmn0df9Jg1K2gHSp5a0SXLshr1yqUQWsrBqo4UmQ8szJVu/e9o6lXC M59g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=SfesOFiKN1IfZZTahtZmg0P++GiClFRiJzFNrBgRNCw=; b=gulgLyY0ONOGpiAeAnWS8YTASRyghdq+/H5qiHrq81xqQXez/2+YqZi5zIwLqKslh5 z/KZF5E7aVmigJCtbDpiyqr9ed1oyDMJupGKbD7/ACRYYJqpYGMB8eW8jGVLQRtqQco+ pUIQFGOnDu+F6QJYc2O/pvbkAV5fRVSjajQmj2azq4xcePUEiWn10+5KLaQtWQqHDBe/ R3L3kzu1cTQqWvcwhAVqKONEtWTaZ37vLt3eJWoPZw++OOFUlP/za2vIYgQvASlRC7VX kCxwlUzAj7UiSZyxapfEs8iJMTtZmj0aRYW6p6eP0XKW/9ikaUqslBVaiET8ZY5Vw8wR D3Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=IMcXpfcB; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ESPCQrNG; 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 v16si10993944plo.264.2019.09.01.22.53.08; Sun, 01 Sep 2019 22:53:23 -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; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=IMcXpfcB; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ESPCQrNG; 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 S1729484AbfIBF0a (ORCPT + 99 others); Mon, 2 Sep 2019 01:26:30 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41201 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729299AbfIBF0a (ORCPT ); Mon, 2 Sep 2019 01:26:30 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 059DF210AF; Mon, 2 Sep 2019 01:26:29 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Mon, 02 Sep 2019 01:26:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=SfesOFiKN1IfZZTahtZmg0P++GiClFR iJzFNrBgRNCw=; b=IMcXpfcBx+4mIhFADnDJHiKjLIz6NUxMbOOK3QHwW66TKF3 bQ2KBIVCA7xnkPDZDw9RB9bzlUWT/NUmBQMamxExN4PxhRRn/1KRB1ogw7VzQ8bU FGtJnWb3tlikUfLuMo67teT2whLCa8LA827GX3M5llOQyhW+YTbrUsBmVeQlvSXv HOedDzKU1xSlgBQOoW8lvq7WTCBRoiCectrKnffi/JQ3G37QKyuQw7hWq4mKm8Tt m9cZZIQIoJYbqxhP+Qvj4i7KFXoeqTGTeg4ogRrgF1hZbVwf4kK478ryTqV31Z7J cHwZZrCSV+1o6XYsT0jYHfXUdQGZDqW4orVYA/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=SfesOF iKN1IfZZTahtZmg0P++GiClFRiJzFNrBgRNCw=; b=ESPCQrNGWZa3NWUnEGIJum szo+Ykhaei18sNqyeJ/3SMCaCb7GfzRBTRnUctTgvScmfn3pzcDivrTLLtk79lXG MMh6Ph+lbW0j4c0A5ZH4bFtHYevohVl2WYt9v/ajQevBj0flX62VeN1GmXX+GlQu eRO+TvL/gCBSQZj5kJdIPkzON42BnYIL60uadEg53X8qCld6oOWoa0aW3ACT9RVT PYARH5YQ8G8T+WtzJKNdXTzZ0WNwojpJg3wN1FldLip2lnb8+6v7tlAEvJGqGW1F 2HbH4r5GStVpO2L4cb2AH4w2K19W+I8aODt8i3RsPQgqbWPTwCLAz2DTjgnDIARQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeiledgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id F1E03E00A3; Mon, 2 Sep 2019 01:26:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-154-gfa7592a-fmstable-20190829v1 Mime-Version: 1.0 Message-Id: <83570e25-b20a-4a17-85ea-15a9a53289bf@www.fastmail.com> In-Reply-To: References: <20190902035842.2747-1-andrew@aj.id.au> <20190902035842.2747-2-andrew@aj.id.au> Date: Mon, 02 Sep 2019 14:56:38 +0930 From: "Andrew Jeffery" To: "Joel Stanley" , "Arnd Bergmann" Cc: linux-mmc , "Adrian Hunter" , "Ulf Hansson" , "OpenBMC Maillist" , "Linux ARM" , linux-aspeed , "Linux Kernel Mailing List" , "kbuild test robot" Subject: Re: [PATCH v2 1/4] mmc: sdhci-of-aspeed: Fix link failure for SPARC Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 Sep 2019, at 13:42, Joel Stanley wrote: > On Mon, 2 Sep 2019 at 03:58, Andrew Jeffery wrote: > > > > Resolves the following build error reported by the 0-day bot: > > > > ERROR: "of_platform_device_create" [drivers/mmc/host/sdhci-of-aspeed.ko] undefined! > > > > SPARC does not set CONFIG_OF_ADDRESS so the symbol is missing. Guard the > > callsite to maintain build coverage for the rest of the driver. > > > > Reported-by: kbuild test robot > > Signed-off-by: Andrew Jeffery > > --- > > drivers/mmc/host/sdhci-of-aspeed.c | 38 ++++++++++++++++++++---------- > > 1 file changed, 25 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c > > index d5acb5afc50f..96ca494752c5 100644 > > --- a/drivers/mmc/host/sdhci-of-aspeed.c > > +++ b/drivers/mmc/host/sdhci-of-aspeed.c > > @@ -224,10 +224,30 @@ static struct platform_driver aspeed_sdhci_driver = { > > .remove = aspeed_sdhci_remove, > > }; > > > > -static int aspeed_sdc_probe(struct platform_device *pdev) > > - > > +static int aspeed_sdc_create_sdhcis(struct platform_device *pdev) > > { > > +#if defined(CONFIG_OF_ADDRESS) > > This is going to be untested code forever, as no one will be running > on a chip with this hardware present but OF_ADDRESS disabled. > > How about we make the driver depend on OF_ADDRESS instead? Testing is split into two pieces here: compile-time and run-time. Clearly the run-time behaviour is going to be broken on configurations without CONFIG_OF_ADDRESS (SPARC as mentioned), but I don't think that means we shouldn't allow it to be compiled in that case (e.g. CONFIG_COMPILE_TEST performs a similar role). With respect to compile-time it's possible to compile either path as demonstrated by the build failure report. Having said that there's no reason we couldn't do what you suggest, just it wasn't the existing solution pattern for the problem (there are several other drivers that suffered the same bug that were fixed in the style of this patch). Either way works, it's all somewhat academic. Your suggestion is more obvious in terms of correctness, but this patch is basically just code motion (the only addition is the `#if`/ `#endif` lines over what was already there if we disregard the function declaration/invocation). I'll change it if there are further complaints and a reason to do a v3. Andrew