Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp198020imm; Wed, 11 Jul 2018 00:25:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdZv6sw6IbAnyU2e1tNNb/W2Q/Oye6f+EhYeq9FYhkF9GwiUDhYJ4LvpOjZR9fZE0Durm+a X-Received: by 2002:a63:743:: with SMTP id 64-v6mr26339701pgh.216.1531293927068; Wed, 11 Jul 2018 00:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531293927; cv=none; d=google.com; s=arc-20160816; b=nfdyFkZ2NMxPhHnvHawGFnGRnBNuEhwQIOdzQJry8lsO8WrImj3LHZYVe4jyw37X7C kWx/U3aOzW9YehMEmH2KtuzR/cLg+LgP4OhVPLGLE5eH9LkKnZhafRkg9m+KytWxyqIO vJa6e9lvVehAtPV6xJM+W6pIEHMsSLa3rk/wy4j+zf8tGBRsjrmbC1UY3nnXqNG4bBaP 14R8XHrL0gF8/fOgzAmxUCaCBN4Qimp974UtnXeakUlYlH4aQ28kq8nOgpFAk2jrbqYT EjwKFA7OQUMD5H4rRJCBp0rTVOtthZ9eRZg77gK+Buc1Qt/f2OTthvuAf2FtP+5ztwnX H8kg== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=6kqBGmdqqsi0A/rQyOXB4uOi+kXF7fjB/fSTA1rqEDk=; b=XMpn0se7ZtBLmloHxyWvN8nF+VPEFil5BUP8NU3e7An8BsnodhNOo+QHpFycl0lkh/ GZ/4RAEDVE5pl8mdEcWt7VRwxYlpMtT5dDtdYsdvn3LHYTynV0P7yvD6Yc7M43jXkUUx VBaV3OZXZH/L09JKHeLMFJihnfgkQGqUCc2mNpgqPNaFwfeORCAmpd3yOqKLF4oyOGnX cxhINj45FqZEMA3uE1zFe3ERCulz+0Mo1cemThUUFKcRp/+bXryaZLA6+AK5PJ2nFWe9 cr5yZDWq2yumWj3buozH5q3MW8kJdZ2XqCnYR1Vt5KwE1EpyuHH5is1qzWqg0d3FPtOL nDmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=flLMiwCd; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si19623290pfl.220.2018.07.11.00.25.11; Wed, 11 Jul 2018 00:25:27 -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=@gmail.com header.s=20161025 header.b=flLMiwCd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732254AbeGKH0V (ORCPT + 99 others); Wed, 11 Jul 2018 03:26:21 -0400 Received: from mail-ua0-f194.google.com ([209.85.217.194]:43772 "EHLO mail-ua0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbeGKH0V (ORCPT ); Wed, 11 Jul 2018 03:26:21 -0400 Received: by mail-ua0-f194.google.com with SMTP id x24-v6so15587815ual.10; Wed, 11 Jul 2018 00:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6kqBGmdqqsi0A/rQyOXB4uOi+kXF7fjB/fSTA1rqEDk=; b=flLMiwCdkPX/Z/3kMO+tDMCIHAg16nicRYZfEe3Fkrd45XpNokUB0Uf+43Qov5ryQd tci4g636MhJfD8q/7pat54t1q7J636S+NOgQWBaLDdRgF74V90hnKTzL/1hA0LidSx7a 4hYEae8ANMMyvwt2Xxu3nwTKNLbH4VpC+7fdWueLyIUMK1iOf9Td4QcUsRy2o1s8ZTO+ l/0Ukx8wZ7NaMPqKd+WgiCW+FFd9MGS36fTRGMVztSBdmSUg3ObG/2moYaepgc28oTb9 KNOp3d7W1PJM6ZgQ+8co3LwdF8NjqUYDSp7tRV7dI8KCvk53tkvWShpflzkgUVM5MXwJ 9kJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6kqBGmdqqsi0A/rQyOXB4uOi+kXF7fjB/fSTA1rqEDk=; b=sV131P5aNP6D4wDh7h2hRfCprR5GTkAd0ibImn/IH41xqR/JneQ4eMBGGDiThxCfIJ hgBULShZ/WZMH1Enl4lKV606aUh7Hc4bwmYXRBE79AI50Vn6LL43f2pvfifunG61BtUX zQYYU/6YKlHJm0RIbc3L4f4LGJWGFawtLSiI15mOYW17ZuwSQ5Ec4Cn2gFjHpIg+LpWh KM7r8dnBSqrtH4fb+YI4wsb14ap5+nOx7H511AXqIpdWYMDAQydL5GGCSykHTi/nSBRu QR+/MdbappK/4HFlZeb49Yz3564sFiNQgtUyIJjLCDyHCtDL6pRa+TvjLQrtGDICeSkP sZfw== X-Gm-Message-State: APt69E1acjKXhhDKTL8jguDiy1n0sUWawvpQZViMd4EjHieQigINy4AA vfXJljWPYv++8GxywYoclQIRGfLsVTkHml367Yg= X-Received: by 2002:ab0:6037:: with SMTP id n23-v6mr17372945ual.28.1531293809427; Wed, 11 Jul 2018 00:23:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 11 Jul 2018 00:23:28 -0700 (PDT) In-Reply-To: <20180711065724.128299-2-songxiaowei@hisilicon.com> References: <20180711065724.128299-1-songxiaowei@hisilicon.com> <20180711065724.128299-2-songxiaowei@hisilicon.com> From: Andy Shevchenko Date: Wed, 11 Jul 2018 10:23:28 +0300 Message-ID: Subject: Re: [PATCH v6 1/1] PCI: kirin: Add MSI support To: Xiaowei Song Cc: Wangbinghui , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , linux-pci@vger.kernel.org, Linux Kernel Mailing List , Suzhuangluan , Kongfei , Yao Chen 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 Wed, Jul 11, 2018 at 9:57 AM, Xiaowei Song wrote: > Add support for MSI > +static int kirin_pcie_add_msi(struct dw_pcie *pci, > + struct platform_device *pdev) > +{ > + int ret = 0; > + > + if (IS_ENABLED(CONFIG_PCI_MSI)) { > + ret = platform_get_irq(pdev, 0); > + if (ret < 0) { > + dev_err(&pdev->dev, > + "failed to get MSI IRQ (%d)\n", ret); > + return ret; > + } > + > + pci->pp.msi_irq = ret; > + } > + > + return ret; > +} Like someone already noticed, is it really IRQ number you would like to return? If you rewrite like int irq; if (IS_ENABLED(...)) { irq = ... if (irq < 0) return irq; ... = irq; } return 0; It would be slightly more explicit what you do and what you return. -- With Best Regards, Andy Shevchenko