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 7BA18C43461 for ; Thu, 17 Sep 2020 09:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38BA420770 for ; Thu, 17 Sep 2020 09:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726538AbgIQJrq (ORCPT ); Thu, 17 Sep 2020 05:47:46 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:45098 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726200AbgIQJrp (ORCPT ); Thu, 17 Sep 2020 05:47:45 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id D017618895634891A208; Thu, 17 Sep 2020 17:47:41 +0800 (CST) Received: from [127.0.0.1] (10.174.177.253) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 17 Sep 2020 17:47:36 +0800 Subject: Re: [PATCH v4 1/4] genirq: define an empty function set_handle_irq() if !GENERIC_IRQ_MULTI_HANDLER To: Marc Zyngier CC: Thomas Gleixner , Jason Cooper , Rob Herring , Guo Ren , devicetree , linux-csky , linux-kernel , Sebastian Hesselbarth , Haoyu Lv , Libin , Kefeng Wang , "Jianguo Chen" References: <20200915084305.3085-1-thunder.leizhen@huawei.com> <20200915084305.3085-2-thunder.leizhen@huawei.com> <0a2bc6bf-db9e-6467-dfcc-27f37d2db816@huawei.com> <22defc7e8bf8d4dd91565473e1a67f22@kernel.org> From: "Leizhen (ThunderTown)" Message-ID: Date: Thu, 17 Sep 2020 17:47:34 +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: <22defc7e8bf8d4dd91565473e1a67f22@kernel.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.253] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/17 17:32, Marc Zyngier wrote: > On 2020-09-17 04:46, Leizhen (ThunderTown) wrote: >> 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 */ >>> > > You shouldn't just make it a NOP. Consider adding a WARN_ON(1), so that > people can realize this cannot work without the required architecture support. Oh, right. I will add it. > >         M.