Skip to content

Commit 9cc9ef2

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: aic79xx: Make BUILD_SCSIID() a function
Convert BUILD_SCSIID() into a function and add a scsi_device argument. Signed-off-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Johannes Thumshirn <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 10f5aa0 commit 9cc9ef2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/scsi/aic7xxx/aic79xx_osm.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,11 @@ ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
541541
}
542542

543543
/******************************** Macros **************************************/
544-
#define BUILD_SCSIID(ahd, cmd) \
545-
(((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
544+
static inline unsigned int ahd_build_scsiid(struct ahd_softc *ahd,
545+
struct scsi_device *sdev)
546+
{
547+
return ((sdev_id(sdev) << TID_SHIFT) & TID) | (ahd)->our_id;
548+
}
546549

547550
/*
548551
* Return a string describing the driver.
@@ -818,7 +821,7 @@ ahd_linux_dev_reset(struct scsi_cmnd *cmd)
818821
ahd_set_sense_residual(reset_scb, 0);
819822
reset_scb->platform_data->xfer_len = 0;
820823
reset_scb->hscb->control = 0;
821-
reset_scb->hscb->scsiid = BUILD_SCSIID(ahd,cmd);
824+
reset_scb->hscb->scsiid = ahd_build_scsiid(ahd, cmd->device);
822825
reset_scb->hscb->lun = cmd->device->lun;
823826
reset_scb->hscb->cdb_len = 0;
824827
reset_scb->hscb->task_management = SIU_TASKMGMT_LUN_RESET;
@@ -1577,7 +1580,7 @@ ahd_linux_run_command(struct ahd_softc *ahd, struct ahd_linux_device *dev,
15771580
* Fill out basics of the HSCB.
15781581
*/
15791582
hscb->control = 0;
1580-
hscb->scsiid = BUILD_SCSIID(ahd, cmd);
1583+
hscb->scsiid = ahd_build_scsiid(ahd, cmd->device);
15811584
hscb->lun = cmd->device->lun;
15821585
scb->hscb->task_management = 0;
15831586
mask = SCB_GET_TARGET_MASK(ahd, scb);

0 commit comments

Comments
 (0)