Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1272582rwb; Thu, 22 Sep 2022 12:33:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VaAeW0hZ50vSdvHh0RJO/SybC/GmRe4M80X3PnkwvwAewObNnlQoVRaipMHG/v/8qYtld X-Received: by 2002:a17:90b:1642:b0:203:1630:c54d with SMTP id il2-20020a17090b164200b002031630c54dmr16617213pjb.122.1663875184325; Thu, 22 Sep 2022 12:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663875184; cv=none; d=google.com; s=arc-20160816; b=h7g70zyDNopc7uVIIsin8EF8JCkTUT/syDUVMuYRO8CW0ndKawV1R5P8JVAgmQMT+K +8MtgVOcoWqiRCTe3EImeYYnBLaTUWFt/P+LkvemY1oEI+Q5z0xBr6y6vjssPvgjf0IA N254rtmFM9hZV1lqHgYMfkRlmfLPig/imiQgCTeVjf2ZsOtREkXR057CaIxkOul3b41B n5cUSNBBzbt6FWq7fjhl6bwi+PuxFVy6FaAyO/J3paRSMUudAyZW16OBiZyIhYsGxsZm Z/rQl+0d722Pd4fY2QSfRV9K9LCcDMNkxrsfsZhuGfsO6klTx3AZ5IXovkFk40dG47h/ VKyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=Jn3XYmy4BliXVH30X7+64T8y1ragJACJzLvynGV9qrk=; b=t6hi4Oi05+yj8DrKB1CoXFvHaE5VCwA9ls2z4HSAyBbQlbUhpJhnVbLNDlaa6QDezL jony2yAqhuj4TXjzmhFn7kTrdfiBTZ6+siK7TIoIWROD8YC0gHC7vp8jkCAXSn8PVtZi tql3ruhhFSjr4f/BPdvVQEY4rFky3+22zaXt91W9NajbiO8kmAnd6KX6t5xw2NfBBlQ+ 0HopsVncycXHT7LAecyN1ggguUq3fcKb0rCy2b3slS0FJMc9fuFgswhxmzWJmvVeUE0B qyrZC4I27HdGUKrQoXEFQtQFfs3iaVKBcytb9B+Qs0nRDEgI/uAkuW9tyBJwFQ2DiZzt LauQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ej6nGhbI; 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 u18-20020a056a00159200b0052c56cea553si7504702pfk.352.2022.09.22.12.32.52; Thu, 22 Sep 2022 12:33:04 -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=ej6nGhbI; 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 S229566AbiIVTak (ORCPT + 99 others); Thu, 22 Sep 2022 15:30:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbiIVTah (ORCPT ); Thu, 22 Sep 2022 15:30:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215527F0A0; Thu, 22 Sep 2022 12:30:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C582CB83A37; Thu, 22 Sep 2022 19:30:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB6FDC433D6; Thu, 22 Sep 2022 19:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663875034; bh=vqFQno4mcDNf9adb3pKJgK0yhZw6i/lB0mWMPuO/jgo=; h=Date:From:To:Cc:Subject:From; b=ej6nGhbI6wgK7QB9ktkzYQYIVLi6f0tvrt13oKgLQnfuiFgLVef4FwW4Ox5Vj8T2F 9IkpcCdIXAIIdBt8e25w8zX+PlSeCE0Mcy1WzTIleF47YhRowp7TRtvx7lXwEhWii0 DAJEGyhUjqZxg5MYdephpf69O7VpTdOxRlL/9vz/vNuejBgiAOsc4uKmZmtC6mPL5K rm5gfCf41/N4FFMxXTYY5dqYCiEqTfaoNmvDuFxOui/qlkuCEmQIzobs+MaXLepyFk jB/bild6k65pPkADSFDgaJI96IvLu+bRJ19XpvA6jcZrOAnphiZtpBhcWd5elPhljW 9hq1CeCIrpBnw== Date: Thu, 22 Sep 2022 14:30:28 -0500 From: "Gustavo A. R. Silva" To: Jack Wang , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH] scsi: pm8001: Replace one-element array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct fw_control_info. This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/79 Link: https://github.com/KSPP/linux/issues/207 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 [1] Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/pm8001/pm8001_sas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index c5e3f380a01c..b08f52673889 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -612,7 +612,7 @@ struct fw_control_info { operations.*/ u32 reserved;/* padding required for 64 bit alignment */ - u8 buffer[1];/* Start of buffer */ + u8 buffer[];/* Start of buffer */ }; struct fw_control_ex { struct fw_control_info *fw_control; -- 2.34.1