提交 dc6712d1 编写于 作者: K Kristen Accardi 提交者: Greg Kroah-Hartman

[PATCH] ibmphp: remove TRUE and FALSE

This patch removes the defines TRUE and FALSE and just uses 0 or 1.
Signed-off-by: NKristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 783c49fc
...@@ -406,8 +406,6 @@ extern void ibmphp_hpc_stop_poll_thread (void); ...@@ -406,8 +406,6 @@ extern void ibmphp_hpc_stop_poll_thread (void);
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// HPC return codes // HPC return codes
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#define FALSE 0x00
#define TRUE 0x01
#define HPC_ERROR 0xFF #define HPC_ERROR 0xFF
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -1239,9 +1239,9 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) ...@@ -1239,9 +1239,9 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
} }
flag = slot_cur->flag; flag = slot_cur->flag;
slot_cur->flag = TRUE; slot_cur->flag = 1;
if (flag == TRUE) { if (flag == 1) {
rc = validate(slot_cur, DISABLE); rc = validate(slot_cur, DISABLE);
/* checking if powered off already & valid slot # */ /* checking if powered off already & valid slot # */
if (rc) if (rc)
......
...@@ -944,7 +944,7 @@ static int __init ebda_rsrc_controller (void) ...@@ -944,7 +944,7 @@ static int __init ebda_rsrc_controller (void)
goto error_no_slot; goto error_no_slot;
} }
tmp_slot->flag = TRUE; tmp_slot->flag = 1;
tmp_slot->capabilities = hpc_ptr->slots[index].slot_cap; tmp_slot->capabilities = hpc_ptr->slots[index].slot_cap;
if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_133_MAX) == EBDA_SLOT_133_MAX) if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_133_MAX) == EBDA_SLOT_133_MAX)
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "ibmphp.h" #include "ibmphp.h"
static int to_debug = FALSE; static int to_debug = 0;
#define debug_polling(fmt, arg...) do { if (to_debug) debug (fmt, arg); } while (0) #define debug_polling(fmt, arg...) do { if (to_debug) debug (fmt, arg); } while (0)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
...@@ -95,8 +95,8 @@ static int to_debug = FALSE; ...@@ -95,8 +95,8 @@ static int to_debug = FALSE;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// macro utilities // macro utilities
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// if bits 20,22,25,26,27,29,30 are OFF return TRUE // if bits 20,22,25,26,27,29,30 are OFF return 1
#define HPC_I2CSTATUS_CHECK(s) ((u8)((s & 0x00000A76) ? FALSE : TRUE)) #define HPC_I2CSTATUS_CHECK(s) ((u8)((s & 0x00000A76) ? 0 : 1))
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// global variables // global variables
...@@ -136,8 +136,8 @@ void __init ibmphp_hpc_initvars (void) ...@@ -136,8 +136,8 @@ void __init ibmphp_hpc_initvars (void)
mutex_init(&sem_hpcaccess); mutex_init(&sem_hpcaccess);
init_MUTEX (&semOperations); init_MUTEX (&semOperations);
init_MUTEX_LOCKED (&sem_exit); init_MUTEX_LOCKED (&sem_exit);
to_debug = FALSE; to_debug = 0;
ibmphp_shutdown = FALSE; ibmphp_shutdown = 0;
tid_poll = 0; tid_poll = 0;
debug ("%s - Exit\n", __FUNCTION__); debug ("%s - Exit\n", __FUNCTION__);
...@@ -739,21 +739,21 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) ...@@ -739,21 +739,21 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd)
// check controller is still not working on the command // check controller is still not working on the command
//-------------------------------------------------------------------- //--------------------------------------------------------------------
timeout = CMD_COMPLETE_TOUT_SEC; timeout = CMD_COMPLETE_TOUT_SEC;
done = FALSE; done = 0;
while (!done) { while (!done) {
rc = hpc_wait_ctlr_notworking (HPC_CTLR_WORKING_TOUT, ctlr_ptr, wpg_bbar, rc = hpc_wait_ctlr_notworking (HPC_CTLR_WORKING_TOUT, ctlr_ptr, wpg_bbar,
&status); &status);
if (!rc) { if (!rc) {
if (NEEDTOCHECK_CMDSTATUS (cmd)) { if (NEEDTOCHECK_CMDSTATUS (cmd)) {
if (CTLR_FINISHED (status) == HPC_CTLR_FINISHED_YES) if (CTLR_FINISHED (status) == HPC_CTLR_FINISHED_YES)
done = TRUE; done = 1;
} else } else
done = TRUE; done = 1;
} }
if (!done) { if (!done) {
msleep(1000); msleep(1000);
if (timeout < 1) { if (timeout < 1) {
done = TRUE; done = 1;
err ("%s - Error command complete timeout\n", __FUNCTION__); err ("%s - Error command complete timeout\n", __FUNCTION__);
rc = -EFAULT; rc = -EFAULT;
} else } else
...@@ -799,7 +799,7 @@ void free_hpc_access (void) ...@@ -799,7 +799,7 @@ void free_hpc_access (void)
void ibmphp_lock_operations (void) void ibmphp_lock_operations (void)
{ {
down (&semOperations); down (&semOperations);
to_debug = TRUE; to_debug = 1;
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
...@@ -809,7 +809,7 @@ void ibmphp_unlock_operations (void) ...@@ -809,7 +809,7 @@ void ibmphp_unlock_operations (void)
{ {
debug ("%s - Entry\n", __FUNCTION__); debug ("%s - Entry\n", __FUNCTION__);
up (&semOperations); up (&semOperations);
to_debug = FALSE; to_debug = 0;
debug ("%s - Exit\n", __FUNCTION__); debug ("%s - Exit\n", __FUNCTION__);
} }
...@@ -937,40 +937,40 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot) ...@@ -937,40 +937,40 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
{ {
u8 status; u8 status;
int rc = 0; int rc = 0;
u8 disable = FALSE; u8 disable = 0;
u8 update = FALSE; u8 update = 0;
debug ("process_changeinstatus - Entry pslot[%p], poldslot[%p]\n", pslot, poldslot); debug ("process_changeinstatus - Entry pslot[%p], poldslot[%p]\n", pslot, poldslot);
// bit 0 - HPC_SLOT_POWER // bit 0 - HPC_SLOT_POWER
if ((pslot->status & 0x01) != (poldslot->status & 0x01)) if ((pslot->status & 0x01) != (poldslot->status & 0x01))
update = TRUE; update = 1;
// bit 1 - HPC_SLOT_CONNECT // bit 1 - HPC_SLOT_CONNECT
// ignore // ignore
// bit 2 - HPC_SLOT_ATTN // bit 2 - HPC_SLOT_ATTN
if ((pslot->status & 0x04) != (poldslot->status & 0x04)) if ((pslot->status & 0x04) != (poldslot->status & 0x04))
update = TRUE; update = 1;
// bit 3 - HPC_SLOT_PRSNT2 // bit 3 - HPC_SLOT_PRSNT2
// bit 4 - HPC_SLOT_PRSNT1 // bit 4 - HPC_SLOT_PRSNT1
if (((pslot->status & 0x08) != (poldslot->status & 0x08)) if (((pslot->status & 0x08) != (poldslot->status & 0x08))
|| ((pslot->status & 0x10) != (poldslot->status & 0x10))) || ((pslot->status & 0x10) != (poldslot->status & 0x10)))
update = TRUE; update = 1;
// bit 5 - HPC_SLOT_PWRGD // bit 5 - HPC_SLOT_PWRGD
if ((pslot->status & 0x20) != (poldslot->status & 0x20)) if ((pslot->status & 0x20) != (poldslot->status & 0x20))
// OFF -> ON: ignore, ON -> OFF: disable slot // OFF -> ON: ignore, ON -> OFF: disable slot
if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status)))
disable = TRUE; disable = 1;
// bit 6 - HPC_SLOT_BUS_SPEED // bit 6 - HPC_SLOT_BUS_SPEED
// ignore // ignore
// bit 7 - HPC_SLOT_LATCH // bit 7 - HPC_SLOT_LATCH
if ((pslot->status & 0x80) != (poldslot->status & 0x80)) { if ((pslot->status & 0x80) != (poldslot->status & 0x80)) {
update = TRUE; update = 1;
// OPEN -> CLOSE // OPEN -> CLOSE
if (pslot->status & 0x80) { if (pslot->status & 0x80) {
if (SLOT_PWRGD (pslot->status)) { if (SLOT_PWRGD (pslot->status)) {
...@@ -979,7 +979,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot) ...@@ -979,7 +979,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
msleep(1000); msleep(1000);
rc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &status); rc = ibmphp_hpc_readslot (pslot, READ_SLOTSTATUS, &status);
if (SLOT_PWRGD (status)) if (SLOT_PWRGD (status))
update = TRUE; update = 1;
else // overwrite power in pslot to OFF else // overwrite power in pslot to OFF
pslot->status &= ~HPC_SLOT_POWER; pslot->status &= ~HPC_SLOT_POWER;
} }
...@@ -987,17 +987,17 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot) ...@@ -987,17 +987,17 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
// CLOSE -> OPEN // CLOSE -> OPEN
else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD) else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD)
&& (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) { && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) {
disable = TRUE; disable = 1;
} }
// else - ignore // else - ignore
} }
// bit 4 - HPC_SLOT_BLINK_ATTN // bit 4 - HPC_SLOT_BLINK_ATTN
if ((pslot->ext_status & 0x08) != (poldslot->ext_status & 0x08)) if ((pslot->ext_status & 0x08) != (poldslot->ext_status & 0x08))
update = TRUE; update = 1;
if (disable) { if (disable) {
debug ("process_changeinstatus - disable slot\n"); debug ("process_changeinstatus - disable slot\n");
pslot->flag = FALSE; pslot->flag = 0;
rc = ibmphp_do_disable_slot (pslot); rc = ibmphp_do_disable_slot (pslot);
} }
...@@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void) ...@@ -1102,7 +1102,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void)
{ {
debug ("%s - Entry\n", __FUNCTION__); debug ("%s - Entry\n", __FUNCTION__);
ibmphp_shutdown = TRUE; ibmphp_shutdown = 1;
debug ("before locking operations \n"); debug ("before locking operations \n");
ibmphp_lock_operations (); ibmphp_lock_operations ();
debug ("after locking operations \n"); debug ("after locking operations \n");
...@@ -1136,7 +1136,7 @@ static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, v ...@@ -1136,7 +1136,7 @@ static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, v
u8 * pstatus) u8 * pstatus)
{ {
int rc = 0; int rc = 0;
u8 done = FALSE; u8 done = 0;
debug_polling ("hpc_wait_ctlr_notworking - Entry timeout[%d]\n", timeout); debug_polling ("hpc_wait_ctlr_notworking - Entry timeout[%d]\n", timeout);
...@@ -1144,14 +1144,14 @@ static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, v ...@@ -1144,14 +1144,14 @@ static int hpc_wait_ctlr_notworking (int timeout, struct controller *ctlr_ptr, v
*pstatus = ctrl_read (ctlr_ptr, wpg_bbar, WPG_CTLR_INDEX); *pstatus = ctrl_read (ctlr_ptr, wpg_bbar, WPG_CTLR_INDEX);
if (*pstatus == HPC_ERROR) { if (*pstatus == HPC_ERROR) {
rc = HPC_ERROR; rc = HPC_ERROR;
done = TRUE; done = 1;
} }
if (CTLR_WORKING (*pstatus) == HPC_CTLR_WORKING_NO) if (CTLR_WORKING (*pstatus) == HPC_CTLR_WORKING_NO)
done = TRUE; done = 1;
if (!done) { if (!done) {
msleep(1000); msleep(1000);
if (timeout < 1) { if (timeout < 1) {
done = TRUE; done = 1;
err ("HPCreadslot - Error ctlr timeout\n"); err ("HPCreadslot - Error ctlr timeout\n");
rc = HPC_ERROR; rc = HPC_ERROR;
} else } else
......
...@@ -199,7 +199,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) ...@@ -199,7 +199,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
} }
pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number); pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
flag = FALSE; flag = 0;
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
if (func->devices[i]) { if (func->devices[i]) {
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
...@@ -226,7 +226,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) ...@@ -226,7 +226,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
cleanup_count = 2; cleanup_count = 2;
goto error; goto error;
} }
flag = TRUE; flag = 1;
} }
} }
...@@ -272,7 +272,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) ...@@ -272,7 +272,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
cur_func->busno, device, function); cur_func->busno, device, function);
pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number); pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
debug ("after configuring bridge..., sec_number = %x\n", sec_number); debug ("after configuring bridge..., sec_number = %x\n", sec_number);
flag = FALSE; flag = 0;
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
if (func->devices[i]) { if (func->devices[i]) {
debug ("inside for loop, device is %x\n", i); debug ("inside for loop, device is %x\n", i);
...@@ -301,7 +301,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno) ...@@ -301,7 +301,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
cleanup_count = 2; cleanup_count = 2;
goto error; goto error;
} }
flag = TRUE; flag = 1;
} }
} }
...@@ -449,7 +449,7 @@ static int configure_device (struct pci_func *func) ...@@ -449,7 +449,7 @@ static int configure_device (struct pci_func *func)
pfmem[count]->devfunc = PCI_DEVFN(func->device, pfmem[count]->devfunc = PCI_DEVFN(func->device,
func->function); func->function);
pfmem[count]->len = len[count]; pfmem[count]->len = len[count];
pfmem[count]->fromMem = FALSE; pfmem[count]->fromMem = 0;
if (ibmphp_check_resource (pfmem[count], 0) == 0) { if (ibmphp_check_resource (pfmem[count], 0) == 0) {
ibmphp_add_resource (pfmem[count]); ibmphp_add_resource (pfmem[count]);
func->pfmem[count] = pfmem[count]; func->pfmem[count] = pfmem[count];
...@@ -467,7 +467,7 @@ static int configure_device (struct pci_func *func) ...@@ -467,7 +467,7 @@ static int configure_device (struct pci_func *func)
debug ("there's no pfmem... going into mem.\n"); debug ("there's no pfmem... going into mem.\n");
if (ibmphp_check_resource (mem_tmp, 0) == 0) { if (ibmphp_check_resource (mem_tmp, 0) == 0) {
ibmphp_add_resource (mem_tmp); ibmphp_add_resource (mem_tmp);
pfmem[count]->fromMem = TRUE; pfmem[count]->fromMem = 1;
pfmem[count]->rangeno = mem_tmp->rangeno; pfmem[count]->rangeno = mem_tmp->rangeno;
pfmem[count]->start = mem_tmp->start; pfmem[count]->start = mem_tmp->start;
pfmem[count]->end = mem_tmp->end; pfmem[count]->end = mem_tmp->end;
...@@ -571,11 +571,11 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -571,11 +571,11 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
u16 pfmem_base; u16 pfmem_base;
u32 bar[2]; u32 bar[2];
u32 len[2]; u32 len[2];
u8 flag_io = FALSE; u8 flag_io = 0;
u8 flag_mem = FALSE; u8 flag_mem = 0;
u8 flag_pfmem = FALSE; u8 flag_pfmem = 0;
u8 need_io_upper = FALSE; u8 need_io_upper = 0;
u8 need_pfmem_upper = FALSE; u8 need_pfmem_upper = 0;
struct res_needed *amount_needed = NULL; struct res_needed *amount_needed = NULL;
struct resource_node *io = NULL; struct resource_node *io = NULL;
struct resource_node *bus_io[2] = {NULL, NULL}; struct resource_node *bus_io[2] = {NULL, NULL};
...@@ -713,7 +713,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -713,7 +713,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
bus_pfmem[count]->devfunc = PCI_DEVFN(func->device, bus_pfmem[count]->devfunc = PCI_DEVFN(func->device,
func->function); func->function);
bus_pfmem[count]->len = len[count]; bus_pfmem[count]->len = len[count];
bus_pfmem[count]->fromMem = FALSE; bus_pfmem[count]->fromMem = 0;
if (ibmphp_check_resource (bus_pfmem[count], 0) == 0) { if (ibmphp_check_resource (bus_pfmem[count], 0) == 0) {
ibmphp_add_resource (bus_pfmem[count]); ibmphp_add_resource (bus_pfmem[count]);
func->pfmem[count] = bus_pfmem[count]; func->pfmem[count] = bus_pfmem[count];
...@@ -730,7 +730,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -730,7 +730,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
mem_tmp->len = bus_pfmem[count]->len; mem_tmp->len = bus_pfmem[count]->len;
if (ibmphp_check_resource (mem_tmp, 0) == 0) { if (ibmphp_check_resource (mem_tmp, 0) == 0) {
ibmphp_add_resource (mem_tmp); ibmphp_add_resource (mem_tmp);
bus_pfmem[count]->fromMem = TRUE; bus_pfmem[count]->fromMem = 1;
bus_pfmem[count]->rangeno = mem_tmp->rangeno; bus_pfmem[count]->rangeno = mem_tmp->rangeno;
ibmphp_add_pfmem_from_mem (bus_pfmem[count]); ibmphp_add_pfmem_from_mem (bus_pfmem[count]);
func->pfmem[count] = bus_pfmem[count]; func->pfmem[count] = bus_pfmem[count];
...@@ -826,7 +826,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -826,7 +826,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
if (!amount_needed->io) { if (!amount_needed->io) {
debug ("it doesn't want IO?\n"); debug ("it doesn't want IO?\n");
flag_io = TRUE; flag_io = 1;
} else { } else {
debug ("it wants %x IO behind the bridge\n", amount_needed->io); debug ("it wants %x IO behind the bridge\n", amount_needed->io);
io = kzalloc(sizeof(*io), GFP_KERNEL); io = kzalloc(sizeof(*io), GFP_KERNEL);
...@@ -843,13 +843,13 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -843,13 +843,13 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
if (ibmphp_check_resource (io, 1) == 0) { if (ibmphp_check_resource (io, 1) == 0) {
debug ("were we able to add io\n"); debug ("were we able to add io\n");
ibmphp_add_resource (io); ibmphp_add_resource (io);
flag_io = TRUE; flag_io = 1;
} }
} }
if (!amount_needed->mem) { if (!amount_needed->mem) {
debug ("it doesn't want n.e.memory?\n"); debug ("it doesn't want n.e.memory?\n");
flag_mem = TRUE; flag_mem = 1;
} else { } else {
debug ("it wants %x memory behind the bridge\n", amount_needed->mem); debug ("it wants %x memory behind the bridge\n", amount_needed->mem);
mem = kzalloc(sizeof(*mem), GFP_KERNEL); mem = kzalloc(sizeof(*mem), GFP_KERNEL);
...@@ -864,14 +864,14 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -864,14 +864,14 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
mem->len = amount_needed->mem; mem->len = amount_needed->mem;
if (ibmphp_check_resource (mem, 1) == 0) { if (ibmphp_check_resource (mem, 1) == 0) {
ibmphp_add_resource (mem); ibmphp_add_resource (mem);
flag_mem = TRUE; flag_mem = 1;
debug ("were we able to add mem\n"); debug ("were we able to add mem\n");
} }
} }
if (!amount_needed->pfmem) { if (!amount_needed->pfmem) {
debug ("it doesn't want n.e.pfmem mem?\n"); debug ("it doesn't want n.e.pfmem mem?\n");
flag_pfmem = TRUE; flag_pfmem = 1;
} else { } else {
debug ("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); debug ("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem);
pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL); pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL);
...@@ -884,10 +884,10 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -884,10 +884,10 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
pfmem->busno = func->busno; pfmem->busno = func->busno;
pfmem->devfunc = PCI_DEVFN(func->device, func->function); pfmem->devfunc = PCI_DEVFN(func->device, func->function);
pfmem->len = amount_needed->pfmem; pfmem->len = amount_needed->pfmem;
pfmem->fromMem = FALSE; pfmem->fromMem = 0;
if (ibmphp_check_resource (pfmem, 1) == 0) { if (ibmphp_check_resource (pfmem, 1) == 0) {
ibmphp_add_resource (pfmem); ibmphp_add_resource (pfmem);
flag_pfmem = TRUE; flag_pfmem = 1;
} else { } else {
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
if (!mem_tmp) { if (!mem_tmp) {
...@@ -901,10 +901,10 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -901,10 +901,10 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
mem_tmp->len = pfmem->len; mem_tmp->len = pfmem->len;
if (ibmphp_check_resource (mem_tmp, 1) == 0) { if (ibmphp_check_resource (mem_tmp, 1) == 0) {
ibmphp_add_resource (mem_tmp); ibmphp_add_resource (mem_tmp);
pfmem->fromMem = TRUE; pfmem->fromMem = 1;
pfmem->rangeno = mem_tmp->rangeno; pfmem->rangeno = mem_tmp->rangeno;
ibmphp_add_pfmem_from_mem (pfmem); ibmphp_add_pfmem_from_mem (pfmem);
flag_pfmem = TRUE; flag_pfmem = 1;
} }
} }
} }
...@@ -950,11 +950,11 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno) ...@@ -950,11 +950,11 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
if ((io_base & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) { if ((io_base & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
debug ("io 32\n"); debug ("io 32\n");
need_io_upper = TRUE; need_io_upper = 1;
} }
if ((pfmem_base & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) { if ((pfmem_base & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {
debug ("pfmem 64\n"); debug ("pfmem 64\n");
need_pfmem_upper = TRUE; need_pfmem_upper = 1;
} }
if (bus->noIORanges) { if (bus->noIORanges) {
...@@ -1119,7 +1119,7 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) ...@@ -1119,7 +1119,7 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
debug ("hdr_type behind the bridge is %x\n", hdr_type); debug ("hdr_type behind the bridge is %x\n", hdr_type);
if (hdr_type & PCI_HEADER_TYPE_BRIDGE) { if (hdr_type & PCI_HEADER_TYPE_BRIDGE) {
err ("embedded bridges not supported for hot-plugging.\n"); err ("embedded bridges not supported for hot-plugging.\n");
amount->not_correct = TRUE; amount->not_correct = 1;
return amount; return amount;
} }
...@@ -1127,12 +1127,12 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) ...@@ -1127,12 +1127,12 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
if (class == PCI_CLASS_NOT_DEFINED_VGA) { if (class == PCI_CLASS_NOT_DEFINED_VGA) {
err ("The device %x is VGA compatible and as is not supported for hot plugging. " err ("The device %x is VGA compatible and as is not supported for hot plugging. "
"Please choose another device.\n", device); "Please choose another device.\n", device);
amount->not_correct = TRUE; amount->not_correct = 1;
return amount; return amount;
} else if (class == PCI_CLASS_DISPLAY_VGA) { } else if (class == PCI_CLASS_DISPLAY_VGA) {
err ("The device %x is not supported for hot plugging. " err ("The device %x is not supported for hot plugging. "
"Please choose another device.\n", device); "Please choose another device.\n", device);
amount->not_correct = TRUE; amount->not_correct = 1;
return amount; return amount;
} }
...@@ -1192,9 +1192,9 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) ...@@ -1192,9 +1192,9 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
} /* end for */ } /* end for */
if (!howmany) if (!howmany)
amount->not_correct = TRUE; amount->not_correct = 1;
else else
amount->not_correct = FALSE; amount->not_correct = 0;
if ((amount->io) && (amount->io < IOBRIDGE)) if ((amount->io) && (amount->io < IOBRIDGE))
amount->io = IOBRIDGE; amount->io = IOBRIDGE;
if ((amount->mem) && (amount->mem < MEMBRIDGE)) if ((amount->mem) && (amount->mem < MEMBRIDGE))
......
...@@ -325,7 +325,7 @@ int __init ibmphp_rsrc_init (void) ...@@ -325,7 +325,7 @@ int __init ibmphp_rsrc_init (void)
if (!new_pfmem) if (!new_pfmem)
return -ENOMEM; return -ENOMEM;
new_pfmem->type = PFMEM; new_pfmem->type = PFMEM;
new_pfmem->fromMem = FALSE; new_pfmem->fromMem = 0;
if (ibmphp_add_resource (new_pfmem) < 0) { if (ibmphp_add_resource (new_pfmem) < 0) {
newbus = alloc_error_bus (curr, 0, 0); newbus = alloc_error_bus (curr, 0, 0);
if (!newbus) if (!newbus)
...@@ -462,7 +462,7 @@ static int add_range (int type, struct range_node *range, struct bus_node *bus_c ...@@ -462,7 +462,7 @@ static int add_range (int type, struct range_node *range, struct bus_node *bus_c
static void update_resources (struct bus_node *bus_cur, int type, int rangeno) static void update_resources (struct bus_node *bus_cur, int type, int rangeno)
{ {
struct resource_node *res = NULL; struct resource_node *res = NULL;
u8 eol = FALSE; /* end of list indicator */ u8 eol = 0; /* end of list indicator */
switch (type) { switch (type) {
case MEM: case MEM:
...@@ -488,7 +488,7 @@ static void update_resources (struct bus_node *bus_cur, int type, int rangeno) ...@@ -488,7 +488,7 @@ static void update_resources (struct bus_node *bus_cur, int type, int rangeno)
else if (res->nextRange) else if (res->nextRange)
res = res->nextRange; res = res->nextRange;
else { else {
eol = TRUE; eol = 1;
break; break;
} }
} }
...@@ -979,7 +979,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -979,7 +979,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
int noranges = 0; int noranges = 0;
u32 tmp_start; /* this is to make sure start address is divisible by the length needed */ u32 tmp_start; /* this is to make sure start address is divisible by the length needed */
u32 tmp_divide; u32 tmp_divide;
u8 flag = FALSE; u8 flag = 0;
if (!res) if (!res)
return -EINVAL; return -EINVAL;
...@@ -1046,17 +1046,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1046,17 +1046,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if ((range->start % tmp_divide) == 0) { if ((range->start % tmp_divide) == 0) {
/* just perfect, starting address is divisible by length */ /* just perfect, starting address is divisible by length */
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = range->start; start_cur = range->start;
} else { } else {
/* Needs adjusting */ /* Needs adjusting */
tmp_start = range->start; tmp_start = range->start;
flag = FALSE; flag = 0;
while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) { while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) {
if ((tmp_start % tmp_divide) == 0) { if ((tmp_start % tmp_divide) == 0) {
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = tmp_start; start_cur = tmp_start;
break; break;
...@@ -1085,17 +1085,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1085,17 +1085,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if (((res_cur->end + 1) % tmp_divide) == 0) { if (((res_cur->end + 1) % tmp_divide) == 0) {
/* just perfect, starting address is divisible by length */ /* just perfect, starting address is divisible by length */
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = res_cur->end + 1; start_cur = res_cur->end + 1;
} else { } else {
/* Needs adjusting */ /* Needs adjusting */
tmp_start = res_cur->end + 1; tmp_start = res_cur->end + 1;
flag = FALSE; flag = 0;
while ((len_tmp = range->end - tmp_start) >= res->len) { while ((len_tmp = range->end - tmp_start) >= res->len) {
if ((tmp_start % tmp_divide) == 0) { if ((tmp_start % tmp_divide) == 0) {
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = tmp_start; start_cur = tmp_start;
break; break;
...@@ -1123,17 +1123,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1123,17 +1123,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if ((len_tmp < len_cur) || (len_cur == 0)) { if ((len_tmp < len_cur) || (len_cur == 0)) {
if ((range->start % tmp_divide) == 0) { if ((range->start % tmp_divide) == 0) {
/* just perfect, starting address is divisible by length */ /* just perfect, starting address is divisible by length */
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = range->start; start_cur = range->start;
} else { } else {
/* Needs adjusting */ /* Needs adjusting */
tmp_start = range->start; tmp_start = range->start;
flag = FALSE; flag = 0;
while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) { while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) {
if ((tmp_start % tmp_divide) == 0) { if ((tmp_start % tmp_divide) == 0) {
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = tmp_start; start_cur = tmp_start;
break; break;
...@@ -1158,17 +1158,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1158,17 +1158,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if ((len_tmp < len_cur) || (len_cur == 0)) { if ((len_tmp < len_cur) || (len_cur == 0)) {
if (((res_prev->end + 1) % tmp_divide) == 0) { if (((res_prev->end + 1) % tmp_divide) == 0) {
/* just perfect, starting address's divisible by length */ /* just perfect, starting address's divisible by length */
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = res_prev->end + 1; start_cur = res_prev->end + 1;
} else { } else {
/* Needs adjusting */ /* Needs adjusting */
tmp_start = res_prev->end + 1; tmp_start = res_prev->end + 1;
flag = FALSE; flag = 0;
while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) { while ((len_tmp = res_cur->start - 1 - tmp_start) >= res->len) {
if ((tmp_start % tmp_divide) == 0) { if ((tmp_start % tmp_divide) == 0) {
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = tmp_start; start_cur = tmp_start;
break; break;
...@@ -1217,17 +1217,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1217,17 +1217,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if ((len_tmp < len_cur) || (len_cur == 0)) { if ((len_tmp < len_cur) || (len_cur == 0)) {
if ((range->start % tmp_divide) == 0) { if ((range->start % tmp_divide) == 0) {
/* just perfect, starting address's divisible by length */ /* just perfect, starting address's divisible by length */
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = range->start; start_cur = range->start;
} else { } else {
/* Needs adjusting */ /* Needs adjusting */
tmp_start = range->start; tmp_start = range->start;
flag = FALSE; flag = 0;
while ((len_tmp = range->end - tmp_start) >= res->len) { while ((len_tmp = range->end - tmp_start) >= res->len) {
if ((tmp_start % tmp_divide) == 0) { if ((tmp_start % tmp_divide) == 0) {
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = tmp_start; start_cur = tmp_start;
break; break;
...@@ -1281,17 +1281,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge) ...@@ -1281,17 +1281,17 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
if ((len_tmp < len_cur) || (len_cur == 0)) { if ((len_tmp < len_cur) || (len_cur == 0)) {
if ((range->start % tmp_divide) == 0) { if ((range->start % tmp_divide) == 0) {
/* just perfect, starting address's divisible by length */ /* just perfect, starting address's divisible by length */
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = range->start; start_cur = range->start;
} else { } else {
/* Needs adjusting */ /* Needs adjusting */
tmp_start = range->start; tmp_start = range->start;
flag = FALSE; flag = 0;
while ((len_tmp = range->end - tmp_start) >= res->len) { while ((len_tmp = range->end - tmp_start) >= res->len) {
if ((tmp_start % tmp_divide) == 0) { if ((tmp_start % tmp_divide) == 0) {
flag = TRUE; flag = 1;
len_cur = len_tmp; len_cur = len_tmp;
start_cur = tmp_start; start_cur = tmp_start;
break; break;
...@@ -1684,7 +1684,7 @@ static int __init once_over (void) ...@@ -1684,7 +1684,7 @@ static int __init once_over (void)
bus_cur = list_entry (tmp, struct bus_node, bus_list); bus_cur = list_entry (tmp, struct bus_node, bus_list);
if ((!bus_cur->rangePFMem) && (bus_cur->firstPFMem)) { if ((!bus_cur->rangePFMem) && (bus_cur->firstPFMem)) {
for (pfmem_cur = bus_cur->firstPFMem, pfmem_prev = NULL; pfmem_cur; pfmem_prev = pfmem_cur, pfmem_cur = pfmem_cur->next) { for (pfmem_cur = bus_cur->firstPFMem, pfmem_prev = NULL; pfmem_cur; pfmem_prev = pfmem_cur, pfmem_cur = pfmem_cur->next) {
pfmem_cur->fromMem = TRUE; pfmem_cur->fromMem = 1;
if (pfmem_prev) if (pfmem_prev)
pfmem_prev->next = pfmem_cur->next; pfmem_prev->next = pfmem_cur->next;
else else
...@@ -2129,7 +2129,7 @@ static int __init update_bridge_ranges (struct bus_node **bus) ...@@ -2129,7 +2129,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
pfmem->start = start_address; pfmem->start = start_address;
pfmem->end = end_address + 0xfffff; pfmem->end = end_address + 0xfffff;
pfmem->len = pfmem->end - pfmem->start + 1; pfmem->len = pfmem->end - pfmem->start + 1;
pfmem->fromMem = FALSE; pfmem->fromMem = 0;
ibmphp_add_resource (pfmem); ibmphp_add_resource (pfmem);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册