Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2544179rwo; Sun, 23 Jul 2023 18:32:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlECqe9IdrInLl2bslbOHmTy+I5ANz8SHVOp7vAB4XSFNPM8Ozi8gXECNfQwmA0yt2WIMTL0 X-Received: by 2002:a05:6512:702:b0:4f9:556b:93c5 with SMTP id b2-20020a056512070200b004f9556b93c5mr4060399lfs.40.1690162353855; Sun, 23 Jul 2023 18:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690162353; cv=none; d=google.com; s=arc-20160816; b=cyzXb2WQ/Tkl0WFfWgaOx1oURMVt72TvlT6g/NGH/s8LlY8C3WOAmYNGmFbHfjOhh8 2klWu+26YivD38OgrrQC9sB3XqLwwFruMav9uLgUrZ2DgFXLI12vSPizA9aszrYXtts4 wnjoFeLED4G3YRAobuqnd60RsalHuatRHkhjiBW+hfOS6XpWFEpkS7uTsWeR3Yof+ugk o86ELU7Bh8aY4sHbCvk871qzEIbgj1XTwypGGaD8OVQ5wPr5E+pND8U+mk7rAocW4Fri elVa94hWO72dNAUX4UFNLtTqDjsDnPcAIvFZkjJ32Ab4tfoxzmVIbzASv+XCYOTh/FVS vYXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N1WiSN2eBc8dqyhEUJfxh23XklfblUTIeNvor/JpOaY=; fh=ZCEHo07vsnwXomCdJ5z+58AyGbBi1LUApT5LMR2pIpY=; b=fmL/MwQ2qANmazZENtvkozdiBwMef1L3Fho5UQCpFaGOvQlHtrOYuZ25OrSDSgj+lf 1Gd9CTVG4AYUkWhCxpqf1xhoC6Zw6ELIvqxIyUQPsCRepL3LhQWu3exfZB5BxfqvjnvA GKVIWKBMcuYwFH+r9VnLBqNEFS1xtCdJv+ms4Ov7xwPyEwsVPnxBX/b/KKijKnSk5/e+ SHfiNMPfIE2v2QAweMpYGdXWin4gxCiVTT++qRSADwYGfgLwQ3L/5Lo/gU0GS2sJ3Rxq g1VNmBH24AS575+R5D129NCTDRz/HY7DmOUSIvUaS6MWnn395HlSpcVL+AZ0A4f7pgYr z1IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kzGrKLIR; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a50eb05000000b005220ec7fdecsi2868655edp.567.2023.07.23.18.32.10; Sun, 23 Jul 2023 18:32:33 -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=@kernel.org header.s=k20201202 header.b=kzGrKLIR; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbjGXBWQ (ORCPT + 99 others); Sun, 23 Jul 2023 21:22:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230239AbjGXBV7 (ORCPT ); Sun, 23 Jul 2023 21:21:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D12410DE; Sun, 23 Jul 2023 18:21:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80AC060F2D; Mon, 24 Jul 2023 01:21:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F528C433D9; Mon, 24 Jul 2023 01:21:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690161663; bh=+LwtARwstwHYhoUrcmgWERRg9mxIE9XuQgcVongl07E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzGrKLIR00b0y2GN7GLXjogqLBecPSObdztla0q4EysLtPU8Gn9Z3NEXoEWkqD5du vxjDT0AIv8P8r9nsEJLhadwvL+80qFddIxH9y5QKv/gsgquxZkklNXfa5J3vkQ2l1N VOQw7Et1u8TrmI6utyp4+HHwGnOolMv0I1+Ei9UB++aH5HTjw7CRwC0td1xSZJSShP U0YMUA+Munxs+Jb3JsVs5lq/J0V566BAX4xOUvmHTubmVacZD1eYARPVk32vS9Uog8 HlsqKy2kK49m2tv8htyE6jdDNBRuhY34yY3Csd8fwAZbGtv/ykTWQfgK/0BQXXAauJ kl6Wf9QCUnETg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Gustavo A. R. Silva" , Thomas Bogendoerfer , Sasha Levin , macro@orcam.me.uk, linux-mips@vger.kernel.org Subject: [PATCH AUTOSEL 6.4 56/58] MIPS: dec: prom: Address -Warray-bounds warning Date: Sun, 23 Jul 2023 21:13:24 -0400 Message-Id: <20230724011338.2298062-56-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230724011338.2298062-1-sashal@kernel.org> References: <20230724011338.2298062-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.5 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: "Gustavo A. R. Silva" [ Upstream commit 7b191b9b55df2a844bd32d1d380f47a7df1c2896 ] Zero-length arrays are deprecated, and we are replacing them with flexible array members instead. So, replace zero-length array with flexible-array member in struct memmap. Address the following warning found after building (with GCC-13) mips64 with decstation_64_defconfig: In function 'rex_setup_memory_region', inlined from 'prom_meminit' at arch/mips/dec/prom/memory.c:91:3: arch/mips/dec/prom/memory.c:72:31: error: array subscript i is outside array bounds of 'unsigned char[0]' [-Werror=array-bounds=] 72 | if (bm->bitmap[i] == 0xff) | ~~~~~~~~~~^~~ In file included from arch/mips/dec/prom/memory.c:16: ./arch/mips/include/asm/dec/prom.h: In function 'prom_meminit': ./arch/mips/include/asm/dec/prom.h:73:23: note: while referencing 'bitmap' 73 | unsigned char bitmap[0]; This helps with the ongoing efforts to globally enable -Warray-bounds. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/323 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/include/asm/dec/prom.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/dec/prom.h b/arch/mips/include/asm/dec/prom.h index 1e1247add1cf8..908e96e3a3117 100644 --- a/arch/mips/include/asm/dec/prom.h +++ b/arch/mips/include/asm/dec/prom.h @@ -70,7 +70,7 @@ static inline bool prom_is_rex(u32 magic) */ typedef struct { int pagesize; - unsigned char bitmap[0]; + unsigned char bitmap[]; } memmap; -- 2.39.2