[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20070208173207.2cddd490.randy.dunlap@oracle.com>
Date: Thu, 8 Feb 2007 17:32:07 -0800
From: Randy Dunlap <randy.dunlap@...cle.com>
To: Richard Knutsson <ricknu-0@...dent.ltu.se>
Cc: akpm@...l.org, trivial@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/telephony/ixj: Convert to generic boolean
On Thu, 8 Feb 2007 22:39:35 +0100 (MET) Richard Knutsson wrote:
> Convert:
> BOOL -> bool
> FALSE -> false
> TRUE -> true
>
> Change a variable ('mContinue') to boolean from char, since it is used
> as boolean.
>
> Signed-off-by: Richard Knutsson <ricknu-0@...dent.ltu.se>
Looks good to me. Built on x86_64.
Acked-by: Randy Dunlap <randy.dunlap@...cle.com>
> ---
> Compile-tested with "allyes", "allmod" and "allno" on i386
> Get a few warning-messages, none related to this patch
> Sent on 2007-01-21
>
>
> diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
> index df4cc1f..58deaac 100644
> --- a/drivers/telephony/ixj.c
> +++ b/drivers/telephony/ixj.c
> @@ -648,9 +648,9 @@ static inline BYTE SLIC_GetState(IXJ *j)
> return j->pld_slicr.bits.state;
> }
>
> -static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> +static bool SLIC_SetState(BYTE byState, IXJ *j)
> {
> - BOOL fRetVal = FALSE;
> + bool fRetVal = false;
>
> if (j->cardtype == QTI_PHONECARD) {
> if (j->flags.pcmciasct) {
> @@ -659,14 +659,14 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> case PLD_SLIC_STATE_OC:
> j->pslic.bits.powerdown = 1;
> j->pslic.bits.ring0 = j->pslic.bits.ring1 = 0;
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_RINGING:
> if (j->readers || j->writers) {
> j->pslic.bits.powerdown = 0;
> j->pslic.bits.ring0 = 1;
> j->pslic.bits.ring1 = 0;
> - fRetVal = TRUE;
> + fRetVal = true;
> }
> break;
> case PLD_SLIC_STATE_OHT: /* On-hook transmit */
> @@ -679,14 +679,14 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pslic.bits.powerdown = 1;
> }
> j->pslic.bits.ring0 = j->pslic.bits.ring1 = 0;
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_APR: /* Active polarity reversal */
>
> case PLD_SLIC_STATE_OHTPR: /* OHT polarity reversal */
>
> default:
> - fRetVal = FALSE;
> + fRetVal = false;
> break;
> }
> j->psccr.bits.dev = 3;
> @@ -703,7 +703,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 0;
> j->pld_slicw.bits.b2en = 0;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_RINGING:
> j->pld_slicw.bits.c1 = 1;
> @@ -711,7 +711,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 0;
> j->pld_slicw.bits.b2en = 1;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_ACTIVE:
> j->pld_slicw.bits.c1 = 0;
> @@ -719,7 +719,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 0;
> j->pld_slicw.bits.b2en = 0;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_OHT: /* On-hook transmit */
>
> @@ -728,7 +728,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 0;
> j->pld_slicw.bits.b2en = 0;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_TIPOPEN:
> j->pld_slicw.bits.c1 = 0;
> @@ -736,7 +736,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 1;
> j->pld_slicw.bits.b2en = 0;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_STANDBY:
> j->pld_slicw.bits.c1 = 1;
> @@ -744,7 +744,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 1;
> j->pld_slicw.bits.b2en = 1;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_APR: /* Active polarity reversal */
>
> @@ -753,7 +753,7 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 1;
> j->pld_slicw.bits.b2en = 0;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> case PLD_SLIC_STATE_OHTPR: /* OHT polarity reversal */
>
> @@ -762,10 +762,10 @@ static BOOL SLIC_SetState(BYTE byState, IXJ *j)
> j->pld_slicw.bits.c3 = 1;
> j->pld_slicw.bits.b2en = 0;
> outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01);
> - fRetVal = TRUE;
> + fRetVal = true;
> break;
> default:
> - fRetVal = FALSE;
> + fRetVal = false;
> break;
> }
> }
> @@ -4969,7 +4969,8 @@ static int ixj_daa_cid_read(IXJ *j)
> {
> int i;
> BYTES bytes;
> - char CID[ALISDAA_CALLERID_SIZE], mContinue;
> + char CID[ALISDAA_CALLERID_SIZE];
> + bool mContinue;
> char *pIn, *pOut;
>
> if (!SCI_Prepare(j))
> @@ -5013,7 +5014,7 @@ static int ixj_daa_cid_read(IXJ *j)
>
> pIn = CID;
> pOut = j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID;
> - mContinue = 1;
> + mContinue = true;
> while (mContinue) {
> if ((pIn[1] & 0x03) == 0x01) {
> pOut[0] = pIn[0];
> @@ -5027,7 +5028,7 @@ static int ixj_daa_cid_read(IXJ *j)
> if ((pIn[4] & 0xc0) == 0x40) {
> pOut[3] = ((pIn[4] & 0x3f) << 2) | ((pIn[3] & 0xc0) >> 6);
> } else {
> - mContinue = FALSE;
> + mContinue = false;
> }
> pIn += 5, pOut += 4;
> }
> @@ -7498,7 +7499,7 @@ static BYTE PCIEE_ReadBit(WORD wEEPROMAddress, BYTE lastLCC)
> return ((inb(wEEPROMAddress) >> 3) & 1);
> }
>
> -static BOOL PCIEE_ReadWord(WORD wAddress, WORD wLoc, WORD * pwResult)
> +static bool PCIEE_ReadWord(WORD wAddress, WORD wLoc, WORD * pwResult)
> {
> BYTE lastLCC;
> WORD wEEPROMAddress = wAddress + 3;
> diff --git a/drivers/telephony/ixj.h b/drivers/telephony/ixj.h
> index 8d69bcd..4c32a43 100644
> --- a/drivers/telephony/ixj.h
> +++ b/drivers/telephony/ixj.h
> @@ -48,15 +48,11 @@
> typedef __u16 WORD;
> typedef __u32 DWORD;
> typedef __u8 BYTE;
> -typedef __u8 BOOL;
>
> #ifndef IXJMAX
> #define IXJMAX 16
> #endif
>
> -#define TRUE 1
> -#define FALSE 0
> -
> /******************************************************************************
> *
> * This structure when unioned with the structures below makes simple byte
> -
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists