Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2087698ybe; Tue, 3 Sep 2019 07:50:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrzo2wXEV6torDA04IMKO8cCQmVRnbw9TIIB0o7A8NhyqIPoD+XzsP0ykTPVtC+LKeYBzE X-Received: by 2002:a17:902:a70c:: with SMTP id w12mr36298555plq.288.1567522224959; Tue, 03 Sep 2019 07:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567522224; cv=none; d=google.com; s=arc-20160816; b=f06WlRj6c2ttN4StPrLiR2/ellJRj/NZ3pxfd5B4vrgk4+VvyMIRUQFVq0Z8nhEsd4 UbzXgcccjxJf4gt3wPxdSoByAq51xN1axUdVQkPM0O2we/TApOeLHNmWNXwdWbHl/Blh SpgnFKTcQEp5LEg22Ed4JEuq0IbokeoHxR0s4JP0nA5ly4K0o+HKck0ZV81M8UsX3pnP e/19qj1h7YHs8vtzTSa9u1iB46Z9mlFqPXJKdYAq6dZ9GPdb1uL2Y1OI1dyhUb41QNZM eIp1+t/1EytTJrJvfyeptUEepQMmCqFwi9cDy9H3WhawYpNHRD2VHZ9JbzSpZtPvV00E 2cFg== 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=CQLkGwKQ606SBhDXYVZ/wIEqALYPfmqGkU+b2OoxSog=; b=ZUWRI8kB3MrZwDSS6rcm9K2NARGQKvbS02WOcdsRKhFfiPUKU490h9heO35HQubYMN 6N+d0/TZ7cVSOKmN83batHf4kSmIeVA3m06o+flz7RGPyejSSjYIBGYK8L+UD41UffKM +SZxEuCDCea4w11RbT6lwgR9WMZgyCL3Ms0QJ0IzY1XZYNLYTkDP3zKWr4FPP7ntijtJ j/u295RQD4BnvhtT9w8y9cEWqvJ8Ignrp4gvJjwKQ+ixkPNfXrCnnpTy4jtK+dYUECA1 AgjvLC0Dtvcm0+0as09d+d4KjOjTbIpMFezcMQXUOd1mXuIO3Zx6zRuPSV3lxI7B6lu3 mdGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KHMycYhG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si15690579pgr.297.2019.09.03.07.50.08; Tue, 03 Sep 2019 07:50:24 -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=@linaro.org header.s=google header.b=KHMycYhG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729273AbfICOtK (ORCPT + 99 others); Tue, 3 Sep 2019 10:49:10 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:33257 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727667AbfICOtJ (ORCPT ); Tue, 3 Sep 2019 10:49:09 -0400 Received: by mail-vs1-f65.google.com with SMTP id s18so4422328vsa.0 for ; Tue, 03 Sep 2019 07:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CQLkGwKQ606SBhDXYVZ/wIEqALYPfmqGkU+b2OoxSog=; b=KHMycYhG2Y7WHnw+EuBG4+CdLshJqNlVA/OT7aQHdigAAwCUgOApY5f6VL8hxznVHt JWNHYAo+S/rFPORr1CpNVbINUk7JIin6Cs1Eka7rCL2nl1w8qq1M62XggCgUaMnURSGi 33Oxu+V3NVbtK/KbO0KIxVVKWLIUBG/xGRC3O2XMyB5CHGA2T0QKNWsoBVGadGaRruof zbTrQEfkXyKf/QmAgHwUZzOXzdt8Q40N3Kqe+pKJCALXF9OTCRj3gDDfT5/MendnZxVy Blc7JYR/GDFBtqv0NhshUYQInCUje++lKyDQQ5ZUTusnBi8U/Wal9R+YCiFUZ8FMUpDz 3w8Q== 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=CQLkGwKQ606SBhDXYVZ/wIEqALYPfmqGkU+b2OoxSog=; b=fHyy2XmWH84BUcT6jlIPcQiwQDMTqEd9SVeHXrDRfqNUWcSJbTH/VpQrXs0sxxZvAk yMEqTZj9anZKOvDMkHS7B9g7gBQ8Nt986bE/bWt5/pIVy3q30tDXPmaxGnya1gIkMuYY CndvR5KlOQC+PZ5qf40VRaMUd8z/Ck0e1qo/UB5uSG76JYMDHYxIwKpLrk8OnLZP6ZAi oYr2YhBvjBQ/7+Lv+rPobChs3fRw2F6ZRGFYJciFb8BhcB3gmQ17K8Lb0IEbBOawiBPq j/P2kZ2At6Oj96gqucOGy/IEEx611Kfx9AEEMd/b3gzLaX2MA+d63SzPHJq+W1cfU2GP bdAw== X-Gm-Message-State: APjAAAVQxVfDx5E4kZJIAddJCiua1lIwCRGQNvN1fMMwwZO56j3CWsTx 1HpdGeTM0C5TsoJ3LielUqmccfyHzhsyNHq5HHvjKw== X-Received: by 2002:a67:fe4e:: with SMTP id m14mr19402036vsr.34.1567522148468; Tue, 03 Sep 2019 07:49:08 -0700 (PDT) MIME-Version: 1.0 References: <20190902035842.2747-1-andrew@aj.id.au> <20190902035842.2747-2-andrew@aj.id.au> <83570e25-b20a-4a17-85ea-15a9a53289bf@www.fastmail.com> In-Reply-To: <83570e25-b20a-4a17-85ea-15a9a53289bf@www.fastmail.com> From: Ulf Hansson Date: Tue, 3 Sep 2019 16:48:32 +0200 Message-ID: Subject: Re: [PATCH v2 1/4] mmc: sdhci-of-aspeed: Fix link failure for SPARC To: Andrew Jeffery Cc: Joel Stanley , Arnd Bergmann , linux-mmc , Adrian Hunter , OpenBMC Maillist , Linux ARM , linux-aspeed , Linux Kernel Mailing List , kbuild test robot 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 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. Kind regards Uffe