Commit 427438c6 authored by Alex Chiang's avatar Alex Chiang Committed by Jesse Barnes

PCI Hotplug: cpqphp: fix comment style

Fix up comments from C++ to C-style, wrapping if necessary, etc.
Signed-off-by: default avatarAlex Chiang <achiang@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 861fefbf
...@@ -190,7 +190,9 @@ struct hrt { ...@@ -190,7 +190,9 @@ struct hrt {
u32 reserved2; u32 reserved2;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* offsets to the hotplug resource table registers based on the above structure layout */ /* offsets to the hotplug resource table registers based on the above
* structure layout
*/
enum hrt_offsets { enum hrt_offsets {
SIG0 = offsetof(struct hrt, sig0), SIG0 = offsetof(struct hrt, sig0),
SIG1 = offsetof(struct hrt, sig1), SIG1 = offsetof(struct hrt, sig1),
...@@ -217,7 +219,9 @@ struct slot_rt { ...@@ -217,7 +219,9 @@ struct slot_rt {
u16 pre_mem_length; u16 pre_mem_length;
} __attribute__ ((packed)); } __attribute__ ((packed));
/* offsets to the hotplug slot resource table registers based on the above structure layout */ /* offsets to the hotplug slot resource table registers based on the above
* structure layout
*/
enum slot_rt_offsets { enum slot_rt_offsets {
DEV_FUNC = offsetof(struct slot_rt, dev_func), DEV_FUNC = offsetof(struct slot_rt, dev_func),
PRIMARY_BUS = offsetof(struct slot_rt, primary_bus), PRIMARY_BUS = offsetof(struct slot_rt, primary_bus),
...@@ -458,7 +462,6 @@ static inline char *slot_name(struct slot *slot) ...@@ -458,7 +462,6 @@ static inline char *slot_name(struct slot *slot)
* return_resource * return_resource
* *
* Puts node back in the resource list pointed to by head * Puts node back in the resource list pointed to by head
*
*/ */
static inline void return_resource(struct pci_resource **head, struct pci_resource *node) static inline void return_resource(struct pci_resource **head, struct pci_resource *node)
{ {
...@@ -575,13 +578,12 @@ static inline u8 read_slot_enable(struct controller *ctrl) ...@@ -575,13 +578,12 @@ static inline u8 read_slot_enable(struct controller *ctrl)
} }
/* /**
* get_controller_speed - find the current frequency/mode of controller. * get_controller_speed - find the current frequency/mode of controller.
* *
* @ctrl: controller to get frequency/mode for. * @ctrl: controller to get frequency/mode for.
* *
* Returns controller speed. * Returns controller speed.
*
*/ */
static inline u8 get_controller_speed(struct controller *ctrl) static inline u8 get_controller_speed(struct controller *ctrl)
{ {
...@@ -607,14 +609,13 @@ static inline u8 get_controller_speed(struct controller *ctrl) ...@@ -607,14 +609,13 @@ static inline u8 get_controller_speed(struct controller *ctrl)
} }
/* /**
* get_adapter_speed - find the max supported frequency/mode of adapter. * get_adapter_speed - find the max supported frequency/mode of adapter.
* *
* @ctrl: hotplug controller. * @ctrl: hotplug controller.
* @hp_slot: hotplug slot where adapter is installed. * @hp_slot: hotplug slot where adapter is installed.
* *
* Returns adapter speed. * Returns adapter speed.
*
*/ */
static inline u8 get_adapter_speed(struct controller *ctrl, u8 hp_slot) static inline u8 get_adapter_speed(struct controller *ctrl, u8 hp_slot)
{ {
...@@ -719,4 +720,3 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl) ...@@ -719,4 +720,3 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl)
} }
#endif #endif
This diff is collapsed.
This diff is collapsed.
...@@ -94,12 +94,13 @@ static u8 evbuffer[1024]; ...@@ -94,12 +94,13 @@ static u8 evbuffer[1024];
static void __iomem *compaq_int15_entry_point; static void __iomem *compaq_int15_entry_point;
static spinlock_t int15_lock; /* lock for ordering int15_bios_call() */ /* lock for ordering int15_bios_call() */
static spinlock_t int15_lock;
/* This is a series of function that deals with /* This is a series of function that deals with
setting & getting the hotplug resource table in some environment variable. * setting & getting the hotplug resource table in some environment variable.
*/ */
/* /*
* We really shouldn't be doing this unless there is a _very_ good reason to!!! * We really shouldn't be doing this unless there is a _very_ good reason to!!!
...@@ -210,14 +211,16 @@ static int load_HRT (void __iomem *rom_start) ...@@ -210,14 +211,16 @@ static int load_HRT (void __iomem *rom_start)
available = 1024; available = 1024;
// Now load the EV /* Now load the EV */
temp_dword = available; temp_dword = available;
rc = access_EV(READ_EV, "CQTHPS", evbuffer, &temp_dword); rc = access_EV(READ_EV, "CQTHPS", evbuffer, &temp_dword);
evbuffer_length = temp_dword; evbuffer_length = temp_dword;
// We're maintaining the resource lists so write FF to invalidate old info /* We're maintaining the resource lists so write FF to invalidate old
* info
*/
temp_dword = 1; temp_dword = 1;
rc = access_EV(WRITE_EV, "CQTHPS", &temp_byte, &temp_dword); rc = access_EV(WRITE_EV, "CQTHPS", &temp_byte, &temp_dword);
...@@ -264,12 +267,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -264,12 +267,12 @@ static u32 store_HRT (void __iomem *rom_start)
ctrl = cpqhp_ctrl_list; ctrl = cpqhp_ctrl_list;
// The revision of this structure /* The revision of this structure */
rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// The number of controllers /* The number of controllers */
rc = add_byte( &pFill, 1, &usedbytes, &available); rc = add_byte( &pFill, 1, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -279,27 +282,27 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -279,27 +282,27 @@ static u32 store_HRT (void __iomem *rom_start)
numCtrl++; numCtrl++;
// The bus number /* The bus number */
rc = add_byte( &pFill, ctrl->bus, &usedbytes, &available); rc = add_byte( &pFill, ctrl->bus, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// The device Number /* The device Number */
rc = add_byte( &pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available); rc = add_byte( &pFill, PCI_SLOT(ctrl->pci_dev->devfn), &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// The function Number /* The function Number */
rc = add_byte( &pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available); rc = add_byte( &pFill, PCI_FUNC(ctrl->pci_dev->devfn), &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// Skip the number of available entries /* Skip the number of available entries */
rc = add_dword( &pFill, 0, &usedbytes, &available); rc = add_dword( &pFill, 0, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// Figure out memory Available /* Figure out memory Available */
resNode = ctrl->mem_head; resNode = ctrl->mem_head;
...@@ -308,12 +311,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -308,12 +311,12 @@ static u32 store_HRT (void __iomem *rom_start)
while (resNode) { while (resNode) {
loop ++; loop ++;
// base /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword( &pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// length /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword( &pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -321,10 +324,10 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -321,10 +324,10 @@ static u32 store_HRT (void __iomem *rom_start)
resNode = resNode->next; resNode = resNode->next;
} }
// Fill in the number of entries /* Fill in the number of entries */
p_ev_ctrl->mem_avail = loop; p_ev_ctrl->mem_avail = loop;
// Figure out prefetchable memory Available /* Figure out prefetchable memory Available */
resNode = ctrl->p_mem_head; resNode = ctrl->p_mem_head;
...@@ -333,12 +336,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -333,12 +336,12 @@ static u32 store_HRT (void __iomem *rom_start)
while (resNode) { while (resNode) {
loop ++; loop ++;
// base /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword( &pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// length /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword( &pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -346,10 +349,10 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -346,10 +349,10 @@ static u32 store_HRT (void __iomem *rom_start)
resNode = resNode->next; resNode = resNode->next;
} }
// Fill in the number of entries /* Fill in the number of entries */
p_ev_ctrl->p_mem_avail = loop; p_ev_ctrl->p_mem_avail = loop;
// Figure out IO Available /* Figure out IO Available */
resNode = ctrl->io_head; resNode = ctrl->io_head;
...@@ -358,12 +361,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -358,12 +361,12 @@ static u32 store_HRT (void __iomem *rom_start)
while (resNode) { while (resNode) {
loop ++; loop ++;
// base /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword( &pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// length /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword( &pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -371,10 +374,10 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -371,10 +374,10 @@ static u32 store_HRT (void __iomem *rom_start)
resNode = resNode->next; resNode = resNode->next;
} }
// Fill in the number of entries /* Fill in the number of entries */
p_ev_ctrl->io_avail = loop; p_ev_ctrl->io_avail = loop;
// Figure out bus Available /* Figure out bus Available */
resNode = ctrl->bus_head; resNode = ctrl->bus_head;
...@@ -383,12 +386,12 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -383,12 +386,12 @@ static u32 store_HRT (void __iomem *rom_start)
while (resNode) { while (resNode) {
loop ++; loop ++;
// base /* base */
rc = add_dword( &pFill, resNode->base, &usedbytes, &available); rc = add_dword( &pFill, resNode->base, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
// length /* length */
rc = add_dword( &pFill, resNode->length, &usedbytes, &available); rc = add_dword( &pFill, resNode->length, &usedbytes, &available);
if (rc) if (rc)
return(rc); return(rc);
...@@ -396,7 +399,7 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -396,7 +399,7 @@ static u32 store_HRT (void __iomem *rom_start)
resNode = resNode->next; resNode = resNode->next;
} }
// Fill in the number of entries /* Fill in the number of entries */
p_ev_ctrl->bus_avail = loop; p_ev_ctrl->bus_avail = loop;
ctrl = ctrl->next; ctrl = ctrl->next;
...@@ -404,7 +407,7 @@ static u32 store_HRT (void __iomem *rom_start) ...@@ -404,7 +407,7 @@ static u32 store_HRT (void __iomem *rom_start)
p_EV_header->num_of_ctrl = numCtrl; p_EV_header->num_of_ctrl = numCtrl;
// Now store the EV /* Now store the EV */
temp_dword = usedbytes; temp_dword = usedbytes;
...@@ -449,20 +452,21 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) ...@@ -449,20 +452,21 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
struct ev_hrt_header *p_EV_header; struct ev_hrt_header *p_EV_header;
if (!evbuffer_init) { if (!evbuffer_init) {
// Read the resource list information in from NVRAM /* Read the resource list information in from NVRAM */
if (load_HRT(rom_start)) if (load_HRT(rom_start))
memset (evbuffer, 0, 1024); memset (evbuffer, 0, 1024);
evbuffer_init = 1; evbuffer_init = 1;
} }
// If we saved information in NVRAM, use it now /* If we saved information in NVRAM, use it now */
p_EV_header = (struct ev_hrt_header *) evbuffer; p_EV_header = (struct ev_hrt_header *) evbuffer;
// The following code is for systems where version 1.0 of this /* The following code is for systems where version 1.0 of this
// driver has been loaded, but doesn't support the hardware. * driver has been loaded, but doesn't support the hardware.
// In that case, the driver would incorrectly store something * In that case, the driver would incorrectly store something
// in NVRAM. * in NVRAM.
*/
if ((p_EV_header->Version == 2) || if ((p_EV_header->Version == 2) ||
((p_EV_header->Version == 1) && !ctrl->push_flag)) { ((p_EV_header->Version == 1) && !ctrl->push_flag)) {
p_byte = &(p_EV_header->next); p_byte = &(p_EV_header->next);
...@@ -491,7 +495,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) ...@@ -491,7 +495,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) if (p_byte > ((u8*)p_EV_header + evbuffer_length))
return 2; return 2;
// Skip forward to the next entry /* Skip forward to the next entry */
p_byte += (nummem + numpmem + numio + numbus) * 8; p_byte += (nummem + numpmem + numio + numbus) * 8;
if (p_byte > ((u8*)p_EV_header + evbuffer_length)) if (p_byte > ((u8*)p_EV_header + evbuffer_length))
...@@ -629,8 +633,9 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) ...@@ -629,8 +633,9 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
ctrl->bus_head = bus_node; ctrl->bus_head = bus_node;
} }
// If all of the following fail, we don't have any resources for /* If all of the following fail, we don't have any resources for
// hot plug add * hot plug add
*/
rc = 1; rc = 1;
rc &= cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); rc &= cpqhp_resource_sort_and_combine(&(ctrl->mem_head));
rc &= cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); rc &= cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head));
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment