[RTEMS Project] #1944: c/src/libchip/serial/mc68681.c: mc68681_close is a nop

RTEMS trac trac at rtems.org
Sun Nov 23 19:11:40 UTC 2014


#1944: c/src/libchip/serial/mc68681.c: mc68681_close is a nop
----------------------------+----------------------------
 Reporter:  ralf.corsepius  |       Owner:  joel.sherrill
     Type:  defect          |      Status:  closed
 Priority:  normal          |   Milestone:  4.11
Component:  misc            |     Version:  4.11
 Severity:  normal          |  Resolution:  fixed
 Keywords:                  |
----------------------------+----------------------------
Changes (by joel.sherrill):

 * version:  unknown => 4.11


Old description:

> The function mc68681_close in c/src/libchip/serial/mc68681.c essentially
> is a nop.
>
> <cite>
> MC68681_STATIC int mc68681_close(
>   int      major,
>   int      minor,
>   void    *arg
> )
> {
>   uint32_t        pMC68681;
>   uint32_t        pMC68681_port;
>   setRegister_f   setReg;
>
>   pMC68681      = Console_Port_Tbl[minor]->ulCtrlPort1;
>   pMC68681_port = Console_Port_Tbl[minor]->ulCtrlPort2;
>   setReg        = Console_Port_Tbl[minor]->setRegister;
>
>   /*
>    *  Disable interrupts from this channel and then disable it totally.
>    */
>
> #if 0
>   (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_TX
> );
>   (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_RX
> );
> #endif
>
>   return(RTEMS_SUCCESSFUL);
> }
> </cite>
>
> Note the "#if 0" - This #define renders the function into an obscure way
> to "do nothing" - Modern gcc's diagnose this and complain about it.
>
> I don't know what to do about this issue, nor about what is intended. In
> particular, I don't know, if this "#if 0" is intentional or if fragments
> of somebody's debugging/testing have accidentially crept into the
> sources.
>
> May the folks who actually use the code please comment and/or fix this ;)

New description:

 The function mc68681_close in c/src/libchip/serial/mc68681.c essentially
 is a nop.

 <cite>
 MC68681_STATIC int mc68681_close(
   int      major,
   int      minor,
   void    *arg
 )
 {
   uint32_t        pMC68681;
   uint32_t        pMC68681_port;
   setRegister_f   setReg;

   pMC68681      = Console_Port_Tbl[minor]->ulCtrlPort1;
   pMC68681_port = Console_Port_Tbl[minor]->ulCtrlPort2;
   setReg        = Console_Port_Tbl[minor]->setRegister;

   /*
    *  Disable interrupts from this channel and then disable it totally.
    */

 #if 0
   (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_TX
 );
   (*setReg)( pMC68681_port, MC68681_COMMAND, MC68681_MODE_REG_DISABLE_RX
 );
 #endif

   return(RTEMS_SUCCESSFUL);
 }
 </cite>

 Note the "#if 0" - This #define renders the function into an obscure way
 to "do nothing" - Modern gcc's diagnose this and complain about it.

 I don't know what to do about this issue, nor about what is intended. In
 particular, I don't know, if this "#if 0" is intentional or if fragments
 of somebody's debugging/testing have accidentially crept into the sources.

 May the folks who actually use the code please comment and/or fix this ;)

--

--
Ticket URL: <http://devel.rtems.org/ticket/1944#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list