mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-11 13:04:03 +08:00
scsi: aic7xxx: Make BUILD_SCSIID() a function
Convert BUILD_SCSIID() into a function and add a scsi_device argument. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231002154328.43718-7-hare@suse.de Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
6a137a967b
commit
958230bcdd
@ -798,11 +798,18 @@ struct scsi_host_template aic7xxx_driver_template = {
|
|||||||
|
|
||||||
/**************************** Tasklet Handler *********************************/
|
/**************************** Tasklet Handler *********************************/
|
||||||
|
|
||||||
/******************************** Macros **************************************/
|
|
||||||
#define BUILD_SCSIID(ahc, cmd) \
|
static inline unsigned int ahc_build_scsiid(struct ahc_softc *ahc,
|
||||||
((((cmd)->device->id << TID_SHIFT) & TID) \
|
struct scsi_device *sdev)
|
||||||
| (((cmd)->device->channel == 0) ? (ahc)->our_id : (ahc)->our_id_b) \
|
{
|
||||||
| (((cmd)->device->channel == 0) ? 0 : TWIN_CHNLB))
|
unsigned int scsiid = (sdev->id << TID_SHIFT) & TID;
|
||||||
|
|
||||||
|
if (sdev->channel == 0)
|
||||||
|
scsiid |= ahc->our_id;
|
||||||
|
else
|
||||||
|
scsiid |= ahc->our_id_b | TWIN_CHNLB;
|
||||||
|
return scsiid;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************** Bus DMA *************************************/
|
/******************************** Bus DMA *************************************/
|
||||||
int
|
int
|
||||||
@ -1457,7 +1464,7 @@ ahc_linux_run_command(struct ahc_softc *ahc, struct ahc_linux_device *dev,
|
|||||||
* Fill out basics of the HSCB.
|
* Fill out basics of the HSCB.
|
||||||
*/
|
*/
|
||||||
hscb->control = 0;
|
hscb->control = 0;
|
||||||
hscb->scsiid = BUILD_SCSIID(ahc, cmd);
|
hscb->scsiid = ahc_build_scsiid(ahc, cmd->device);
|
||||||
hscb->lun = cmd->device->lun;
|
hscb->lun = cmd->device->lun;
|
||||||
mask = SCB_GET_TARGET_MASK(ahc, scb);
|
mask = SCB_GET_TARGET_MASK(ahc, scb);
|
||||||
tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb),
|
tinfo = ahc_fetch_transinfo(ahc, SCB_GET_CHANNEL(ahc, scb),
|
||||||
|
Loading…
Reference in New Issue
Block a user