Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26049657rwd; Mon, 3 Jul 2023 04:59:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHW9P2DgzsJOD80WSSfDfherUQ/C9+rN480vMYgp1xgszeHA9G/KQvVJY5NqWWH2r86TMx X-Received: by 2002:a05:6a00:174c:b0:67b:f249:35e2 with SMTP id j12-20020a056a00174c00b0067bf24935e2mr12363592pfc.21.1688385542429; Mon, 03 Jul 2023 04:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688385542; cv=none; d=google.com; s=arc-20160816; b=F5lLtAmMFrAy6vTnfQo0ujtpnvks8HbetlHfHt1YhVKjb439OH9LyRYuZ7CN4Uy116 4HvlGZighXRw3SjJtaotYMInI4ETdZigfjNtXrj/BAHOI3TUfA2FWP5PieMBI46fts+/ q1Uoyw+GC5M1dq6tLgCqTmmr+dfiQNm39txapseK70hIIQNAEvyM3011zrgak+7rvkfZ pYWlGq7koVWB0DWZ/4JBP8tin98VG+gawC07NMhiSMw6Wuv3XquZPkMgGE+tT68JTpw1 4vP9zMnqS4pHLtvo68wmoMtlV2aTTFrTJI67bgPrz4x5COQsxrR9aEeTmR2whApF/TsO P7dg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=AaqhTMf83owBBFam8QBB/NWzzWVanICsEmwTFxPAc6Q=; fh=m35lDzHlwGSzWD5Yi+NEbF2mdpfskw+OGVG3COIHFdI=; b=Pp7MrMtamHxL+yTi99j9EEyX18KawodagIWKREIaelmP7utUZwbIVuixIZyMk+BH2M TLTRzcD4E69Y++l+IUQAOqJFLIPnralN6UbBiXy6z+xL9j/RTuykQ8By5vZU0C1zq8Cz ZqRPIxU6shAMnb5efnxpV8N5YMJDG7MgePug3RtdHJYV7vxanNUePgteeBv58PNff9R8 5anM/SLP2X44OYXiYzH8d0dXNxnfo8q62TFxxGgAo+8LzM+QCUv11poUYszIi0+sV09S 9eECKnHHpp2F3d/6TNOUy/UYyaa39bLgjT4ahnGG7sDxVyFN3p/RGfACRIfxfAP3nFvU x+gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WbI6uLAp; 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 d12-20020a056a0024cc00b00665c24182bcsi18584165pfv.219.2023.07.03.04.58.47; Mon, 03 Jul 2023 04:59:02 -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=WbI6uLAp; 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 S231364AbjGCLtA (ORCPT + 99 others); Mon, 3 Jul 2023 07:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjGCLs7 (ORCPT ); Mon, 3 Jul 2023 07:48: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 5ADC1E8; Mon, 3 Jul 2023 04:48:58 -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) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2247460F03; Mon, 3 Jul 2023 11:48:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BD04C433C7; Mon, 3 Jul 2023 11:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688384936; bh=94E1xNeUaIhmByKLDdNMrVR1xm0w+a+Mcuf+Blcmadc=; h=From:To:Cc:Subject:Date:From; b=WbI6uLApPdI5dT9UVGlzwVzAKqDwBkfbJje5v74MQrn25edivWB2mBcmuQhny5Btt f0SF+P1kYRMTnOyNdM0bSQkbYxL6R+gxLAdRD2sMaYYI/2q47d3BmAIIc7InTkbm+z PzZZ5TyPUMkwOShlfNTsksnsVZg5JfRgZo2+RmlA1uUhFdCxyjx6j7pJZiQ5DLkqWi YGr0jG96eySZaUmlVuxVOyK+3CFFeknltvP0Dwdy8b6t5pbNogHWoMFaMrWeQMm5W2 pDjSKb2MoXUxAc2LOu9dMKvHzFEXFr7tCimrdivOf3r524jlPSS9z7IbKV0SM+bOn3 CemdKD6+pQKYg== From: Arnd Bergmann To: Adaptec OEM Raid Solutions , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Sagar Biradar , John Garry , Gilbert Wu , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: aacraid: avoid -Warray-bounds warning Date: Mon, 3 Jul 2023 13:48:46 +0200 Message-Id: <20230703114851.1194510-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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: Arnd Bergmann The one-element array in aac_aifcmd is actually meant as a flexible array, and causes an overflow warning that can be avoided using the normal flex arrays: drivers/scsi/aacraid/commsup.c:1166:17: error: array index 1 is past the end of the array (that has type 'u8[1]' (aka 'unsigned char[1]'), cast to '__le32 *' (aka 'unsigned int *')) [-Werror,-Warray-bounds] (((__le32 *)aifcmd->data)[1] == cpu_to_le32(3)); ^ ~ Signed-off-by: Arnd Bergmann --- drivers/scsi/aacraid/aacraid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 7c6efde75da66..73b6ac0c01f54 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h @@ -2618,7 +2618,7 @@ struct aac_hba_info { struct aac_aifcmd { __le32 command; /* Tell host what type of notify this is */ __le32 seqnum; /* To allow ordering of reports (if necessary) */ - u8 data[1]; /* Undefined length (from kernel viewpoint) */ + u8 data[]; /* Undefined length (from kernel viewpoint) */ }; /** -- 2.39.2