Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp90806imm; Tue, 9 Oct 2018 14:22:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV61d2sOEErf5ObivedZHoqGEUp8qro8O+mfZilfrHmsbvm4vgR85zMyt9qFNBVQ0OqZjpE/C X-Received: by 2002:a17:902:6848:: with SMTP id f8-v6mr30684063pln.27.1539120141921; Tue, 09 Oct 2018 14:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539120141; cv=none; d=google.com; s=arc-20160816; b=lT0jWZEFX/6enWR8jePksiw6SAMY+ci1WTAjvfS5UgnZyQRhVZDLpPvpCUF3/jCXyv J0rAcbNqZ4hmE/W56nJdtC6hB/giFmikNCQ6H+/sMIx3NaanxVVG2+ZYNS0eIeOWX8Sx NAh0vMxqT1ztVqBivKzZY6bOfQUkj1FuJOQhw9BzaUu2eJtrxGv/SLr180nvfZgvu4fC wA5PaWN/piAG6Nzmb29YEvJvcCNFeabCzD/KeGb+r83HZ88yqSuOsPRN4G96AkKRKKt6 zb6OsM6r3gHUbz1m0g08ivacBGpit07TMZQxh9QZA3aypDejo5f7Mbwn+LRjuZ0Virzp +ejw== 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=v5ciEMf+aCSnmC9e0ONNg/Tz2rbqR3jUBoCkBZshx30=; b=DnQSRWp43/naOgofys46jfvFBeIRrONUFoLgCw3YapHAbXuox4S430L18Y/tFQcd1H YWN35WqmHO7vWo2esAxEdu1t36KaJsU/Td0WhO3SOTb4LJprD6zo4ScADGXPw3tmHTTn n57ywbusfJo51sx/O+hoRz5JUvVjq4TCb1Cf9hTyTl8kHoMMiOxJ/WMUnTGwFHwe/IVu uTXAf5aKVwP5DN6jAMBDIGYt4Cf0EBnBP0e62qvgEp4eq0H2nZY7y5X57fvxgTuelP+y WoTpPDpx0y9hyZvCcOgjh73eztLQ+y3m8y3mXFbIztF5UXC0F8QSk/McuBEG+qfVamh2 zbRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bL9oPMTO; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o127-v6si13021340pfb.128.2018.10.09.14.22.07; Tue, 09 Oct 2018 14:22:21 -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=@chromium.org header.s=google header.b=bL9oPMTO; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727691AbeJJEhb (ORCPT + 99 others); Wed, 10 Oct 2018 00:37:31 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:37550 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbeJJEhb (ORCPT ); Wed, 10 Oct 2018 00:37:31 -0400 Received: by mail-vs1-f65.google.com with SMTP id r83so3023364vsc.4 for ; Tue, 09 Oct 2018 14:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v5ciEMf+aCSnmC9e0ONNg/Tz2rbqR3jUBoCkBZshx30=; b=bL9oPMTOBpeALiLaJnFVBx7FpQKX562+IRDjrfpeR2yxqmbIIagfvkMSrtka/oyWJS 0Q7E+F9B8YuWBKAyLlLRWuPHeD2PFi4dVdakjRVUnHvv14b+e/N9e9hvLnCAli9jniW/ 50LRxqUoMpn0+blZVG3KRAMVVoSEg+TbNncUs= 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=v5ciEMf+aCSnmC9e0ONNg/Tz2rbqR3jUBoCkBZshx30=; b=g+V2fiqahUAQ/0lrz4ieZK3TTZKzJbTkHG67MUBBmj5YE6wn+sNGHK2f/gl2XXwcM1 EkjLO9i7w27k3alYQ4UCzIHT69gkapkVrJVOEqRr3ie94ZdnUxgTzf3l8DsYQviOUKDc pgbAOf9NPE6P4FZaVuTsh4VvWIqOcv/KBI6POYFd7tEaP2nWW5TE0wWSeAU0FshM4teH PZEPtbq2IhADLxR7fC5hGekgaHAFuXf6OiIUF9JqbqVIZJ/eY1JXVc+Vbp833B6CifwL uQAhGecUFzNmn13xIBtbgkG933l5peeTrP8R8vM4qYK0Qwu7DqsxqTzvwJ6t+SwPHRcG fYlw== X-Gm-Message-State: ABuFfojZXV1Df1GikynH3hXh1oTW7OvbGrioyH2HWJ//5HmSqiEXcET+ kkV/1XkRrUZcIU//2gaq+6255cVC+ig= X-Received: by 2002:a67:3bc9:: with SMTP id l70mr8297287vsi.44.1539119919223; Tue, 09 Oct 2018 14:18:39 -0700 (PDT) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com. [209.85.217.53]) by smtp.gmail.com with ESMTPSA id e79sm2692757vsd.1.2018.10.09.14.18.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 14:18:37 -0700 (PDT) Received: by mail-vs1-f53.google.com with SMTP id w1so3012516vsj.8 for ; Tue, 09 Oct 2018 14:18:37 -0700 (PDT) X-Received: by 2002:a67:8316:: with SMTP id f22mr7634218vsd.6.1539119917355; Tue, 09 Oct 2018 14:18:37 -0700 (PDT) MIME-Version: 1.0 References: <1538574265-30235-1-git-send-email-alokc@codeaurora.org> <1538574265-30235-4-git-send-email-alokc@codeaurora.org> <153904219713.119890.7463642233895152532@swboyd.mtv.corp.google.com> <153910152600.119890.14820584405992384926@swboyd.mtv.corp.google.com> <153911433511.119890.17831207059115471972@swboyd.mtv.corp.google.com> In-Reply-To: <153911433511.119890.17831207059115471972@swboyd.mtv.corp.google.com> From: Doug Anderson Date: Tue, 9 Oct 2018 14:18:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V5 3/3] spi: spi-geni-qcom: Add SPI driver support for GENI based QUP To: Stephen Boyd Cc: alokc@codeaurora.org, Mark Brown , LKML , linux-spi , Matthias Kaehlcke , linux-arm-msm , Girish Mahadevan , Dilip Kota 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 Hi, On Tue, Oct 9, 2018 at 12:45 PM Stephen Boyd wrote: > > Quoting Doug Anderson (2018-10-09 10:48:55) > > > > Ah, you're suggesting separating the platform_get_irq() and the > > request_irq() so that we call platform_get_irq() as the first thing in > > the function but don't do the request_irq() until later. Yeah, that > > could be done and I guess if you feel strongly about it I wouldn't > > object to the change, but I don't feel it buys us a lot and I kind of > > like keeping the two next to each other. Specifically why I don't > > think it buys us a lot: > > > > 1. You still need the "dev_err" print, right? platform_get_irq() > > doesn't automatically print errors for you I think. > > I usually leave it out. Who cares? Maybe we should throw a dev_err() > into platform_get_irq() on failure so we can keep drivers cleaner and > reduce a bunch of "can't find my IRQ" messages throughout the kernel. Yeah, all the boilerplate code is annoying. ...of course by hoisting it up then you get a whole bunch of people that have "optional" IRQs suddenly getting error messages spewed which is also no good. IMO the convention of Linux drivers I've always reviewed is to print errors like this, so unless that changes my vote is to follow convention. > > 2. You now need a local variable "irq". By putting the > > platform_get_irq() before the memory allocation you now can't store it > > directly in mas->irq. We could try using "ret" as a temporary > > variable but that seems worse in this case since it'd be a bit > > fragile. > > > > 3. You don't get rid of any error labels / error handling so we don't > > really save any code > > > > When I tried this my diffstat says 8 lines added and 7 removed, so a > > net increase in LOC FWIW. I'm relying in gmail so my patch will be > > whitespace-damaged (sigh), but you can find a clean one at: > > > > https://chromium.googlesource.com/chromiumos/third_party/kernel/+/e0325d618e209c22379e3a4269c14627b19243a8%5E%21/#F0 > > > > ...the basic idea is this though: > > > > Thanks! Here's an updated patch that I haven't compile tested in any way > that hoists up the IO mapping part too, which shows that the 'se' local > variable is almost entirely useless. Yeah, I'd be all for getting rid of "se". I'm still not really seeing the benefit of hoisting all the rest of the stuff up. Do you feel strongly about it? In any case I think we've both said that all of our comments so far are just nits and could be addressed in a followup patch. Unless Mark Brown wants these nits fixed ahead of time or has other changes he'd like, I don't think we're expecting another spin of this patch from Alok or Dilip, right? We'd just expect them to post some follow-up patches after Mark lands it? -Doug