Skip to content

Commit 26ec99b

Browse files
arndbgregkh
authored andcommitted
char/mwave: remove custom BOOLEAN type
The mwave driver has its own macros for the BOOLEAN type and the TRUE/FALSE values. This is redundant because the kernel already has bool/true/false, and it clashes with the ACPI headers that also define these types. The linux/acpi.h header is now included implicitly from mwave through the mc146818rtc.h header, as reported by Stephen Rothwell: In file included from drivers/char/mwave/smapi.c:51:0: drivers/char/mwave/smapi.h:52:0: warning: "TRUE" redefined #define TRUE 1 ^ In file included from include/acpi/acpi.h:58:0, from include/linux/acpi.h:33, from include/linux/mc146818rtc.h:21, from drivers/char/mwave/smapi.c:50: include/acpi/actypes.h:438:0: note: this is the location of the previous definition #define TRUE (1 == 1) ^ This removes the private types from mwave and uses the standard types instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Fixes: fd09cc8 ("rtc: cmos: move mc146818rtc code out of asm-generic/rtc.h") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8b7d3a9 commit 26ec99b

7 files changed

Lines changed: 93 additions & 97 deletions

File tree

‎drivers/char/mwave/3780i.c‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static void dsp3780I_WriteGenCfg(unsigned short usDspBaseIO, unsigned uIndex,
124124
MKBYTE(rSlaveControl));
125125

126126
rSlaveControl_Save = rSlaveControl;
127-
rSlaveControl.ConfigMode = TRUE;
127+
rSlaveControl.ConfigMode = true;
128128

129129
PRINTK_2(TRACE_3780I,
130130
"3780i::dsp3780i_WriteGenCfg entry rSlaveControl+ConfigMode %x\n",
@@ -155,7 +155,7 @@ unsigned char dsp3780I_ReadGenCfg(unsigned short usDspBaseIO,
155155

156156
MKBYTE(rSlaveControl) = InByteDsp(DSP_IsaSlaveControl);
157157
rSlaveControl_Save = rSlaveControl;
158-
rSlaveControl.ConfigMode = TRUE;
158+
rSlaveControl.ConfigMode = true;
159159
OutByteDsp(DSP_IsaSlaveControl, MKBYTE(rSlaveControl));
160160
OutByteDsp(DSP_ConfigAddress, (unsigned char) uIndex);
161161
ucValue = InByteDsp(DSP_ConfigData);
@@ -230,15 +230,15 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
230230
rUartCfg1.BaseIO = 3;
231231
break;
232232
}
233-
rUartCfg2.Enable = TRUE;
233+
rUartCfg2.Enable = true;
234234
}
235235

236236
rHBridgeCfg1.Reserved = rHBridgeCfg2.Reserved = 0;
237237
rHBridgeCfg1.IrqActiveLow = pSettings->bDspIrqActiveLow;
238238
rHBridgeCfg1.IrqPulse = pSettings->bDspIrqPulse;
239239
rHBridgeCfg1.Irq = (unsigned char) pIrqMap[pSettings->usDspIrq];
240240
rHBridgeCfg1.AccessMode = 1;
241-
rHBridgeCfg2.Enable = TRUE;
241+
rHBridgeCfg2.Enable = true;
242242

243243

244244
rBusmasterCfg2.Reserved = 0;
@@ -278,8 +278,8 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
278278
* soft-reset active for 10ms.
279279
*/
280280
rSlaveControl.ClockControl = 0;
281-
rSlaveControl.SoftReset = TRUE;
282-
rSlaveControl.ConfigMode = FALSE;
281+
rSlaveControl.SoftReset = true;
282+
rSlaveControl.ConfigMode = false;
283283
rSlaveControl.Reserved = 0;
284284

285285
PRINTK_4(TRACE_3780I,
@@ -302,7 +302,7 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
302302
for (i = 0; i < 11; i++)
303303
udelay(2000);
304304

305-
rSlaveControl.SoftReset = FALSE;
305+
rSlaveControl.SoftReset = false;
306306
OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl));
307307

308308
MKWORD(tval) = InWordDsp(DSP_IsaSlaveControl);
@@ -326,10 +326,10 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
326326
}
327327

328328

329-
rHBridgeControl.EnableDspInt = FALSE;
330-
rHBridgeControl.MemAutoInc = TRUE;
331-
rHBridgeControl.IoAutoInc = FALSE;
332-
rHBridgeControl.DiagnosticMode = FALSE;
329+
rHBridgeControl.EnableDspInt = false;
330+
rHBridgeControl.MemAutoInc = true;
331+
rHBridgeControl.IoAutoInc = false;
332+
rHBridgeControl.DiagnosticMode = false;
333333

334334
PRINTK_3(TRACE_3780I,
335335
"3780i::dsp3780i_EnableDSP DSP_HBridgeControl %x rHBridgeControl %x\n",
@@ -345,7 +345,7 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
345345
ChipID = ReadMsaCfg(DSP_ChipID);
346346

347347
PRINTK_2(TRACE_3780I,
348-
"3780i::dsp3780I_EnableDSP exiting bRC=TRUE, ChipID %x\n",
348+
"3780i::dsp3780I_EnableDSP exiting bRC=true, ChipID %x\n",
349349
ChipID);
350350

351351
return 0;
@@ -361,8 +361,8 @@ int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings)
361361
PRINTK_1(TRACE_3780I, "3780i::dsp3780i_DisableDSP entry\n");
362362

363363
rSlaveControl.ClockControl = 0;
364-
rSlaveControl.SoftReset = TRUE;
365-
rSlaveControl.ConfigMode = FALSE;
364+
rSlaveControl.SoftReset = true;
365+
rSlaveControl.ConfigMode = false;
366366
rSlaveControl.Reserved = 0;
367367
spin_lock_irqsave(&dsp_lock, flags);
368368
OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl));
@@ -398,14 +398,14 @@ int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings)
398398
PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Reset rHBridgeControl %x\n",
399399
MKWORD(rHBridgeControl));
400400

401-
rHBridgeControl.EnableDspInt = FALSE;
401+
rHBridgeControl.EnableDspInt = false;
402402
OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
403403
spin_unlock_irqrestore(&dsp_lock, flags);
404404

405405
/* Reset the core via the boot domain register */
406-
rBootDomain.ResetCore = TRUE;
407-
rBootDomain.Halt = TRUE;
408-
rBootDomain.NMI = TRUE;
406+
rBootDomain.ResetCore = true;
407+
rBootDomain.Halt = true;
408+
rBootDomain.NMI = true;
409409
rBootDomain.Reserved = 0;
410410

411411
PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Reset rBootDomain %x\n",
@@ -438,26 +438,26 @@ int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
438438

439439

440440
/* Transition the core to a running state */
441-
rBootDomain.ResetCore = TRUE;
442-
rBootDomain.Halt = FALSE;
443-
rBootDomain.NMI = TRUE;
441+
rBootDomain.ResetCore = true;
442+
rBootDomain.Halt = false;
443+
rBootDomain.NMI = true;
444444
rBootDomain.Reserved = 0;
445445
WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
446446

447447
udelay(5);
448448

449-
rBootDomain.ResetCore = FALSE;
449+
rBootDomain.ResetCore = false;
450450
WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
451451
udelay(5);
452452

453-
rBootDomain.NMI = FALSE;
453+
rBootDomain.NMI = false;
454454
WriteMsaCfg(DSP_MspBootDomain, MKWORD(rBootDomain));
455455
udelay(5);
456456

457457
/* Enable DSP to PC interrupt */
458458
spin_lock_irqsave(&dsp_lock, flags);
459459
MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl);
460-
rHBridgeControl.EnableDspInt = TRUE;
460+
rHBridgeControl.EnableDspInt = true;
461461

462462
PRINTK_2(TRACE_3780I, "3780i::dsp3780i_Run rHBridgeControl %x\n",
463463
MKWORD(rHBridgeControl));
@@ -466,7 +466,7 @@ int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
466466
spin_unlock_irqrestore(&dsp_lock, flags);
467467

468468

469-
PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run exit bRC=TRUE\n");
469+
PRINTK_1(TRACE_3780I, "3780i::dsp3780i_Run exit bRC=true\n");
470470

471471
return 0;
472472
}
@@ -508,7 +508,7 @@ int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
508508

509509

510510
PRINTK_1(TRACE_3780I,
511-
"3780I::dsp3780I_ReadDStore exit bRC=TRUE\n");
511+
"3780I::dsp3780I_ReadDStore exit bRC=true\n");
512512

513513
return 0;
514514
}
@@ -550,7 +550,7 @@ int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
550550

551551

552552
PRINTK_1(TRACE_3780I,
553-
"3780I::dsp3780I_ReadAndClearDStore exit bRC=TRUE\n");
553+
"3780I::dsp3780I_ReadAndClearDStore exit bRC=true\n");
554554

555555
return 0;
556556
}
@@ -592,7 +592,7 @@ int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
592592

593593

594594
PRINTK_1(TRACE_3780I,
595-
"3780I::dsp3780D_WriteDStore exit bRC=TRUE\n");
595+
"3780I::dsp3780D_WriteDStore exit bRC=true\n");
596596

597597
return 0;
598598
}
@@ -640,7 +640,7 @@ int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
640640
}
641641

642642
PRINTK_1(TRACE_3780I,
643-
"3780I::dsp3780I_ReadIStore exit bRC=TRUE\n");
643+
"3780I::dsp3780I_ReadIStore exit bRC=true\n");
644644

645645
return 0;
646646
}
@@ -689,7 +689,7 @@ int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
689689
}
690690

691691
PRINTK_1(TRACE_3780I,
692-
"3780I::dsp3780I_WriteIStore exit bRC=TRUE\n");
692+
"3780I::dsp3780I_WriteIStore exit bRC=true\n");
693693

694694
return 0;
695695
}
@@ -713,7 +713,7 @@ int dsp3780I_GetIPCSource(unsigned short usDspBaseIO,
713713
*/
714714
spin_lock_irqsave(&dsp_lock, flags);
715715
MKWORD(rHBridgeControl) = InWordDsp(DSP_HBridgeControl);
716-
rHBridgeControl.EnableDspInt = FALSE;
716+
rHBridgeControl.EnableDspInt = false;
717717
OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
718718

719719
*pusIPCSource = InWordDsp(DSP_Interrupt);
@@ -725,7 +725,7 @@ int dsp3780I_GetIPCSource(unsigned short usDspBaseIO,
725725

726726
OutWordDsp(DSP_Interrupt, (unsigned short) ~(*pusIPCSource));
727727

728-
rHBridgeControl.EnableDspInt = TRUE;
728+
rHBridgeControl.EnableDspInt = true;
729729
OutWordDsp(DSP_HBridgeControl, MKWORD(rHBridgeControl));
730730
spin_unlock_irqrestore(&dsp_lock, flags);
731731

‎drivers/char/mwave/3780i.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typedef struct {
101101
} DSP_UART_CFG_1;
102102

103103
typedef struct {
104-
unsigned char Enable:1; /* RW: Enable I/O and IRQ: 0=FALSE, 1=TRUE */
104+
unsigned char Enable:1; /* RW: Enable I/O and IRQ: 0=false, 1=true */
105105
unsigned char Reserved:7; /* 0: Reserved */
106106
} DSP_UART_CFG_2;
107107

@@ -114,7 +114,7 @@ typedef struct {
114114
} DSP_HBRIDGE_CFG_1;
115115

116116
typedef struct {
117-
unsigned char Enable:1; /* RW: enable I/O and IRQ: 0=FALSE, 1=TRUE */
117+
unsigned char Enable:1; /* RW: enable I/O and IRQ: 0=false, 1=true */
118118
unsigned char Reserved:7; /* 0: Reserved */
119119
} DSP_HBRIDGE_CFG_2;
120120

@@ -133,12 +133,12 @@ typedef struct {
133133

134134

135135
typedef struct {
136-
unsigned char GateIOCHRDY:1; /* RW: Enable IOCHRDY gating: 0=FALSE, 1=TRUE */
136+
unsigned char GateIOCHRDY:1; /* RW: Enable IOCHRDY gating: 0=false, 1=true */
137137
unsigned char Reserved:7; /* 0: Reserved */
138138
} DSP_ISA_PROT_CFG;
139139

140140
typedef struct {
141-
unsigned char Enable:1; /* RW: Enable low power suspend/resume 0=FALSE, 1=TRUE */
141+
unsigned char Enable:1; /* RW: Enable low power suspend/resume 0=false, 1=true */
142142
unsigned char Reserved:7; /* 0: Reserved */
143143
} DSP_POWER_MGMT_CFG;
144144

‎drivers/char/mwave/mwavedd.c‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
296296
pDrvData->IPCs[ipcnum].usIntCount);
297297

298298
mutex_lock(&mwave_mutex);
299-
pDrvData->IPCs[ipcnum].bIsHere = FALSE;
300-
pDrvData->IPCs[ipcnum].bIsEnabled = TRUE;
299+
pDrvData->IPCs[ipcnum].bIsHere = false;
300+
pDrvData->IPCs[ipcnum].bIsEnabled = true;
301301
mutex_unlock(&mwave_mutex);
302302

303303
PRINTK_2(TRACE_MWAVE,
@@ -324,15 +324,15 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
324324
pDrvData->IPCs[ipcnum].usIntCount);
325325

326326
mutex_lock(&mwave_mutex);
327-
if (pDrvData->IPCs[ipcnum].bIsEnabled == TRUE) {
327+
if (pDrvData->IPCs[ipcnum].bIsEnabled == true) {
328328
DECLARE_WAITQUEUE(wait, current);
329329

330330
PRINTK_2(TRACE_MWAVE,
331331
"mwavedd::mwave_ioctl, thread for"
332332
" ipc %x going to sleep\n",
333333
ipcnum);
334334
add_wait_queue(&pDrvData->IPCs[ipcnum].ipc_wait_queue, &wait);
335-
pDrvData->IPCs[ipcnum].bIsHere = TRUE;
335+
pDrvData->IPCs[ipcnum].bIsHere = true;
336336
set_current_state(TASK_INTERRUPTIBLE);
337337
/* check whether an event was signalled by */
338338
/* the interrupt handler while we were gone */
@@ -355,7 +355,7 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
355355
" application\n",
356356
ipcnum);
357357
}
358-
pDrvData->IPCs[ipcnum].bIsHere = FALSE;
358+
pDrvData->IPCs[ipcnum].bIsHere = false;
359359
remove_wait_queue(&pDrvData->IPCs[ipcnum].ipc_wait_queue, &wait);
360360
set_current_state(TASK_RUNNING);
361361
PRINTK_2(TRACE_MWAVE,
@@ -384,9 +384,9 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd,
384384
return -EINVAL;
385385
}
386386
mutex_lock(&mwave_mutex);
387-
if (pDrvData->IPCs[ipcnum].bIsEnabled == TRUE) {
388-
pDrvData->IPCs[ipcnum].bIsEnabled = FALSE;
389-
if (pDrvData->IPCs[ipcnum].bIsHere == TRUE) {
387+
if (pDrvData->IPCs[ipcnum].bIsEnabled == true) {
388+
pDrvData->IPCs[ipcnum].bIsEnabled = false;
389+
if (pDrvData->IPCs[ipcnum].bIsHere == true) {
390390
wake_up_interruptible(&pDrvData->IPCs[ipcnum].ipc_wait_queue);
391391
}
392392
}
@@ -541,7 +541,7 @@ static void mwave_exit(void)
541541

542542
if (pDrvData->device_registered) {
543543
device_unregister(&mwave_device);
544-
pDrvData->device_registered = FALSE;
544+
pDrvData->device_registered = false;
545545
}
546546
#endif
547547

@@ -576,16 +576,16 @@ static int __init mwave_init(void)
576576

577577
memset(&mwave_s_mdd, 0, sizeof(MWAVE_DEVICE_DATA));
578578

579-
pDrvData->bBDInitialized = FALSE;
580-
pDrvData->bResourcesClaimed = FALSE;
581-
pDrvData->bDSPEnabled = FALSE;
582-
pDrvData->bDSPReset = FALSE;
583-
pDrvData->bMwaveDevRegistered = FALSE;
579+
pDrvData->bBDInitialized = false;
580+
pDrvData->bResourcesClaimed = false;
581+
pDrvData->bDSPEnabled = false;
582+
pDrvData->bDSPReset = false;
583+
pDrvData->bMwaveDevRegistered = false;
584584
pDrvData->sLine = -1;
585585

586586
for (i = 0; i < ARRAY_SIZE(pDrvData->IPCs); i++) {
587-
pDrvData->IPCs[i].bIsEnabled = FALSE;
588-
pDrvData->IPCs[i].bIsHere = FALSE;
587+
pDrvData->IPCs[i].bIsEnabled = false;
588+
pDrvData->IPCs[i].bIsHere = false;
589589
pDrvData->IPCs[i].usIntCount = 0; /* no ints received yet */
590590
init_waitqueue_head(&pDrvData->IPCs[i].ipc_wait_queue);
591591
}
@@ -601,7 +601,7 @@ static int __init mwave_init(void)
601601
" Failed to initialize board data\n");
602602
goto cleanup_error;
603603
}
604-
pDrvData->bBDInitialized = TRUE;
604+
pDrvData->bBDInitialized = true;
605605

606606
retval = tp3780I_CalcResources(&pDrvData->rBDData);
607607
PRINTK_2(TRACE_MWAVE,
@@ -626,7 +626,7 @@ static int __init mwave_init(void)
626626
" Failed to claim resources\n");
627627
goto cleanup_error;
628628
}
629-
pDrvData->bResourcesClaimed = TRUE;
629+
pDrvData->bResourcesClaimed = true;
630630

631631
retval = tp3780I_EnableDSP(&pDrvData->rBDData);
632632
PRINTK_2(TRACE_MWAVE,
@@ -639,15 +639,15 @@ static int __init mwave_init(void)
639639
" Failed to enable DSP\n");
640640
goto cleanup_error;
641641
}
642-
pDrvData->bDSPEnabled = TRUE;
642+
pDrvData->bDSPEnabled = true;
643643

644644
if (misc_register(&mwave_misc_dev) < 0) {
645645
PRINTK_ERROR(KERN_ERR_MWAVE
646646
"mwavedd:mwave_init: Error:"
647647
" Failed to register misc device\n");
648648
goto cleanup_error;
649649
}
650-
pDrvData->bMwaveDevRegistered = TRUE;
650+
pDrvData->bMwaveDevRegistered = true;
651651

652652
pDrvData->sLine = register_serial_portandirq(
653653
pDrvData->rBDData.rDspSettings.usUartBaseIO,
@@ -668,7 +668,7 @@ static int __init mwave_init(void)
668668

669669
if (device_register(&mwave_device))
670670
goto cleanup_error;
671-
pDrvData->device_registered = TRUE;
671+
pDrvData->device_registered = true;
672672
for (i = 0; i < ARRAY_SIZE(mwave_dev_attrs); i++) {
673673
if(device_create_file(&mwave_device, mwave_dev_attrs[i])) {
674674
PRINTK_ERROR(KERN_ERR_MWAVE

0 commit comments

Comments
 (0)