LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Richard Knutsson <ricknu-0@student.ltu.se>
Cc: akpm@osdl.org, trivial@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/telephony/ixj: Convert to generic boolean
Date: Thu, 8 Feb 2007 17:32:07 -0800	[thread overview]
Message-ID: <20070208173207.2cddd490.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20070208213935.4864.40124.sendpatchset@thinktank.campus.ltu.se>

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@student.ltu.se>

Looks good to me.  Built on x86_64.

Acked-by: Randy Dunlap <randy.dunlap@oracle.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 ***

      reply	other threads:[~2007-02-09  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 21:39 Richard Knutsson
2007-02-09  1:32 ` Randy Dunlap [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070208173207.2cddd490.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricknu-0@student.ltu.se \
    --cc=trivial@kernel.org \
    --subject='Re: [PATCH] drivers/telephony/ixj: Convert to generic boolean' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).