Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3006184imu; Fri, 23 Nov 2018 19:12:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/XGo6f8dnNc2ylK76VXj8XQTz4h5OBpXhxb50i8aRVOCGx+B2rrzQSIUJAOQHCFhspv+b7F X-Received: by 2002:a17:902:43e4:: with SMTP id j91mr17948408pld.147.1543029127092; Fri, 23 Nov 2018 19:12:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543029127; cv=none; d=google.com; s=arc-20160816; b=y0naGY8whv04RlszZgTAOG6bcxcowvRWavm37FEcLc1MlH6mbeB4zEloU0hfBhAgUh M76pdgQNvt/JJGbXBr0PMu6wvEXmoS7rEFN4f8HmB/J1t8h86JZmk5S3pJDj+wJ31Equ dUjLshbzoP1FjZjAUti/MhWytgJILgez/BFiaCYinBIKLuHBvOg17C5HaZDS/KVEzon7 q2mg+/4IXiHMvKtuI1YLx1OmyFKupGnIosvnzcPunAKeW/Ig26FL3pHcyUJqJWqxaZ3m Z8kJrK2JqS4u4GK2LaVIxxyUUfTvnH2snyIDJGD3q2EiuZ5A+a74nWSWwruMZf6kS7iR Hrqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uclV30uABFHxMS3jI4BRBXbhUftQ0zLtISjnlOnvMhU=; b=N8ULP7hv2mJlOIbk7za53LoTtQ+opYjTJRgO5MLamuRvtikbUHD9Ca75fS5+fRmrCL z6dsZCOoUAsRfjWrLyPz58Xt6CYlXA4l3HmVwyyBH8erTD2c+ODK+g3+kYnbM7yTgNhi MZi4iiWODyIaeI4XKOpKM4YfczE21LtFkbPYRDTuOikfhb2Xmjwbj0CbGjplxZvld9YR y60dmBo/1ah669cCL6gnxK99jlCYPAhsPH02G1so5IzuKSDg6mWYBZ2s72pMvJWOesd8 6BvF24/+/25cP/fmVK8SEZg/TDkWY7Ql172pFJ2rIS8fA5TTz9de8mqDl3HqbPmgZvjg OgSA== ARC-Authentication-Results: i=1; mx.google.com; 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 d25si43876982pgd.88.2018.11.23.19.11.16; Fri, 23 Nov 2018 19:12:07 -0800 (PST) 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; 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 S2438037AbeKWCjx (ORCPT + 99 others); Thu, 22 Nov 2018 21:39:53 -0500 Received: from mail.bootlin.com ([62.4.15.54]:33448 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438023AbeKWCjx (ORCPT ); Thu, 22 Nov 2018 21:39:53 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 7001820DC6; Thu, 22 Nov 2018 16:59:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 4287B20712; Thu, 22 Nov 2018 16:59:44 +0100 (CET) Date: Thu, 22 Nov 2018 16:59:44 +0100 From: Maxime Ripard To: Mesih Kilinc Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-sunxi@googlegroups.com, Chen-Yu Tsai , Russell King , Daniel Lezcano , Marc Zyngier , Linus Walleij , Icenowy Zheng , Rob Herring , Julian Calaby Subject: Re: [RFC PATCH v3 05/17] irqchip/sun4i: add support for suniv interrupt controller Message-ID: <20181122155944.vkx2u4iwwedheor2@flea> References: <08b40429e46626f4caf8e4d2287b5c4d354e3b7f.1542824904.git.mesihkilinc@gmail.com> <20181122083547.srnopylueqx6p2qj@flea> <20181122150200.p6e22sp3v4npb42w@ThinkPad> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="h2z3qr6y2agvh63m" Content-Disposition: inline In-Reply-To: <20181122150200.p6e22sp3v4npb42w@ThinkPad> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --h2z3qr6y2agvh63m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 22, 2018 at 06:02:00PM +0300, Mesih Kilinc wrote: > > > diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c > > > index e3e5b91..7ca4a4d 100644 > > > --- a/drivers/irqchip/irq-sun4i.c > > > +++ b/drivers/irqchip/irq-sun4i.c > > > @@ -28,11 +28,21 @@ > > > #define SUN4I_IRQ_NMI_CTRL_REG 0x0c > > > #define SUN4I_IRQ_PENDING_REG(x) (0x10 + 0x4 * x) > > > #define SUN4I_IRQ_FIQ_PENDING_REG(x) (0x20 + 0x4 * x) > > > -#define SUN4I_IRQ_ENABLE_REG(x) (0x40 + 0x4 * x) > > > -#define SUN4I_IRQ_MASK_REG(x) (0x50 + 0x4 * x) > > > +#define SUN4I_IRQ_ENABLE_REG(x) (irq_ic_data->enable_req_offset + 0= x4 * x) > > > +#define SUN4I_IRQ_MASK_REG(x) (irq_ic_data->mask_req_offset + 0x4 *= x) > >=20 > > You shouldn't have all the values you use passed as argument, so > > irq_ic_data should be one of them here. > > > > Could you elaborate it a little bit? You should change your macro to something like: SUN4I_IRQ_ENABLE_REG(data, x) ((data)->enable_req_offset + 0x4 * x) That way, you are transparent about the parameters that the macro expects, and don't rely on some unwritten rule about the variable name. > > > + > > > +static int __init suniv_ic_of_init(struct device_node *node, > > > + struct device_node *parent) > > > +{ > > > + irq_ic_data =3D kzalloc(sizeof(struct sunxi_irq_chip_data), GFP_KER= NEL); > > > + if (!irq_ic_data) { > > > + pr_err("kzalloc failed!\n"); > > > + return -ENOMEM; > > > + } > > > + > > > + irq_ic_data->enable_req_offset =3D SUNIV_IRQ_ENABLE_REG_OFFSET; > > > + irq_ic_data->mask_req_offset =3D SUNIV_IRQ_MASK_REG_OFFSET; > > > + > > > + return sun4i_of_init(node, parent); > > > +} > > > + > > > +IRQCHIP_DECLARE(allwinner_sunvi_ic, "allwinner,suniv-f1c100s-ic", su= niv_ic_of_init); > >=20 > > You can even split that addition to a new patch as well. >=20 > OK. I will do 3 patches. First one will add a struct that holds only > base and domain. Second one will add register offsets to that struct.=20 > Third one will add f1c100s support. Is that ok? Sounds perfect :) Thanks! Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --h2z3qr6y2agvh63m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCW/bScAAKCRDj7w1vZxhR xeTNAQCVVvFSY83AwPAdDSiPgA7y2KdvvK38YF4s6yokph6yXgEAh+yXGenXIuaz Bx6K/lyvdgkoeZ2bStF5yFF56RD8HwQ= =FloS -----END PGP SIGNATURE----- --h2z3qr6y2agvh63m--