From patchwork Sat Jun 17 06:39:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 109418 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1816052vqr; Fri, 16 Jun 2023 23:41:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gi0jEEYtO0riAxSG1ZC6zGiJxfzMGCWvY6+LY9L2G2sDTV26vytLBBKRcs3BBsaryDfiY X-Received: by 2002:a17:902:e810:b0:1ab:11c8:777a with SMTP id u16-20020a170902e81000b001ab11c8777amr5368537plg.13.1686984117000; Fri, 16 Jun 2023 23:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686984116; cv=none; d=google.com; s=arc-20160816; b=JjQ2cBXoDd0lVT4quNq1Ejd88LRbxPHo8poLCB0kxLI6pfjCFnR82ZS7bcxyaGHoL4 z6rYuFIvTGBuBIjplKr+aoxx2d4BeKRVwijusJxjNRBEOxaVgbh422wlJAjLKGfq51F6 IShdMRBf9dO7Z6QaBiHd/sg2/Z/CZmflZQ2yiewUWrZRHIHrhc4hI8I79lYSqx3RvHjL wPa16S9sx9U79goqIailAuPoawvZaZNa1vp/cq0Gu3SvGZ8SjD9UJT1jgruYzVprImHZ M4jdloQdl24n25zTQ3+KqWLE6XLHkeFK7XmJ+XY3b1G83KZ04xTGUPIzjCpd+oiF2OpB V3BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=LPimK1iyu3ET4oiKhjVVm6mxD6AM4GpcQwzjF03kd2g=; b=U7sTkjwQa84YwxGzIfdcBG1vb+yyh7i/0ce91PAL1HjrGmC0gP8wZN9DnIDO8Jswn3 aWf9UwZ2kZj6ASO+nHiqbY70vkuSnaZdrjX7Jwxq1GJVQf9U0EmmKDMTs7FXsGJIwwc3 hJiHpIuA536oKkQuy3w+FdojFHHG8P50jJ5r23YmTDz2yf97QJxWYHzSlnslDbVGPu3P pgYKf7/m0Gi6DfrnqGgO/xDoAcvz5iija6Mv23HMmauiHqwehO8rAuxwaZTvZNDSmEvE vBD/+jkYYijCUuj7FvWzQOLy6lD26T6XwZu24wrwfWA326awSH1cxMOGCgJN4j93MaQv /Y8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4329rfiE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a170902e80f00b001adb857fc79si10363326plg.105.2023.06.16.23.41.43; Fri, 16 Jun 2023 23:41:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4329rfiE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233722AbjFQGkM (ORCPT + 99 others); Sat, 17 Jun 2023 02:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234361AbjFQGj5 (ORCPT ); Sat, 17 Jun 2023 02:39:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47A662721 for ; Fri, 16 Jun 2023 23:39:50 -0700 (PDT) Date: Sat, 17 Jun 2023 06:39:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686983989; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LPimK1iyu3ET4oiKhjVVm6mxD6AM4GpcQwzjF03kd2g=; b=4329rfiEVMWFCjHvs3PWV9aSPy4tBMs/tQA4uW0eMUYnj3W2eKovJsUDAJiyx/y1XVSsIU GExRdyHsMC2ft2uxv2XeQKfqI//+dvEF62m42E+Bi7isdrTAsYX5x8KPYxEMmOxy2jp+v3 oykRo2IwUIU4dazyqhuS9TsU/gLCUs3j8TuFPTtepyMutltdLLNnwTRA58vI+aIVJA6IW5 mBgCrtxR1cuNzyKKE0vcCoSqG7a7pifcSerO0y+ZIcK8+iCbaVQxH8DTsoLYaTIjB3POMf YsF+Gj2mGufIkPExV6h33SQfcHfZDNhYzoMNnnLQlydOo34RfyifMXcMMIh0ew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686983989; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LPimK1iyu3ET4oiKhjVVm6mxD6AM4GpcQwzjF03kd2g=; b=r0Ylkbjc2f/0KGXwSyA7j5TQJ3tATc7PI52WeKETVQZkRuxigfCoxkBin8syhpAIkK7IPA RxUb2kIWmtRwqKCQ== From: "irqchip-bot for Antonio Borneo" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/stm32-exti: Fix warning on initialized field overwritten Cc: Antonio Borneo , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20230601155614.34490-1-antonio.borneo@foss.st.com> References: <20230601155614.34490-1-antonio.borneo@foss.st.com> MIME-Version: 1.0 Message-ID: <168698398820.404.1898866830795273439.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767518611458884442?= X-GMAIL-MSGID: =?utf-8?q?1768931057309259564?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 48f31e496488a25f443c0df52464da446fb1d10c Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/48f31e496488a25f443c0df52464da446fb1d10c Author: Antonio Borneo AuthorDate: Thu, 01 Jun 2023 17:56:14 +02:00 Committer: Marc Zyngier CommitterDate: Sat, 17 Jun 2023 07:30:00 +01:00 irqchip/stm32-exti: Fix warning on initialized field overwritten While compiling with W=1, both gcc and clang complain about a tricky way to initialize an array by filling it with a non-zero value and then overrride some of the array elements. In this case the override is intentional, so just disable the specific warning for only this part of the code. Note: the flag "-Woverride-init" is recognized by both compilers, but the warning msg from clang reports "-Winitializer-overrides". The doc of clang clarifies that the two flags are synonyms, so use here only the flag name common on both compilers. Signed-off-by: Antonio Borneo Fixes: c297493336b7 ("irqchip/stm32-exti: Simplify irq description table") Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230601155614.34490-1-antonio.borneo@foss.st.com --- drivers/irqchip/irq-stm32-exti.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index f684be7..b5fa76c 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c @@ -173,6 +173,16 @@ static struct irq_chip stm32_exti_h_chip_direct; #define EXTI_INVALID_IRQ U8_MAX #define STM32MP1_DESC_IRQ_SIZE (ARRAY_SIZE(stm32mp1_exti_banks) * IRQS_PER_BANK) +/* + * Use some intentionally tricky logic here to initialize the whole array to + * EXTI_INVALID_IRQ, but then override certain fields, requiring us to indicate + * that we "know" that there are overrides in this structure, and we'll need to + * disable that warning from W=1 builds. + */ +__diag_push(); +__diag_ignore_all("-Woverride-init", + "logic to initialize all and then override some is OK"); + static const u8 stm32mp1_desc_irq[] = { /* default value */ [0 ... (STM32MP1_DESC_IRQ_SIZE - 1)] = EXTI_INVALID_IRQ, @@ -267,6 +277,8 @@ static const u8 stm32mp13_desc_irq[] = { [70] = 98, }; +__diag_pop(); + static const struct stm32_exti_drv_data stm32mp1_drv_data = { .exti_banks = stm32mp1_exti_banks, .bank_nr = ARRAY_SIZE(stm32mp1_exti_banks),