SCSI tmscsim.c: fix inline compile errors
PATCH 1/1 SCSI tmscsim.c: fix inline compile errors
Trying to compile drivers/scsi/tmscsim.c in 2.6.8-rc1-mm1 using gcc 3.4 results in compile errors starting with the following:
<-- snip -->
...
CC drivers/scsi/tmscsim.o
In file included from drivers/scsi/tmscsim.c:1477:drivers/scsi/scsiiom.c: In function `do_DC390_Interrupt':drivers/scsi/tmscsim.c:295: sorry, unimplemented: inlining failed in call to 'dc390_InvalidCmd': function body not available drivers/scsi/scsiiom.c:279: sorry, unimplemented: called from here drivers/scsi/tmscsim.c:296: sorry, unimplemented: inlining failed in call to 'dc390_EnableMsgOut_Abort': function body not available drivers/scsi/scsiiom.c:317: sorry, unimplemented: called from here make[2]: *** [drivers/scsi/tmscsim.o] Error 1
<-- snip -->
The patch below removes the inlines from the affected functions.
An alternative approach would be to move the functions above the place where they are called the first time.
diffstat output:
drivers/scsi/scsiiom.c | 6 +++--- drivers/scsi/tmscsim.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/scsiiom.c renamed from drivers/scsi/scsiiom.c.old +3 -3
@@ -594,7 +594,7 @@ }/* abort command */ -static void __inline__ +static void dc390_EnableMsgOut_Abort (struct dc390_acb * pACB,struct dc390_srb * pSRB ) { pSRB->MsgOutBuf[0 ] =ABORT ;
@@ -1656,7 +1656,7 @@ } -static void __inline__ +static void dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ) {struct scsi_cmnd *pcmd;
@@ -1696,7 +1696,7 @@ -static void __inline__ +static void dc390_InvalidCmd (struct dc390_acb * pACB ) {if ( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_ +SRB_MSGOUT ) )
drivers/scsi/tmscsim.c renamed from drivers/scsi/tmscsim.c.old +3 -3
@@ -291,9 +291,9 @@static void dc390_DoingSRB_Done (struct dc390_acb * pACB,struct scsi_cmnd * cmd);static void dc390_ScsiRstDetect (struct dc390_acb * pACB );static void dc390_ResetSCSIBus (struct dc390_acb * pACB ); -static void __inline__dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ); -static void __inline__dc390_InvalidCmd (struct dc390_acb * pACB ); -static void __inline__dc390_EnableMsgOut_Abort (struct dc390_acb *,struct dc390_srb *); +static void dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ); +static void dc390_InvalidCmd (struct dc390_acb * pACB ); +static void dc390_EnableMsgOut_Abort (struct dc390_acb *,struct dc390_srb *);static irqreturn_t do_DC390_Interrupt (int ,void *,struct pt_regs *);static int dc390_initAdapter (struct Scsi_Host *psh,unsigned long io_port,u8 Irq,u8 index );
Hi
Quoted 17 lines · Adrian Bunk
Trying to compile
drivers/scsi/tmscsim.cin 2.6.8-rc1-mm1 using gcc 3.4 results in compile errors starting with the following:<-- snip -->
...
CCdrivers/scsi/tmscsim.o
In file included fromdrivers/scsi/tmscsim.c:1477:drivers/scsi/scsiiom.c: In function `do_DC390_Interrupt':drivers/scsi/tmscsim.c:295: sorry, unimplemented: inlining failed in call to 'dc390_InvalidCmd': function body not availabledrivers/scsi/scsiiom.c:279: sorry, unimplemented: called from heredrivers/scsi/tmscsim.c:296: sorry, unimplemented: inlining failed in call to 'dc390_EnableMsgOut_Abort': function body not availabledrivers/scsi/scsiiom.c:317: sorry, unimplemented: called from here make[2]: *** [drivers/scsi/tmscsim.o] Error 1
Quoted 7 lines
<-- snip -->
The patch below removes the inlines from the affected functions.
An alternative approach would be to move the functions above the place where they are called the first time.
Thanks for the patch!
I looked at those 3 functions. dc390_EnableMsgOut_Abort is called 5 times in the code and is 0x30 bytes long (as compiled with 3.3.2), so, uninlining it, probably, makes most sense. The other 2 functions are called only ones each and from the interrupt, so, I applied the "alternative approach" to them - moved above the calling functions. So, if there are no objections, perhaps, the attached patch could be applied instead of yours. Tested.
Thanks
Guennadi
Quoted 57 lines
diffstat output:
drivers/scsi/scsiiom.c | 6 +++--- drivers/scsi/tmscsim.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)Signed-off-by Adrian Bunk <[email protected]>drivers/scsi/scsiiom.c renamed from drivers/scsi/scsiiom.c.old +3
-3@@ -594,7 +594,7 @@ }/* abort command */ -static void __inline__ +static void dc390_EnableMsgOut_Abort (struct dc390_acb * pACB,struct dc390_srb * pSRB ) { pSRB->MsgOutBuf[0 ] =ABORT ;@@ -1656,7 +1656,7 @@ } -static void __inline__ +static void dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ) {struct scsi_cmnd *pcmd;@@ -1696,7 +1696,7 @@ -static void __inline__ +static void dc390_InvalidCmd (struct dc390_acb * pACB ) {if ( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_ +SRB_MSGOUT ) )drivers/scsi/tmscsim.c renamed from drivers/scsi/tmscsim.c.old +3
-4@@ -291,9 +291,9 @@static void dc390_DoingSRB_Done (struct dc390_acb * pACB,struct scsi_cmnd * cmd);static void dc390_ScsiRstDetect (struct dc390_acb * pACB );static void dc390_ResetSCSIBus (struct dc390_acb * pACB ); -static void __inline__dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ); -static void __inline__dc390_InvalidCmd (struct dc390_acb * pACB ); -static void __inline__dc390_EnableMsgOut_Abort (struct dc390_acb *,struct dc390_srb *); +static void dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ); +static void dc390_InvalidCmd (struct dc390_acb * pACB ); +static void dc390_EnableMsgOut_Abort (struct dc390_acb *,struct dc390_srb *);static irqreturn_t do_DC390_Interrupt (int ,void *,struct pt_regs *);static int dc390_initAdapter (struct Scsi_Host *psh,unsigned long io_port,u8 Irq,u8 index ); -
Quoted 6 lines
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
---
Guennadi Liakhovetski
Modified and
drivers/scsi/scsiiom.c +40 -50
@@ -213,8 +213,17 @@ }#endif + +static void __inline__ +dc390_InvalidCmd (struct dc390_acb * pACB) +{ +if (pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_ |SRB_MSGOUT )) +DC390_write8 (ScsiCmd,CLEAR_FIFO_CMD ); +} + +static irqreturn_t __inline__ -DC390_Interrupt (int irq,void *dev_id,struct pt_regs *regs) +DC390_Interrupt (int irq,void *dev_id,struct pt_regs *regs) {struct dc390_acb *pACB, *pACB2;struct dc390_dcb *pDCB;
@@ -594,7 +603,7 @@ }/* abort command */ -static void __inline__ +static void dc390_EnableMsgOut_Abort (struct dc390_acb * pACB,struct dc390_srb * pSRB ) { pSRB->MsgOutBuf[0 ] =ABORT ;
@@ -1333,6 +1342,35 @@ } +static void __inline__ +dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB) +{ +struct scsi_cmnd *pcmd; + + pcmd = pSRB->pcmd; + +REMOVABLEDEBUG (printk (KERN_INFO "DC390: RequestSense(Cmd %02x, Id %02x, LUN %02x)\n" ,\ + pcmd->cmnd[0 ], pDCB->TargetID, pDCB->TargetLUN)); + + pSRB->SRBFlag |=AUTO_REQSENSE ; + pSRB->SavedSGCount = pcmd->use_sg; + pSRB->SavedTotXLen = pSRB->TotalXferredLen; + pSRB->AdaptStatus =0 ; + pSRB->TargetStatus =0 ;/* CHECK_CONDITION<<1; */ + +/* We are called from SRBdone, original PCI mapping has been removed +* already, new one is set up from StartSCSI */ + pSRB->SGIndex =0 ; + + pSRB->TotalXferredLen =0 ; + pSRB->SGToBeXferLen =0 ; +if (dc390_StartSCSI (pACB, pDCB, pSRB)) { +dc390_Going_to_Waiting (pDCB, pSRB); +dc390_waiting_timer (pACB,HZ /5 ); + } +} + +static void dc390_SRBdone (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ) {
@@ -1649,52 +1687,4 @@dc390_Waiting_process ( pACB ); }return ; -} - - -static void __inline__ -dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ) -{ -struct scsi_cmnd *pcmd; - - pcmd = pSRB->pcmd; - -REMOVABLEDEBUG (printk (KERN_INFO "DC390: RequestSense (Cmd %02x, Id %02x, LUN %02x)\n" ,\ - pcmd->cmnd[0 ], pDCB->TargetID, pDCB->TargetLUN)); - - pSRB->SRBFlag |=AUTO_REQSENSE ; -//pSRB->Segment0[0] = (u32) pSRB->CmdBlock[0]; -//pSRB->Segment0[1] = (u32) pSRB->CmdBlock[4]; -//pSRB->Segment1[0] = ((u32)(pcmd->cmd_len) << 8) + pSRB->SGcount; -//pSRB->Segment1[1] = pSRB->TotalXferredLen; - pSRB->SavedSGCount = pcmd->use_sg; - pSRB->SavedTotXLen = pSRB->TotalXferredLen; - pSRB->AdaptStatus =0 ; - pSRB->TargetStatus =0 ;/* CHECK_CONDITION<<1; */ - -/* We are called from SRBdone, original PCI mapping has been removed -* already, new one is set up from StartSCSI */ - pSRB->SGIndex =0 ; - -//pSRB->CmdBlock[0] = REQUEST_SENSE; -//pSRB->CmdBlock[1] = pDCB->TargetLUN << 5; -//(u16) pSRB->CmdBlock[2] = 0; -//(u16) pSRB->CmdBlock[4] = sizeof(pcmd->sense_buffer); -//pSRB->ScsiCmdLen = 6; - - pSRB->TotalXferredLen =0 ; - pSRB->SGToBeXferLen =0 ; -if (dc390_StartSCSI ( pACB, pDCB, pSRB ) ) { -dc390_Going_to_Waiting ( pDCB, pSRB ); -dc390_waiting_timer (pACB,HZ /5 ); - } -} - - - -static void __inline__ -dc390_InvalidCmd (struct dc390_acb * pACB ) -{ -if ( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_ +SRB_MSGOUT ) ) -DC390_write8 (ScsiCmd,CLEAR_FIFO_CMD ); }
drivers/scsi/tmscsim.c +1 -5
@@ -289,9 +289,7 @@static void dc390_DoingSRB_Done (struct dc390_acb * pACB,struct scsi_cmnd * cmd);static void dc390_ScsiRstDetect (struct dc390_acb * pACB );static void dc390_ResetSCSIBus (struct dc390_acb * pACB ); -static void __inline__dc390_RequestSense (struct dc390_acb * pACB,struct dc390_dcb * pDCB,struct dc390_srb * pSRB ); -static void __inline__dc390_InvalidCmd (struct dc390_acb * pACB ); -static void __inline__dc390_EnableMsgOut_Abort (struct dc390_acb *,struct dc390_srb *); +static void dc390_EnableMsgOut_Abort (struct dc390_acb *,struct dc390_srb *);static irqreturn_t do_DC390_Interrupt (int ,void *,struct pt_regs *);static int dc390_initAdapter (struct Scsi_Host *psh,unsigned long io_port,u8 Irq,u8 index );
@@ -939,8 +937,6 @@ { pSRB->pSRBDCB = pDCB; pSRB->pcmd = pcmd; -//pSRB->ScsiCmdLen = pcmd->cmd_len; -//memcpy (pSRB->CmdBlock, pcmd->cmnd, pcmd->cmd_len); pSRB->SGIndex =0 ; pSRB->AdaptStatus =0 ;