Skip to content

Commit 479ad8e

Browse files
Matthew R. Ochsmartinkpetersen
authored andcommitted
scsi: cxlflash: Remove zeroing of private command data
The SCSI core now zeroes the per-command private data area prior to calling into the LLD. Replace the clearing operation that takes place when the private command data reference is obtained with a routine that performs common initializations. The zeroing that takes place in the device reset path remains intact as the private command data associated with the specified SCSI command is not guaranteed to be cleared. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 3223c01 commit 479ad8e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

drivers/scsi/cxlflash/common.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,22 @@ static inline struct afu_cmd *sc_to_afuc(struct scsi_cmnd *sc)
178178
return PTR_ALIGN(scsi_cmd_priv(sc), __alignof__(struct afu_cmd));
179179
}
180180

181-
static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc)
181+
static inline struct afu_cmd *sc_to_afuci(struct scsi_cmnd *sc)
182182
{
183183
struct afu_cmd *afuc = sc_to_afuc(sc);
184184

185-
memset(afuc, 0, sizeof(*afuc));
186185
INIT_LIST_HEAD(&afuc->queue);
187186
return afuc;
188187
}
189188

189+
static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc)
190+
{
191+
struct afu_cmd *afuc = sc_to_afuc(sc);
192+
193+
memset(afuc, 0, sizeof(*afuc));
194+
return sc_to_afuci(sc);
195+
}
196+
190197
struct hwq {
191198
/* Stuff requiring alignment go first. */
192199
struct sisl_ioarcb sq[NUM_SQ_ENTRY]; /* 16K SQ */

drivers/scsi/cxlflash/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
543543
struct cxlflash_cfg *cfg = shost_priv(host);
544544
struct afu *afu = cfg->afu;
545545
struct device *dev = &cfg->dev->dev;
546-
struct afu_cmd *cmd = sc_to_afucz(scp);
546+
struct afu_cmd *cmd = sc_to_afuci(scp);
547547
struct scatterlist *sg = scsi_sglist(scp);
548548
int hwq_index = cmd_to_target_hwq(host, scp, afu);
549549
struct hwq *hwq = get_hwq(afu, hwq_index);

0 commit comments

Comments
 (0)