Skip to content

Commit 958230b

Browse files
hreineckemartinkpetersen
authored andcommitted
scsi: aic7xxx: Make BUILD_SCSIID() a function
Convert BUILD_SCSIID() into a function and add a scsi_device argument. Reported-by: kernel test robot <[email protected]> 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 6a137a9 commit 958230b

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

drivers/scsi/aic7xxx/aic7xxx_osm.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -798,11 +798,18 @@ struct scsi_host_template aic7xxx_driver_template = {
798798

799799
/**************************** Tasklet Handler *********************************/
800800

801-
/******************************** Macros **************************************/
802-
#define BUILD_SCSIID(ahc, cmd) \
803-
((((cmd)->device->id << TID_SHIFT) & TID) \
804-
| (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \
805-
| (((cmd)->device->channel == 0) ? 0 : TWIN_CHNLB))
801+
802+
static inline unsigned int ahc_build_scsiid(struct ahc_softc *ahc,
803+
struct scsi_device *sdev)
804+
{
805+
unsigned int scsiid = (sdev->id << TID_SHIFT) & TID;
806+
807+
if (sdev->channel == 0)
808+
scsiid |= ahc->our_id;
809+
else
810+
scsiid |= ahc->our_id_b | TWIN_CHNLB;
811+
return scsiid;
812+
}
806813

807814
/******************************** Bus DMA *************************************/
808815
int
@@ -1457,7 +1464,7 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev,
14571464
* Fill out basics of the HSCB.
14581465
*/
14591466
hscb->control = 0;
1460-
hscb->scsiid = BUILD_SCSIID(ahc, cmd);
1467+
hscb->scsiid = ahc_build_scsiid(ahc, cmd->device);
14611468
hscb->lun = cmd->device->lun;
14621469
mask = SCB_GET_TARGET_MASK(ahc, scb);
14631470
tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb),

0 commit comments

Comments
 (0)