Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp28613ybe; Tue, 3 Sep 2019 17:03:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLTYB+uk6qS6Yn/x0r4/FDhMAJQ2i8llqZxp8PtFHczlJK7JTlrMx1t4gcI+GxLlFkYIJh X-Received: by 2002:aa7:90c1:: with SMTP id k1mr42024017pfk.46.1567555412773; Tue, 03 Sep 2019 17:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567555412; cv=none; d=google.com; s=arc-20160816; b=HlcseTLH5zpSEqC0PAor3bHv53iJ3Ig0zDD1OWOHjd8gh8WTcmX0CEJ/KyuTV9Y7fL NgLvICNdVUrjarCEB7y0nTp4GVPyBqOqcyrzVJRoJRolGMOM/VV2f0fKS9Xlcf21nfs/ ldyGfBo8fq3a0+KFTtAZYHtuqeSQQZMuK1UYZNbayvPsPwJlEYp9+w/er8wW0vsNYleG 9YI5TTqH3n9o3TO0l6q+BitZovHU8B/w/ChCXcbb8pNQgCiD4/bdIpjM4JgWcxcgCRfH gBudLs1B+ZsM20YKzguohVFvajJCzy4Dhu77eSbNszvAV1vPgXOLkcYXY+RUtEsvgH18 22Aw== 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=e2m08tJLme9DAXqhOo/SiutMgnTWzRV5kaLQ5K1ekAY=; b=SNfvE6L5M6bth7euPOboXnVhuKRiee5nBhxMe8g3TARX8ePs0CM2knqOHTepSkKwHw Qdr8SwmQLQ4NinR+W/xh2f+FJtuc4z5xSOPzzlfutUkM9YIsn8bwvpMxNBI+mnOapEsL P8GHJ6icrYBa/9qXLdskhDTUuiue78PCFQ1W1H5u1W4B8CB1cGMZumR+ztjAP1999JiI 61J+uXl5KZE5leTE4mMESu4WdB0hp0qptI6O9DMHoRtDTrncfC21ftu29IN1eu/7T3O2 Mon8Z2pD9usF0tmAKd3y4MWcroQ61HiCtePNmzqF3w+oGWK+P85ub5B71aqzAQGFrOIO nu/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm3 header.b=nzDjn94z; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TP9LTiUr; 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 a5si15697035pgw.454.2019.09.03.17.03.16; Tue, 03 Sep 2019 17:03:32 -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=nzDjn94z; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TP9LTiUr; 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 S1727590AbfIDACX (ORCPT + 99 others); Tue, 3 Sep 2019 20:02:23 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:58325 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfIDACX (ORCPT ); Tue, 3 Sep 2019 20:02:23 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 616A04EC; Tue, 3 Sep 2019 20:02:21 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Tue, 03 Sep 2019 20:02:22 -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=e2m08tJLme9DAXqhOo/SiutMgnTWzRV 5kaLQ5K1ekAY=; b=nzDjn94z9twTnGbhrKJ/a73kjcHrGTL9VWrGlAJuPT6XS2b ghrJMcXU8s6VbgR17WvlJaho31+Eh/OQwEkyj0vYFsgn2UHXgny78fRx/LjbptIS MhA1CSzESkwlAeP5Akm6WDmDXiJ3OlqUq8jF1jq5Wc+/9RgOQAALIOwcRzYqpCcV By30GqX5fXYxyOKKlqg7YrvUE+e+W4BpDRYZIG93ILZPheSplnh+9ldj3A05OMuV 5T2pyhvcZZ/wHOBYb/4ivhjA+AtQ2iaUdRYaMG/3dE0frBQ7oMNKk41qtCH6V7xw Nmehft5ZwLynGIrFxHg0s6gAjW4j3Xq8czo2qpg== 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=e2m08t JLme9DAXqhOo/SiutMgnTWzRV5kaLQ5K1ekAY=; b=TP9LTiUreJY4bZLWzMJ1fk oTwdGNuCbqXjxZX+qj8doMbEAr4qwhNPd0ogE7rUnt3pj6MUxznpkmNGE3Na2iW7 IuqYY92EMFrTnCEf3MENAU2Ob/jtroq4uJY8zWCf8ntpoRF35EejGSJ0Uxp2TI65 IOC7h3GDw/zy0DamxQ00nV8D2qxIDjzCRa7554IGJTw+rUCFqNzmmw0RTqjaRVDQ ruU6uRB5l0LFQ9nwEgO87wSKTK31bHvsmH9KOOhGVNjLZRmdi2ZifZtBY1C//NRh Cj/v+pJU4ujHPC5+kayV9O6kokfdKuFCCB2IwIQ1uXlyonfmdHDcAUshtV75jNMQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudejgedgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2A685E00A3; Tue, 3 Sep 2019 20:02:19 -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: <38ff59e7-491b-478b-afff-a664d8f66547@www.fastmail.com> In-Reply-To: References: <20190902035842.2747-1-andrew@aj.id.au> <20190902035842.2747-2-andrew@aj.id.au> <83570e25-b20a-4a17-85ea-15a9a53289bf@www.fastmail.com> Date: Wed, 04 Sep 2019 09:32:44 +0930 From: "Andrew Jeffery" To: "Ulf Hansson" Cc: "Joel Stanley" , "Arnd Bergmann" , linux-mmc , "Adrian Hunter" , "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 Wed, 4 Sep 2019, at 00:18, Ulf Hansson wrote: > On Mon, 2 Sep 2019 at 07:26, Andrew Jeffery wrote: > > > > > > > > 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. > > I am in favor of Joel's suggestion as I don't really like having > ifdefs bloating around in the driver (unless very good reasons). > Please re-spin a v3. > > Another option is to implement stub function and to deal with error > codes, but that sounds more like a long term thingy, if even > applicable here. No worries then, will post a respin shortly. Andrew