From patchwork Wed Aug 16 18:28:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 136236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2360774vqi; Sun, 20 Aug 2023 00:30:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUHKX57FvcdRUDQVnPe3pZ6A9FvAvVD0HXRlbbokciCyUvdzFyjxpp2WD7cKOaHgRN5h8B X-Received: by 2002:a17:903:2444:b0:1b9:be2e:2b40 with SMTP id l4-20020a170903244400b001b9be2e2b40mr4905827pls.50.1692516601012; Sun, 20 Aug 2023 00:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692516600; cv=none; d=google.com; s=arc-20160816; b=TKzHS6B9lD0NHRHU6QvQKctOauY3+TI9rHLkTlgsM19Oh8ScFOnRg8ql21/xEq4r+b GQP6Eyt5g8myzruUjvSoWDCUMegC3I9lrzG0wlRlwV+5KkA/2WSGESfKFPVge37vvxZN yYBbXGCPdgZ0b47AXEF+vw3VoT7iPCzAzPuOpUMEP/Z1NTp9ohwCeksjyLdBE9OgXRoE QMVU6beYJhAND9z4mB+vFG2nbtP5zE2hNne2GqEBd7g5A8zJW/CEY0RVWzy/SlGVMqlB +DiJjQfKvDAQWxwqv39tGdebfvh47FXRx3fR9AMnCt/pz/E62itZsDNwDfR75t7dfY39 euSA== 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=6TCeQZinfYtJnaRP+FIjwLBIn6sJ4C4NaGcY4nO5RUg=; fh=WBwl1TZSTXqr4vPbVavkfaywxRh66J0VahyegEqE3wM=; b=jpz3mZps6zbvuJF8E9MDYaGJi6iE7ZY9p/yJqWgvfOiQlMlDNoGLMKOvUcccPnRSnp xl5wz7Wdjr3TRwjTaO+GxvbaYIqBJbIsRFgrj/7nmAi4SWuePgNWS0BOIo9nrYHJNkP5 lc1GDF8eLd/FepiQVtJMSS1fIIY+OQCzvOwtnzjE6EEL3Y0ZpdPFS2avVBW2ltjPUPZx kCHpP1/EmK6uXXO8Giq8DrPoI/Rc4VXUry3L4ZG3iRJ2SMLrdM7bs1TU5BLsd+a3hqbc oGyCLkrBKjtpZkxGOp298eRAzjM1MsSMMViKe0lxCstoUhkwIrBuHTs6lWePDCOMiCIa wS9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uBGQJT8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q5-20020a170902dac500b001bb9533b968si5147933plx.408.2023.08.20.00.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Aug 2023 00:30:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uBGQJT8E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C50335AA05; Sat, 19 Aug 2023 12:06:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345531AbjHPS2H (ORCPT + 99 others); Wed, 16 Aug 2023 14:28:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345603AbjHPS15 (ORCPT ); Wed, 16 Aug 2023 14:27:57 -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 939C92D62; Wed, 16 Aug 2023 11:27:31 -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 E3C5165251; Wed, 16 Aug 2023 18:27:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E4A6C433C8; Wed, 16 Aug 2023 18:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692210449; bh=Fg2XRsx4gyYp75jugZem87t39C7lGAKLhehiSRy0yPE=; h=Date:From:To:Cc:Subject:From; b=uBGQJT8EM5FdwmbALcSATSzwZ1asOC8rvnZWoKy5nxj+nC2k1P9eA0JXFmGi6rPbp YvgiImdy/e7sdRF+iSNGW9KiKi7uZIjtPj0XJGf8v7qvGvQ+qxOfVnbe3qxvIuotF6 uLj3GnB+Ii1Tf++aO/gI1vo+Azi44l6dvkyzpk7fMxm1e/6ue5dfLsYrEH92e9gYPp En76RXbuPa/Szz65A5vgarSYK/iMGdyKNrZ1cyCzR5xUnsHo7i0pPuXaUXTaH+pnz7 fVz/T5KSl8zt6a5gdVP7GqCklvdogVi5dUoV+wBxxkGI65AJDlbbhjp5X4DsmWM4mM niJPe7KmPSjQw== Date: Wed, 16 Aug 2023 12:28:30 -0600 From: "Gustavo A. R. Silva" To: Anil Gurumurthy , Sudarsana Kalluru , "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][next] scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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 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: INBOX X-GMAIL-THRID: 1774732287386370296 X-GMAIL-MSGID: 1774732287386370296 One-element and zero-length arrays are deprecated. So, replace one-element array in struct fc_rscn_pl_s with flexible-array member. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/339 Signed-off-by: Gustavo A. R. Silva --- drivers/scsi/bfa/bfa_fc.h | 2 +- drivers/scsi/bfa/bfa_fcbuild.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/bfa/bfa_fc.h b/drivers/scsi/bfa/bfa_fc.h index a12d693065ce..1091aa428533 100644 --- a/drivers/scsi/bfa/bfa_fc.h +++ b/drivers/scsi/bfa/bfa_fc.h @@ -800,7 +800,7 @@ struct fc_rscn_pl_s { u8 command; u8 pagelen; __be16 payldlen; - struct fc_rscn_event_s event[1]; + struct fc_rscn_event_s event[]; }; /* diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c index 773c84af784c..52303e8c716d 100644 --- a/drivers/scsi/bfa/bfa_fcbuild.c +++ b/drivers/scsi/bfa/bfa_fcbuild.c @@ -1051,7 +1051,7 @@ fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, rscn->event[0].format = FC_RSCN_FORMAT_PORTID; rscn->event[0].portid = s_id; - return sizeof(struct fc_rscn_pl_s); + return struct_size(rscn, event, 1); } u16