From patchwork Fri Aug 9 03:01:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11085153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E62D614DB for ; Fri, 9 Aug 2019 03:02:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6DE428C00 for ; Fri, 9 Aug 2019 03:02:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB31028C1D; Fri, 9 Aug 2019 03:02:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C0AE28C00 for ; Fri, 9 Aug 2019 03:02:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405045AbfHIDCy (ORCPT ); Thu, 8 Aug 2019 23:02:54 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:35922 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404954AbfHIDCx (ORCPT ); Thu, 8 Aug 2019 23:02:53 -0400 Received: by mail-pl1-f193.google.com with SMTP id k8so44384105plt.3 for ; Thu, 08 Aug 2019 20:02:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AVOSMkwyj9JK2yCJxSF54qItMXHF3IjzdZGiXCGdU6M=; b=feIf2ZJ99fjANOWy32IVNsMeu6CPy4xcP4uHWsJ5zCpBXEGpKbhBMpRtS9X2GYFXnK uRJmjPtsp1322cjYR93xLhJYiCP9lq9pqep+Y+ywyUViBRTilX/4b4K0xeimhRUkiGt8 9RXjA5VVOA+BB9oI0OyLlKLRu+scOKCxVgDYJf2P1St1Tu4KpAgKAnqBz19RZWMCy/o/ B8I3UpqN96ldY6OabUa9ShysTqhWfvDMd/8UYcVbE9IdnHSDSMTFICDaMFDZpxZbiJGP kZKksbKQivgLlNNnilIEA4hRuBIWBLQcx13onXGTd6XZUHE89BNRbF20ddg2FUilvwyx 737g== X-Gm-Message-State: APjAAAUGjb8SKGu8nZprsI2ajF5gYxUH29HE5g5/ANKIqIifAqlCeqH5 s+LSQbNFk7/aQjMUyi1Ss2Q= X-Google-Smtp-Source: APXvYqzNtDQ0akQnGCptmrwo3yp/hps/82YemT+cZQMg6TnRFDxHGYqLa42jPqvuLz78//HnjqvM2g== X-Received: by 2002:a17:902:2f:: with SMTP id 44mr17168331pla.5.1565319772459; Thu, 08 Aug 2019 20:02:52 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4001:6530:8f02:649d:771a:4703]) by smtp.gmail.com with ESMTPSA id g2sm111787580pfi.26.2019.08.08.20.02.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 20:02:51 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Himanshu Madhani Subject: [PATCH v2 12/58] qla2xxx: Change data_dsd into an array Date: Thu, 8 Aug 2019 20:01:33 -0700 Message-Id: <20190809030219.11296-13-bvanassche@acm.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190809030219.11296-1-bvanassche@acm.org> References: <20190809030219.11296-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch does not change any functionality but fixes a Coverity complaint about using a scalar as an array. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_def.h | 4 ++-- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- drivers/scsi/qla2xxx/qla_target.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index a94b0d440f0f..1c6811bd5625 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1852,7 +1852,7 @@ struct crc_context { uint16_t reserved_2; uint16_t reserved_3; uint32_t reserved_4; - struct dsd64 data_dsd; + struct dsd64 data_dsd[1]; uint32_t reserved_5[2]; uint32_t reserved_6; } nobundling; @@ -1862,7 +1862,7 @@ struct crc_context { uint16_t reserved_1; __le16 dseg_count; /* Data segment count */ uint32_t reserved_2; - struct dsd64 data_dsd; + struct dsd64 data_dsd[1]; struct dsd64 dif_dsd; } bundling; } u; diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index b514ab4d243e..6b120254f414 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -1516,7 +1516,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, } if (!bundling) { - cur_dsd = &crc_ctx_pkt->u.nobundling.data_dsd; + cur_dsd = &crc_ctx_pkt->u.nobundling.data_dsd[0]; } else { /* * Configure Bundling if we need to fetch interlaving @@ -1526,7 +1526,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, crc_ctx_pkt->u.bundling.dif_byte_count = cpu_to_le32(dif_bytes); crc_ctx_pkt->u.bundling.dseg_count = cpu_to_le16(tot_dsds - tot_prot_dsds); - cur_dsd = &crc_ctx_pkt->u.bundling.data_dsd; + cur_dsd = &crc_ctx_pkt->u.bundling.data_dsd[0]; } /* Finish the common fields of CRC pkt */ diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 4c5f9c02c379..b8241d7b1f8a 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3163,7 +3163,7 @@ qlt_build_ctio_crc2_pkt(struct qla_qpair *qpair, struct qla_tgt_prm *prm) pkt->crc_context_len = CRC_CONTEXT_LEN_FW; if (!bundling) { - cur_dsd = &crc_ctx_pkt->u.nobundling.data_dsd; + cur_dsd = &crc_ctx_pkt->u.nobundling.data_dsd[0]; } else { /* * Configure Bundling if we need to fetch interlaving @@ -3173,7 +3173,7 @@ qlt_build_ctio_crc2_pkt(struct qla_qpair *qpair, struct qla_tgt_prm *prm) crc_ctx_pkt->u.bundling.dif_byte_count = cpu_to_le32(dif_bytes); crc_ctx_pkt->u.bundling.dseg_count = cpu_to_le16(prm->tot_dsds - prm->prot_seg_cnt); - cur_dsd = &crc_ctx_pkt->u.bundling.data_dsd; + cur_dsd = &crc_ctx_pkt->u.bundling.data_dsd[0]; } /* Finish the common fields of CRC pkt */