Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp475878ybk; Wed, 13 May 2020 05:11:58 -0700 (PDT) X-Google-Smtp-Source: APiQypLAO9KhEyBoBdJ+WTjEKeEdmAIr2ab5QbANdicBkTILOxU/vLcyqv78W5lyilGfAujpPuLM X-Received: by 2002:a50:e70a:: with SMTP id a10mr23097816edn.124.1589371918466; Wed, 13 May 2020 05:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589371918; cv=none; d=google.com; s=arc-20160816; b=uR00PnrT2Snr7ltYuUFdPO+v48JcD8yr4gSdFCl4UEpBlcMX5Y1oqJIDmjM9O5xWuu TFkaVAOUbF3G4MpnF7kb4fwdgGtX95T7R3t1usMfns7VFc9ImeIoIZr5XkERpRyr7HBd bSUh3MnN5wFi4MJyY8O5fFIDfL0vJ+pLry5MFJStoqgiDtzH1X1eN52SvJsQs3zxcgGE R8fmfKIsLTDS9t+2wAyolVKKP9dZFQvtXVFI/LazVK9LxDMkwD7ojU4ZV+Db3aagb3xM osLGBVCjJMfcGahFgxaTSIasYemIduGfZ27FCCLVBYWQZXU+L7FFTLmglKFjygSmZQpf K5bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=PfN+1L9TX9C4ZAadmHPkWkDCOj4NH1eTZGYGfKDgKdw=; b=f099uRvZIOQjpTTFQ1XkABofy9IUENSnodnMCwrM1dCFAf1mNpjjIGr+DdXDCuUzAV KnPOE/FEok7ZDtVUvHNANCPfPlhhTIau5ikRzJg7vljX2B7CrjKzxzz10TxTA+Ak7OY+ dVSGLGwVoQrocErvzB2uin/4lMQ9KdP1VdRkxpUJxpgAE7830gvKIG7Iq4Cy4Zzb4Qcx OJWcx9etdjwm9g75vOWV26/wA9ltblJLU7DrPWLABG+C5kJ6L8n4F2VIU5/0LJxTm4xu 2Ns41TxAhXv8RYuNfq8nDQtm1Eosh9ImyGvFOax3+yn6WaBHKH0l+fiAGbWktb1dEJig bBLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr18si11644443ejc.34.2020.05.13.05.11.35; Wed, 13 May 2020 05:11:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731456AbgEMMHI (ORCPT + 99 others); Wed, 13 May 2020 08:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgEMMHI (ORCPT ); Wed, 13 May 2020 08:07:08 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D12C9C061A0C; Wed, 13 May 2020 05:07:07 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jYqA3-0001gY-Hy; Wed, 13 May 2020 14:06:55 +0200 Received: by nanos.tec.linutronix.de (Postfix, from userid 1000) id BAED7100605; Wed, 13 May 2020 14:06:54 +0200 (CEST) From: Thomas Gleixner To: Jiaxun Yang , maz@kernel.org Cc: Jiaxun Yang , Jason Cooper , Rob Herring , Huacai Chen , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org Subject: Re: [PATCH v3 1/6] irqchip: Add Loongson HyperTransport Vector support In-Reply-To: <20200501092139.2988670-1-jiaxun.yang@flygoat.com> References: <20200422142428.1249684-1-jiaxun.yang@flygoat.com> <20200501092139.2988670-1-jiaxun.yang@flygoat.com> Date: Wed, 13 May 2020 14:06:54 +0200 Message-ID: <87a72c3uox.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jiaxun Yang writes: > +static void htvec_mask_irq(struct irq_data *d) > +{ > + struct htvec *priv = irq_data_get_irq_chip_data(d); > + void __iomem *addr = priv->base + HTVEC_EN_OFF; > + unsigned long flags; > + u32 reg; > + > + raw_spin_lock_irqsave(&priv->htvec_lock, flags); No need for irqsave() these functions are called with interrupts disabled. > + addr += VEC_REG_IDX(d->hwirq) * 4; > + reg = readl(addr); > + reg &= ~BIT(VEC_REG_BIT(d->hwirq)); > + writel(reg, addr); > + raw_spin_unlock_irqrestore(&priv->htvec_lock, flags); > +} > +static int htvec_domain_alloc(struct irq_domain *domain, unsigned int virq, > + unsigned int nr_irqs, void *arg) > +{ > + struct htvec *priv = domain->host_data; > + unsigned long hwirq; > + unsigned int type, i; > + > + irq_domain_translate_onecell(domain, arg, &hwirq, &type); > + > + for (i = 0; i < nr_irqs; i++) > + irq_domain_set_info(domain, virq + i, hwirq + i, &htvec_irq_chip, > + priv, handle_edge_irq, NULL, NULL); This wants curly brackets and the second line of arguments wants to be aligned with the first argument: for (i = 0; i < nr_irqs; i++) { irq_domain_set_info(domain, virq + i, hwirq + i, &htvec_irq_chip, priv, handle_edge_irq, NULL, NULL); } See https://lore.kernel.org/lkml/alpine.DEB.2.20.1701171956290.3645@nanos/ The alignment of arguments wants to be fixed all over the place. > +static int htvec_of_init(struct device_node *node, > + struct device_node *parent) > +{ > + struct htvec *priv; > + int err, parent_irq[4], num_parents = 0, i; Please order the variable declaration in reverse fir tree length order: int err, parent_irq[4], num_parents = 0, i; struct htvec *priv; That's way better readable than the above. All over the place please. > + priv->htvec_domain = irq_domain_create_linear(of_node_to_fwnode(node), > + VEC_COUNT, > + &htvec_domain_ops, > + priv); > + if (!priv->htvec_domain) { > + pr_err("Failed to create IRQ domain\n"); > + err = -ENOMEM; > + goto iounmap_base; > + } > + > + htvec_reset(priv); > + > + for (i = 0; i < num_parents; i++) > + irq_set_chained_handler_and_data(parent_irq[i], > + htvec_irq_dispatch, priv); See above. Thanks, tglx