Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp462713imm; Tue, 3 Jul 2018 23:44:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfvjKXSHZ6GC93UFISkmBkDR127IrTLnllreA1AVZQhJ9zmYDl5szRjRFhv3e2Fgy8i9913 X-Received: by 2002:a63:2ac4:: with SMTP id q187-v6mr756298pgq.333.1530686664573; Tue, 03 Jul 2018 23:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530686664; cv=none; d=google.com; s=arc-20160816; b=JDAXcEBjHUGCBwmZ5exew6iBTuM2xZdmInmGwvu0bvIBBrOypMXY6SogpV+pC5Jc+j 0MougqQzxmIgHN9mL3bhBg2D5st7AQjwnJQWtqyAXgYD2HMSuBPO7eI9wXRdEON4sGY0 QnEUhlyVX2e1u0cmk0pqedDbpLfxIHeuJT07/XFAzOLt6NiE3VAYoTtWa3H4tQvVNyJ7 Dp9pzXxU2layy0J7IajGKoFxsuJCLE3PjgiQCaugrTI8ZBo2TdCueOCMQqdAS4QvaBuH pWkJG+JOxbF1/aICR9oB4qcsE0BxBqy93UOGiEnYjDJuiVbGYs+TqWkhf9/FV+BWC8YK rTDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=vQtSapXYVuffk2hpc6FGt7ZIR1zPSCzCT975bJZXz+g=; b=kbx3zH0Ys3t7zEC6dAFTMdDANkLPhUou7uTeGfsiFBcvaC5oRfrmsm6xZWjQb8lYvV ayKEizMZIzsuvamVLPFyOE2u4yr2H6AuPk3u1LqIOEx7nH3FT5rErPUylrzey0CN0991 QyLf7Ay+tVNffDWWNOBWikUpbQHy0bYnRNevlGEmwZnSndGfwx/1PcThn42F/SRauZWB tnKfL9eNuF7sLZQpqCaR8vzLhiXnHs56KWj7SlVgyY2x1EKcVOqlZYB5TfENZ2percH3 qlCz5zovEQzAAeB0lLHG0eKC0IBYjNkg1YRtSdXVofWuQMaFj4KO/25ZQ7AHYkYiKOkH f35A== 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 x17-v6si2797188pfi.329.2018.07.03.23.44.10; Tue, 03 Jul 2018 23:44: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; 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 S933578AbeGDGng (ORCPT + 99 others); Wed, 4 Jul 2018 02:43:36 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:46264 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753518AbeGDGnf (ORCPT ); Wed, 4 Jul 2018 02:43:35 -0400 Received: from p4fea482e.dip0.t-ipconnect.de ([79.234.72.46] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fabVi-0008FK-SP; Wed, 04 Jul 2018 08:43:31 +0200 Date: Wed, 4 Jul 2018 08:43:29 +0200 (CEST) From: Thomas Gleixner To: Guo Ren cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org, jason@lakedaemon.net, arnd@arndb.de, c-sky_gcc_upstream@c-sky.com, gnu-csky@mentor.com, thomas.petazzoni@bootlin.com, wbx@uclibc-ng.org, green.hu@gmail.com Subject: Re: [PATCH V2 19/19] irqchip: add C-SKY irqchip drivers In-Reply-To: <20180704050822.GA23536@guoren> Message-ID: References: <20180704050822.GA23536@guoren> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 On Wed, 4 Jul 2018, Guo Ren wrote: > On Tue, Jul 03, 2018 at 11:28:03AM +0200, Thomas Gleixner wrote: > That's Ok. And here is my implementation: > > static inline u32 build_intc_ctrl(u32 idx) > { > /* > * One channel is one byte in a word-width register, so > * there are four channels in a word-width register. > * > * Set the same index for each channel and it will make > * "irq num = channel num". > */ > return (idx | ((idx + 1) << 8) | > ((idx + 2) << 16) | ((idx + 3) << 24)); > } > Hmm? (No magic number) Ok :) > > > + static void __iomem *reg_base; > > > + irq_hw_number_t hwirq; > > > + > > > + reg_base = *this_cpu_ptr(&intcl_reg); > > > > Wheee! > > > > static void __iomem *reg_base = this_cpu_read(intcl_reg); > > irq_hw_number_t hwirq; > > > > Hmm? > Thx for the tips and I'll use this_cpu_read() without static. > void __iomem *reg_base = this_cpu_read(intcl_reg); Yeah, I surely missed to drop the static ... > > > > Aside of that the whole thing might share the code with the other one, but > > it might not be worth it. At least this wants to be documented in the > > changelog why sharing the code is not useful... > > Do you mean merge irq-csky-v1.c irq-csky-v2.c irq-nationalchip.c into > one file eg: irq-csky.c? Yes, but only if there is enough code to share without creating an ifdef mess. But that looks doable Thanks, tglx