From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72A86C433E2 for ; Thu, 17 Sep 2020 04:02:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E33C2074B for ; Thu, 17 Sep 2020 04:02:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726072AbgIQEC0 (ORCPT ); Thu, 17 Sep 2020 00:02:26 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12773 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725886AbgIQECZ (ORCPT ); Thu, 17 Sep 2020 00:02:25 -0400 X-Greylist: delayed 957 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Sep 2020 00:02:25 EDT Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B7E0813A712CA9F16AFF; Thu, 17 Sep 2020 11:46:26 +0800 (CST) Received: from [127.0.0.1] (10.174.177.253) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Thu, 17 Sep 2020 11:46:18 +0800 Subject: Re: [PATCH v4 1/4] genirq: define an empty function set_handle_irq() if !GENERIC_IRQ_MULTI_HANDLER To: Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Guo Ren , devicetree , linux-csky , linux-kernel CC: Sebastian Hesselbarth , Haoyu Lv , Libin , Kefeng Wang , Jianguo Chen References: <20200915084305.3085-1-thunder.leizhen@huawei.com> <20200915084305.3085-2-thunder.leizhen@huawei.com> From: "Leizhen (ThunderTown)" Message-ID: <0a2bc6bf-db9e-6467-dfcc-27f37d2db816@huawei.com> Date: Thu, 17 Sep 2020 11:46:16 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20200915084305.3085-2-thunder.leizhen@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.253] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org On 2020/9/15 16:43, Zhen Lei wrote: > To avoid compilation error if an irqchip driver references the function > set_handle_irq() but may not select GENERIC_IRQ_MULTI_HANDLER on some > systems. Hi, Marc: Do you agree with this method? Otherwise, I should use "#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER ... #endif" to perform the compilation isolation. This may make the code less beautiful. > > For example, the Synopsys DesignWare APB interrupt controller > (dw_apb_ictl) is used as the secondary interrupt controller on arc, csky, > arm64, and most arm32 SoCs, and it's also used as the primary interrupt > controller on Hisilicon SD5203 (an arm32 SoC). The latter need to use > set_handle_irq() to register the top-level IRQ handler, but this multi > irq handler registration mechanism is not implemented on arc system. > > The input parameter "handle_irq" maybe defined as static and only > set_handle_irq() references it. This will trigger "defined but not used" > warning. So add "(void)handle_irq" to suppress it. > > Signed-off-by: Zhen Lei > --- > include/linux/irq.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/irq.h b/include/linux/irq.h > index 1b7f4dfee35b397..0848a2aaa9b40b1 100644 > --- a/include/linux/irq.h > +++ b/include/linux/irq.h > @@ -1252,6 +1252,8 @@ void irq_matrix_free(struct irq_matrix *m, unsigned int cpu, > * top-level IRQ handler. > */ > extern void (*handle_arch_irq)(struct pt_regs *) __ro_after_init; > +#else > +#define set_handle_irq(handle_irq) do { (void)handle_irq; } while (0) > #endif > > #endif /* _LINUX_IRQ_H */ >