Skip to content

Commit

Permalink
[ACPI] Lindent all ACPI files
Browse files Browse the repository at this point in the history
Signed-off-by: Len Brown <[email protected]>
  • Loading branch information
lenb committed Aug 5, 2005
1 parent c65ade4 commit 4be44fc
Show file tree
Hide file tree
Showing 190 changed files with 24,398 additions and 29,344 deletions.
530 changes: 260 additions & 270 deletions arch/i386/kernel/acpi/boot.c

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions arch/i386/kernel/acpi/earlyquirk.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,44 @@
#include <asm/pci-direct.h>
#include <asm/acpi.h>

static int __init check_bridge(int vendor, int device)
static int __init check_bridge(int vendor, int device)
{
/* According to Nvidia all timer overrides are bogus. Just ignore
them all. */
if (vendor == PCI_VENDOR_ID_NVIDIA) {
acpi_skip_timer_override = 1;
if (vendor == PCI_VENDOR_ID_NVIDIA) {
acpi_skip_timer_override = 1;
}
return 0;
}
void __init check_acpi_pci(void)
{
int num,slot,func;

void __init check_acpi_pci(void)
{
int num, slot, func;

/* Assume the machine supports type 1. If not it will
always read ffffffff and should not have any side effect. */

/* Poor man's PCI discovery */
for (num = 0; num < 32; num++) {
for (slot = 0; slot < 32; slot++) {
for (func = 0; func < 8; func++) {
for (num = 0; num < 32; num++) {
for (slot = 0; slot < 32; slot++) {
for (func = 0; func < 8; func++) {
u32 class;
u32 vendor;
class = read_pci_config(num,slot,func,
class = read_pci_config(num, slot, func,
PCI_CLASS_REVISION);
if (class == 0xffffffff)
break;
break;

if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
continue;
vendor = read_pci_config(num, slot, func,
continue;

vendor = read_pci_config(num, slot, func,
PCI_VENDOR_ID);
if (check_bridge(vendor&0xffff, vendor >> 16))
return;
}

if (check_bridge(vendor & 0xffff, vendor >> 16))
return;
}

}
}
}
35 changes: 18 additions & 17 deletions arch/i386/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ extern void zap_low_mappings(void);

extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));

static void init_low_mapping(pgd_t *pgd, int pgd_limit)
static void init_low_mapping(pgd_t * pgd, int pgd_limit)
{
int pgd_ofs = 0;

while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD));
while ((pgd_ofs < pgd_limit)
&& (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD));
pgd_ofs++, pgd++;
}
flush_tlb_all();
Expand All @@ -37,12 +38,13 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit)
* Create an identity mapped page table and copy the wakeup routine to
* low memory.
*/
int acpi_save_state_mem (void)
int acpi_save_state_mem(void)
{
if (!acpi_wakeup_address)
return 1;
init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
memcpy((void *)acpi_wakeup_address, &wakeup_start,
&wakeup_end - &wakeup_start);
acpi_copy_wakeup_routine(acpi_wakeup_address);

return 0;
Expand All @@ -51,7 +53,7 @@ int acpi_save_state_mem (void)
/*
* acpi_restore_state - undo effects of acpi_save_state_mem
*/
void acpi_restore_state_mem (void)
void acpi_restore_state_mem(void)
{
zap_low_mappings();
}
Expand All @@ -67,7 +69,8 @@ void acpi_restore_state_mem (void)
void __init acpi_reserve_bootmem(void)
{
if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) {
printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n");
printk(KERN_ERR
"ACPI: Wakeup code way too big, S3 disabled.\n");
return;
}

Expand All @@ -90,25 +93,23 @@ static int __init acpi_sleep_setup(char *str)
return 1;
}


__setup("acpi_sleep=", acpi_sleep_setup);


static __init int reset_videomode_after_s3(struct dmi_system_id *d)
{
acpi_video_flags |= 2;
return 0;
}

static __initdata struct dmi_system_id acpisleep_dmi_table[] = {
{ /* Reset video mode after returning from ACPI S3 sleep */
.callback = reset_videomode_after_s3,
.ident = "Toshiba Satellite 4030cdt",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
},
},
{ }
{ /* Reset video mode after returning from ACPI S3 sleep */
.callback = reset_videomode_after_s3,
.ident = "Toshiba Satellite 4030cdt",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
},
},
{}
};

static int __init acpisleep_dmi_init(void)
Expand Down
37 changes: 21 additions & 16 deletions arch/ia64/kernel/acpi-ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@
#include <asm/acpi-ext.h>

struct acpi_vendor_descriptor {
u8 guid_id;
efi_guid_t guid;
u8 guid_id;
efi_guid_t guid;
};

struct acpi_vendor_info {
struct acpi_vendor_descriptor *descriptor;
u8 *data;
u32 length;
struct acpi_vendor_descriptor *descriptor;
u8 *data;
u32 length;
};

acpi_status
acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
{
struct acpi_vendor_info *info = (struct acpi_vendor_info *) context;
struct acpi_vendor_info *info = (struct acpi_vendor_info *)context;
struct acpi_resource_vendor *vendor;
struct acpi_vendor_descriptor *descriptor;
u32 length;

if (resource->id != ACPI_RSTYPE_VENDOR)
return AE_OK;

vendor = (struct acpi_resource_vendor *) &resource->data;
descriptor = (struct acpi_vendor_descriptor *) vendor->reserved;
vendor = (struct acpi_resource_vendor *)&resource->data;
descriptor = (struct acpi_vendor_descriptor *)vendor->reserved;
if (vendor->length <= sizeof(*info->descriptor) ||
descriptor->guid_id != info->descriptor->guid_id ||
efi_guidcmp(descriptor->guid, info->descriptor->guid))
Expand All @@ -50,21 +50,24 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
if (!info->data)
return AE_NO_MEMORY;

memcpy(info->data, vendor->reserved + sizeof(struct acpi_vendor_descriptor), length);
memcpy(info->data,
vendor->reserved + sizeof(struct acpi_vendor_descriptor),
length);
info->length = length;
return AE_CTRL_TERMINATE;
}

acpi_status
acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
u8 **data, u32 *length)
acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id,
u8 ** data, u32 * length)
{
struct acpi_vendor_info info;

info.descriptor = id;
info.data = NULL;

acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, &info);
acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match,
&info);
if (!info.data)
return AE_NOT_FOUND;

Expand All @@ -75,17 +78,19 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,

struct acpi_vendor_descriptor hp_ccsr_descriptor = {
.guid_id = 2,
.guid = EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad)
.guid =
EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01,
0x37, 0x0e, 0xad)
};

acpi_status
hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length)
{
acpi_status status;
u8 *data;
u32 length;

status = acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
status =
acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);

if (ACPI_FAILURE(status) || length != 16)
return AE_NOT_FOUND;
Expand Down
Loading

0 comments on commit 4be44fc

Please sign in to comment.