Message ID | 20201102133641.474413-1-luzmaximilian@gmail.com |
---|---|
State | New |
Headers | show |
Series | ACPI: Remove trailing whitespace | expand |
On Mon, Nov 02, 2020 at 02:36:41PM +0100, Maximilian Luz wrote: > Remove trailing whitespace and fix some whitespace inconsitencies while > at it. I'm OK with this as long as somebody fixes the s/inconsitencies/inconsistencies/ above. I assume you've scanned all of drivers/acpi/ for similar issues so they can all be fixed at once. This is up to Rafael, of course. > Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> > --- > drivers/acpi/pci_irq.c | 2 +- > drivers/acpi/pci_link.c | 12 ++++++------ > drivers/acpi/power.c | 4 ++-- > drivers/acpi/processor_perflib.c | 4 ++-- > 4 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c > index dea8a60e18a4..14ee631cb7cf 100644 > --- a/drivers/acpi/pci_irq.c > +++ b/drivers/acpi/pci_irq.c > @@ -175,7 +175,7 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev, > * configure the IRQ assigned to this slot|dev|pin. The 'source_index' > * indicates which resource descriptor in the resource template (of > * the link device) this interrupt is allocated from. > - * > + * > * NOTE: Don't query the Link Device for IRQ information at this time > * because Link Device enumeration may not have occurred yet > * (e.g. exists somewhere 'below' this _PRT entry in the ACPI > diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c > index 606da5d77ad3..fb4c5632a232 100644 > --- a/drivers/acpi/pci_link.c > +++ b/drivers/acpi/pci_link.c > @@ -6,8 +6,8 @@ > * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> > * Copyright (C) 2002 Dominik Brodowski <devel@brodo.de> > * > - * TBD: > - * 1. Support more than one IRQ resource entry per link device (index). > + * TBD: > + * 1. Support more than one IRQ resource entry per link device (index). > * 2. Implement start/stop mechanism and use ACPI Bus Driver facilities > * for IRQ management (e.g. start()->_SRS). > */ > @@ -249,8 +249,8 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) > } > } > > - /* > - * Query and parse _CRS to get the current IRQ assignment. > + /* > + * Query and parse _CRS to get the current IRQ assignment. > */ > > status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, > @@ -396,7 +396,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) > /* > * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt > * Link Devices to move the PIRQs around to minimize sharing. > - * > + * > * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs > * that the BIOS has already set to active. This is necessary because > * ACPI has no automatic means of knowing what ISA IRQs are used. Note that > @@ -414,7 +414,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) > * > * Note that PCI IRQ routers have a list of possible IRQs, > * which may not include the IRQs this table says are available. > - * > + * > * Since this heuristic can't tell the difference between a link > * that no device will attach to, vs. a link which may be shared > * by multiple active devices -- it is not optimal. > diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c > index 837b875d075e..9c4c3196cb07 100644 > --- a/drivers/acpi/power.c > +++ b/drivers/acpi/power.c > @@ -13,7 +13,7 @@ > * 1. via "Device Specific (D-State) Control" > * 2. via "Power Resource Control". > * The code below deals with ACPI Power Resources control. > - * > + * > * An ACPI "power resource object" represents a software controllable power > * plane, clock plane, or other resource depended on by a device. > * > @@ -690,7 +690,7 @@ int acpi_device_sleep_wake(struct acpi_device *dev, > > /* > * Prepare a wakeup device, two steps (Ref ACPI 2.0:P229): > - * 1. Power on the power resources required for the wakeup device > + * 1. Power on the power resources required for the wakeup device > * 2. Execute _DSW (Device Sleep Wake) or (deprecated in ACPI 3.0) _PSW (Power > * State Wake) for the device, if present > */ > diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c > index 5909e8fa4013..f00e66de6c53 100644 > --- a/drivers/acpi/processor_perflib.c > +++ b/drivers/acpi/processor_perflib.c > @@ -627,7 +627,7 @@ int acpi_processor_preregister_performance( > goto err_ret; > > /* > - * Now that we have _PSD data from all CPUs, lets setup P-state > + * Now that we have _PSD data from all CPUs, lets setup P-state > * domain info. > */ > for_each_possible_cpu(i) { > @@ -693,7 +693,7 @@ int acpi_processor_preregister_performance( > if (match_pdomain->domain != pdomain->domain) > continue; > > - match_pr->performance->shared_type = > + match_pr->performance->shared_type = > pr->performance->shared_type; > cpumask_copy(match_pr->performance->shared_cpu_map, > pr->performance->shared_cpu_map); > -- > 2.29.2 >
On 11/3/20 10:12 PM, Bjorn Helgaas wrote: > On Mon, Nov 02, 2020 at 02:36:41PM +0100, Maximilian Luz wrote: >> Remove trailing whitespace and fix some whitespace inconsitencies while >> at it. > > I'm OK with this as long as somebody fixes the > s/inconsitencies/inconsistencies/ Sorry about that, I can resubmit if necessary. > above. I assume you've scanned all of drivers/acpi/ for similar > issues so they can all be fixed at once. Yes. I scanned drivers/acpi for trailing whitespaces after I noticed a couple of them. I did not explicitly scan for other stuff like spaces where there should be tabs, mostly because I haven't found a quick and reliable solution for that. I only noticed an inconsistent indentation when committing, so I fixed that too. > This is up to Rafael, of course. Thanks, Max
On Tue, 2020-11-03 at 22:30 +0100, Maximilian Luz wrote: > On 11/3/20 10:12 PM, Bjorn Helgaas wrote: > > On Mon, Nov 02, 2020 at 02:36:41PM +0100, Maximilian Luz wrote: > > > Remove trailing whitespace and fix some whitespace inconsitencies while > > > at it. > > > > I'm OK with this as long as somebody fixes the > > s/inconsitencies/inconsistencies/ > > Sorry about that, I can resubmit if necessary. > > > above. I assume you've scanned all of drivers/acpi/ for similar > > issues so they can all be fixed at once. > > Yes. I scanned drivers/acpi for trailing whitespaces after I noticed a > couple of them. I did not explicitly scan for other stuff like spaces > where there should be tabs, mostly because I haven't found a quick and > reliable solution for that. I only noticed an inconsistent indentation > when committing, so I fixed that too. You could try: $ git ls-files -- 'drivers/acpi/*.[ch]' | \ xargs ./scripts/checkpatch.pl -f --fix-inplace --types=CODE_INDENT Right now that produces: --- drivers/acpi/ac.c | 6 +++--- drivers/acpi/acpi_processor.c | 6 +++--- drivers/acpi/acpi_video.c | 6 +++--- drivers/acpi/acpica/rslist.c | 2 +- drivers/acpi/battery.c | 6 +++--- drivers/acpi/bus.c | 12 ++++++------ drivers/acpi/button.c | 4 ++-- drivers/acpi/ec.c | 2 +- drivers/acpi/event.c | 2 +- drivers/acpi/internal.h | 16 ++++++++-------- drivers/acpi/nfit/core.c | 10 +++++----- drivers/acpi/pci_irq.c | 4 ++-- drivers/acpi/pci_link.c | 6 +++--- drivers/acpi/pci_mcfg.c | 2 +- drivers/acpi/power.c | 6 +++--- drivers/acpi/processor_perflib.c | 2 +- drivers/acpi/processor_throttling.c | 2 +- drivers/acpi/sbs.c | 6 +++--- drivers/acpi/sbshc.c | 2 +- drivers/acpi/sbshc.h | 2 +- drivers/acpi/scan.c | 2 +- drivers/acpi/thermal.c | 4 ++-- drivers/acpi/utils.c | 2 +- drivers/acpi/video_detect.c | 16 ++++++++-------- drivers/acpi/wakeup.c | 4 ++-- 25 files changed, 66 insertions(+), 66 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 46a64e9fa716..46be80976a03 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -89,7 +89,7 @@ struct acpi_ac { #define to_acpi_ac(x) power_supply_get_drvdata(x) /* -------------------------------------------------------------------------- - AC Adapter Management + AC Adapter Management -------------------------------------------------------------------------- */ static int acpi_ac_get_state(struct acpi_ac *ac) @@ -112,7 +112,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac) } /* -------------------------------------------------------------------------- - sysfs I/F + sysfs I/F -------------------------------------------------------------------------- */ static int get_ac_property(struct power_supply *psy, enum power_supply_property psp, @@ -141,7 +141,7 @@ static enum power_supply_property ac_props[] = { }; /* -------------------------------------------------------------------------- - Driver Model + Driver Model -------------------------------------------------------------------------- */ static void acpi_ac_notify(struct acpi_device *device, u32 event) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 2ee5e05a0d69..b45102e4fbfc 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -30,7 +30,7 @@ DEFINE_PER_CPU(struct acpi_processor *, processors); EXPORT_PER_CPU_SYMBOL(processors); /* -------------------------------------------------------------------------- - Errata Handling + Errata Handling -------------------------------------------------------------------------- */ struct acpi_processor_errata errata __read_mostly; @@ -158,7 +158,7 @@ static int acpi_processor_errata(void) } /* -------------------------------------------------------------------------- - Initialization + Initialization -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_HOTPLUG_CPU @@ -441,7 +441,7 @@ static int acpi_processor_add(struct acpi_device *device, #ifdef CONFIG_ACPI_HOTPLUG_CPU /* -------------------------------------------------------------------------- - Removal + Removal -------------------------------------------------------------------------- */ static void acpi_processor_remove(struct acpi_device *device) diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index bc96457c9e25..a322a7bd286b 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -578,7 +578,7 @@ acpi_video_bqc_value_to_level(struct acpi_video_device *device, ACPI_VIDEO_FIRST_LEVEL - 1 - bqc_value; level = device->brightness->levels[bqc_value + - ACPI_VIDEO_FIRST_LEVEL]; + ACPI_VIDEO_FIRST_LEVEL]; } else { level = bqc_value; } @@ -990,8 +990,8 @@ acpi_video_init_brightness(struct acpi_video_device *device) goto out_free_levels; ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "found %d brightness levels\n", - br->count - ACPI_VIDEO_FIRST_LEVEL)); + "found %d brightness levels\n", + br->count - ACPI_VIDEO_FIRST_LEVEL)); return 0; out_free_levels: diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c index 0307675d37be..105739aebc39 100644 --- a/drivers/acpi/acpica/rslist.c +++ b/drivers/acpi/acpica/rslist.c @@ -177,7 +177,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, } status = acpi_rs_convert_resource_to_aml(resource, - ACPI_CAST_PTR(union + ACPI_CAST_PTR(union aml_resource, aml), conversion_table); diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index cab4af532f36..d27448b3369b 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -378,7 +378,7 @@ static enum power_supply_property energy_battery_full_cap_broken_props[] = { }; /* -------------------------------------------------------------------------- - Battery Management + Battery Management -------------------------------------------------------------------------- */ struct acpi_offsets { size_t offset; /* offset inside struct acpi_sbs_battery */ @@ -987,7 +987,7 @@ static int acpi_battery_update(struct acpi_battery *battery, bool resume) */ if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) || (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) && - (battery->capacity_now <= battery->alarm))) + (battery->capacity_now <= battery->alarm))) acpi_pm_wakeup_event(&battery->device->dev); return result; @@ -1013,7 +1013,7 @@ static void acpi_battery_refresh(struct acpi_battery *battery) } /* -------------------------------------------------------------------------- - Driver Interface + Driver Interface -------------------------------------------------------------------------- */ static void acpi_battery_notify(struct acpi_device *device, u32 event) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 1682f8b454a2..1d48e63cce49 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -72,7 +72,7 @@ static const struct dmi_system_id dsdt_dmi_table[] __initconst = { #endif /* -------------------------------------------------------------------------- - Device Management + Device Management -------------------------------------------------------------------------- */ acpi_status acpi_bus_get_status_handle(acpi_handle handle, @@ -335,7 +335,7 @@ static void acpi_bus_osc_support(void) } /* -------------------------------------------------------------------------- - Notification Handling + Notification Handling -------------------------------------------------------------------------- */ /** @@ -527,7 +527,7 @@ static int __init acpi_setup_sb_notify_handler(void) } /* -------------------------------------------------------------------------- - Device Matching + Device Matching -------------------------------------------------------------------------- */ /** @@ -839,7 +839,7 @@ bool acpi_driver_match_device(struct device *dev, EXPORT_SYMBOL_GPL(acpi_driver_match_device); /* -------------------------------------------------------------------------- - ACPI Driver Management + ACPI Driver Management -------------------------------------------------------------------------- */ /** @@ -881,7 +881,7 @@ void acpi_bus_unregister_driver(struct acpi_driver *driver) EXPORT_SYMBOL(acpi_bus_unregister_driver); /* -------------------------------------------------------------------------- - ACPI Bus operations + ACPI Bus operations -------------------------------------------------------------------------- */ static int acpi_bus_match(struct device *dev, struct device_driver *drv) @@ -964,7 +964,7 @@ struct bus_type acpi_bus_type = { }; /* -------------------------------------------------------------------------- - Initialization/Cleanup + Initialization/Cleanup -------------------------------------------------------------------------- */ static int __init acpi_bus_init_irq(void) diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 0761529cac05..746661794c51 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -151,7 +151,7 @@ module_param(lid_report_interval, ulong, 0644); MODULE_PARM_DESC(lid_report_interval, "Interval (ms) between lid key events"); /* -------------------------------------------------------------------------- - FS Interface (/proc) + FS Interface (/proc) -------------------------------------------------------------------------- */ static struct proc_dir_entry *acpi_button_dir; @@ -343,7 +343,7 @@ static int acpi_button_remove_fs(struct acpi_device *device) } /* -------------------------------------------------------------------------- - Driver Interface + Driver Interface -------------------------------------------------------------------------- */ int acpi_lid_open(void) { diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index e0cb1bcfffb2..05c2f506fb09 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1037,7 +1037,7 @@ void acpi_ec_unblock_transactions(void) } /* -------------------------------------------------------------------------- - Event Management + Event Management -------------------------------------------------------------------------- */ static struct acpi_ec_query_handler * acpi_ec_get_query_handler_by_value(struct acpi_ec *ec, u8 value) diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 170643927044..92e59f45329b 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c @@ -31,7 +31,7 @@ int acpi_notifier_call_chain(struct acpi_device *dev, u32 type, u32 data) event.type = type; event.data = data; return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event) - == NOTIFY_BAD) ? -EINVAL : 0; + == NOTIFY_BAD) ? -EINVAL : 0; } EXPORT_SYMBOL(acpi_notifier_call_chain); diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 43411a7457cd..ac22802bf9b6 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -89,7 +89,7 @@ acpi_status acpi_sysfs_table_handler(u32 event, void *table, void *context); void acpi_scan_table_handler(u32 event, void *table, void *context); /* -------------------------------------------------------------------------- - Device Node Initialization / Removal + Device Node Initialization / Removal -------------------------------------------------------------------------- */ #define ACPI_STA_DEFAULT (ACPI_STA_DEVICE_PRESENT | ACPI_STA_DEVICE_ENABLED | \ ACPI_STA_DEVICE_UI | ACPI_STA_DEVICE_FUNCTIONING) @@ -117,14 +117,14 @@ bool acpi_device_is_first_physical_node(struct acpi_device *adev, int acpi_bus_register_early_device(int type); /* -------------------------------------------------------------------------- - Device Matching and Notification + Device Matching and Notification -------------------------------------------------------------------------- */ struct acpi_device *acpi_companion_match(const struct device *dev); int __acpi_device_uevent_modalias(struct acpi_device *adev, struct kobj_uevent_env *env); /* -------------------------------------------------------------------------- - Power Resource + Power Resource -------------------------------------------------------------------------- */ int acpi_power_init(void); void acpi_power_resources_list_free(struct list_head *list); @@ -134,19 +134,19 @@ int acpi_add_power_resource(acpi_handle handle); void acpi_power_add_remove_device(struct acpi_device *adev, bool add); int acpi_power_wakeup_list_init(struct list_head *list, int *system_level); int acpi_device_sleep_wake(struct acpi_device *dev, - int enable, int sleep_state, int dev_state); + int enable, int sleep_state, int dev_state); int acpi_power_get_inferred_state(struct acpi_device *device, int *state); int acpi_power_on_resources(struct acpi_device *device, int state); int acpi_power_transition(struct acpi_device *device, int state); /* -------------------------------------------------------------------------- - Device Power Management + Device Power Management -------------------------------------------------------------------------- */ int acpi_device_get_power(struct acpi_device *device, int *state); int acpi_wakeup_device_init(void); /* -------------------------------------------------------------------------- - Processor + Processor -------------------------------------------------------------------------- */ #ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC void acpi_early_processor_set_pdc(void); @@ -161,7 +161,7 @@ static inline void acpi_early_processor_osc(void) {} #endif /* -------------------------------------------------------------------------- - Embedded Controller + Embedded Controller -------------------------------------------------------------------------- */ struct acpi_ec { acpi_handle handle; @@ -207,7 +207,7 @@ bool acpi_ec_dispatch_gpe(void); /*-------------------------------------------------------------------------- - Suspend/Resume + Suspend/Resume -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT extern bool acpi_s2idle_wakeup(void); diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 3a3c209ed3d3..442608220b5c 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2175,10 +2175,10 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc) * these commands. */ enum nfit_aux_cmds { - NFIT_CMD_TRANSLATE_SPA = 5, - NFIT_CMD_ARS_INJECT_SET = 7, - NFIT_CMD_ARS_INJECT_CLEAR = 8, - NFIT_CMD_ARS_INJECT_GET = 9, + NFIT_CMD_TRANSLATE_SPA = 5, + NFIT_CMD_ARS_INJECT_SET = 7, + NFIT_CMD_ARS_INJECT_CLEAR = 8, + NFIT_CMD_ARS_INJECT_GET = 9, }; static void acpi_nfit_init_dsms(struct acpi_nfit_desc *acpi_desc) @@ -2632,7 +2632,7 @@ static int acpi_nfit_blk_region_enable(struct nvdimm_bus *nvdimm_bus, nfit_blk->bdw_offset = nfit_mem->bdw->offset; mmio = &nfit_blk->mmio[BDW]; mmio->addr.base = devm_nvdimm_memremap(dev, nfit_mem->spa_bdw->address, - nfit_mem->spa_bdw->length, nd_blk_memremap_flags(ndbr)); + nfit_mem->spa_bdw->length, nd_blk_memremap_flags(ndbr)); if (!mmio->addr.base) { dev_dbg(dev, "%s failed to map bdw\n", nvdimm_name(nvdimm)); diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index dea8a60e18a4..42db76905178 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -40,7 +40,7 @@ static inline char pin_name(int pin) } /* -------------------------------------------------------------------------- - PCI IRQ Routing Table (PRT) Support + PCI IRQ Routing Table (PRT) Support -------------------------------------------------------------------------- */ /* http://bugzilla.kernel.org/show_bug.cgi?id=4773 */ @@ -238,7 +238,7 @@ static int acpi_pci_irq_find_prt_entry(struct pci_dev *dev, } /* -------------------------------------------------------------------------- - PCI Interrupt Routing Support + PCI Interrupt Routing Support -------------------------------------------------------------------------- */ #ifdef CONFIG_X86_IO_APIC extern int noioapicquirk; diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 606da5d77ad3..8a79b72f1928 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -75,7 +75,7 @@ static DEFINE_MUTEX(acpi_link_lock); static int sci_irq = -1, sci_penalty; /* -------------------------------------------------------------------------- - PCI Link Device Management + PCI Link Device Management -------------------------------------------------------------------------- */ /* @@ -390,7 +390,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) } /* -------------------------------------------------------------------------- - PCI Link IRQ Management + PCI Link IRQ Management -------------------------------------------------------------------------- */ /* @@ -714,7 +714,7 @@ int acpi_pci_link_free_irq(acpi_handle handle) } /* -------------------------------------------------------------------------- - Driver Interface + Driver Interface -------------------------------------------------------------------------- */ static int acpi_pci_link_add(struct acpi_device *device, diff --git a/drivers/acpi/pci_mcfg.c b/drivers/acpi/pci_mcfg.c index 7ddd57abadd1..95f23acd5b80 100644 --- a/drivers/acpi/pci_mcfg.c +++ b/drivers/acpi/pci_mcfg.c @@ -173,7 +173,7 @@ static int pci_mcfg_quirk_matches(struct mcfg_fixup *f, u16 segment, { if (!memcmp(f->oem_id, mcfg_oem_id, ACPI_OEM_ID_SIZE) && !memcmp(f->oem_table_id, mcfg_oem_table_id, - ACPI_OEM_TABLE_ID_SIZE) && + ACPI_OEM_TABLE_ID_SIZE) && f->oem_revision == mcfg_oem_revision && f->segment == segment && resource_contains(&f->bus_range, bus_range)) diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 837b875d075e..0cb41bcda618 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -66,7 +66,7 @@ static LIST_HEAD(acpi_power_resource_list); static DEFINE_MUTEX(power_resource_list_lock); /* -------------------------------------------------------------------------- - Power Resource Management + Power Resource Management -------------------------------------------------------------------------- */ static inline @@ -624,7 +624,7 @@ int acpi_power_wakeup_list_init(struct list_head *list, int *system_level_p) } /* -------------------------------------------------------------------------- - Device Power Management + Device Power Management -------------------------------------------------------------------------- */ /** @@ -645,7 +645,7 @@ int acpi_power_wakeup_list_init(struct list_head *list, int *system_level_p) * -ENODEV if the execution of either _DSW or _PSW has failed */ int acpi_device_sleep_wake(struct acpi_device *dev, - int enable, int sleep_state, int dev_state) + int enable, int sleep_state, int dev_state) { union acpi_object in_arg[3]; struct acpi_object_list arg_list = { 3, in_arg }; diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 5909e8fa4013..3b9c74498cd7 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -354,7 +354,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr) (u32) px->control, (u32) px->status)); /* - * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq + * Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq */ if (!px->core_frequency || ((u32)(px->core_frequency * 1000) != diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index a0bd56ece3ff..68b9c22133fe 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -649,7 +649,7 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) } /* -------------------------------------------------------------------------- - Throttling Control + Throttling Control -------------------------------------------------------------------------- */ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr) { diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index f158b8c30113..437ff479c598 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c @@ -291,7 +291,7 @@ static const struct power_supply_desc acpi_sbs_charger_desc = { }; /* -------------------------------------------------------------------------- - Smart Battery System Management + Smart Battery System Management -------------------------------------------------------------------------- */ struct acpi_battery_reader { @@ -366,7 +366,7 @@ static int acpi_battery_get_state(struct acpi_battery *battery) state_readers[i].mode, ACPI_SBS_BATTERY, state_readers[i].command, - (u8 *)battery + + (u8 *)battery + state_readers[i].offset); if (result) goto end; @@ -469,7 +469,7 @@ static const struct device_attribute alarm_attr = { }; /* -------------------------------------------------------------------------- - Driver Interface + Driver Interface -------------------------------------------------------------------------- */ static int acpi_battery_read(struct acpi_battery *battery) { diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index 87b74e9015e5..53c2862c4c75 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c @@ -176,7 +176,7 @@ int acpi_smbus_write(struct acpi_smb_hc *hc, u8 protocol, u8 address, EXPORT_SYMBOL_GPL(acpi_smbus_write); int acpi_smbus_register_callback(struct acpi_smb_hc *hc, - smbus_alarm_callback callback, void *context) + smbus_alarm_callback callback, void *context) { mutex_lock(&hc->lock); hc->callback = callback; diff --git a/drivers/acpi/sbshc.h b/drivers/acpi/sbshc.h index c3522bb82792..06ea16914aed 100644 --- a/drivers/acpi/sbshc.h +++ b/drivers/acpi/sbshc.h @@ -28,5 +28,5 @@ extern int acpi_smbus_read(struct acpi_smb_hc *hc, u8 protocol, u8 address, extern int acpi_smbus_write(struct acpi_smb_hc *hc, u8 protocol, u8 slave_address, u8 command, u8 * data, u8 length); extern int acpi_smbus_register_callback(struct acpi_smb_hc *hc, - smbus_alarm_callback callback, void *context); + smbus_alarm_callback callback, void *context); extern int acpi_smbus_unregister_callback(struct acpi_smb_hc *hc); diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index a896e5e87c93..45060915334d 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -717,7 +717,7 @@ int acpi_device_add(struct acpi_device *device, } /* -------------------------------------------------------------------------- - Device Enumeration + Device Enumeration -------------------------------------------------------------------------- */ static struct acpi_device *acpi_bus_get_parent(acpi_handle handle) { diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 12c0ece746f0..693547004035 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -177,7 +177,7 @@ struct acpi_thermal { }; /* -------------------------------------------------------------------------- - Thermal Zone Management + Thermal Zone Management -------------------------------------------------------------------------- */ static int acpi_thermal_get_temperature(struct acpi_thermal *tz) @@ -897,7 +897,7 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) /* -------------------------------------------------------------------------- - Driver Interface + Driver Interface -------------------------------------------------------------------------- */ static void acpi_thermal_notify(struct acpi_device *device, u32 event) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index d5411a166685..d2f5d5048355 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -22,7 +22,7 @@ ACPI_MODULE_NAME("utils"); /* -------------------------------------------------------------------------- - Object Evaluation Helpers + Object Evaluation Helpers -------------------------------------------------------------------------- */ static void acpi_util_eval_error(acpi_handle h, acpi_string p, acpi_status s) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 3a032afd9d05..4f5463b2a217 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -178,14 +178,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), }, }, - { - .callback = video_detect_force_video, - .ident = "ThinkPad X201T", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201T"), - }, - }, + { + .callback = video_detect_force_video, + .ident = "ThinkPad X201T", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201T"), + }, + }, /* The native backlight controls do not work on some older machines */ { diff --git a/drivers/acpi/wakeup.c b/drivers/acpi/wakeup.c index f89dd9a99e6e..e8c59578598f 100644 --- a/drivers/acpi/wakeup.c +++ b/drivers/acpi/wakeup.c @@ -44,7 +44,7 @@ void acpi_enable_wakeup_devices(u8 sleep_state) if (!dev->wakeup.flags.valid || sleep_state > (u32) dev->wakeup.sleep_state || !(device_may_wakeup(&dev->dev) - || dev->wakeup.prepare_count)) + || dev->wakeup.prepare_count)) continue; if (device_may_wakeup(&dev->dev)) @@ -69,7 +69,7 @@ void acpi_disable_wakeup_devices(u8 sleep_state) if (!dev->wakeup.flags.valid || sleep_state > (u32) dev->wakeup.sleep_state || !(device_may_wakeup(&dev->dev) - || dev->wakeup.prepare_count)) + || dev->wakeup.prepare_count)) continue; acpi_set_gpe_wake_mask(dev->wakeup.gpe_device, dev->wakeup.gpe_number,
On 11/4/20 6:13 AM, Joe Perches wrote: [...] >> Yes. I scanned drivers/acpi for trailing whitespaces after I noticed a >> couple of them. I did not explicitly scan for other stuff like spaces >> where there should be tabs, mostly because I haven't found a quick and >> reliable solution for that. I only noticed an inconsistent indentation >> when committing, so I fixed that too. > > You could try: > > $ git ls-files -- 'drivers/acpi/*.[ch]' | \ > xargs ./scripts/checkpatch.pl -f --fix-inplace --types=CODE_INDENT Thanks, that indeed looks like a decent solution. > Right now that produces: > --- [...] > diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c > index 46a64e9fa716..46be80976a03 100644 > --- a/drivers/acpi/ac.c > +++ b/drivers/acpi/ac.c > @@ -89,7 +89,7 @@ struct acpi_ac { > #define to_acpi_ac(x) power_supply_get_drvdata(x) > > /* -------------------------------------------------------------------------- > - AC Adapter Management > + AC Adapter Management > -------------------------------------------------------------------------- */ I'm not too sure about the comments, but I can find the time to look over the output and adjust that if that's something you'd want me to do. Regards, Max
On Wed, 2020-11-04 at 16:48 +0100, Maximilian Luz wrote: > On 11/4/20 6:13 AM, Joe Perches wrote: > > [...] > > > > Yes. I scanned drivers/acpi for trailing whitespaces after I noticed a > > > couple of them. I did not explicitly scan for other stuff like spaces > > > where there should be tabs, mostly because I haven't found a quick and > > > reliable solution for that. I only noticed an inconsistent indentation > > > when committing, so I fixed that too. > > > > You could try: > > > > $ git ls-files -- 'drivers/acpi/*.[ch]' | \ > > xargs ./scripts/checkpatch.pl -f --fix-inplace --types=CODE_INDENT > > Thanks, that indeed looks like a decent solution. > > > Right now that produces: > > --- > > [...] > > > diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c [] > > @@ -89,7 +89,7 @@ struct acpi_ac { > > #define to_acpi_ac(x) power_supply_get_drvdata(x) > > > > > > /* -------------------------------------------------------------------------- > > - AC Adapter Management > > + AC Adapter Management > > -------------------------------------------------------------------------- */ > > I'm not too sure about the comments, but I can find the time to look > over the output and adjust that if that's something you'd want me to do. Up to you. I hardly looked at the output. I'd generally prefer to use a single line comment like /* AC Adapter Management */ but I don't know how often that dashed block is used in ACPI. grep seems to show the texts are not correctly centered so it seems like it was done by hand and not that some automation tool was used to create those blocks. Maybe a separate patch could be done to change those if desired. But not by me. As far as I know, acpi was once autogenerated from a common source tree and whitespace changes were once frowned on, but maybe that's changed or or perhaps that's only for files in drivers/acpi/acpica/. I don't know. https://acpica.org/downloads/linux cheers, Joe
On Wed, Nov 4, 2020 at 6:13 PM Joe Perches <joe@perches.com> wrote: > > On Wed, 2020-11-04 at 16:48 +0100, Maximilian Luz wrote: > > On 11/4/20 6:13 AM, Joe Perches wrote: > > > > [...] > > > > > > Yes. I scanned drivers/acpi for trailing whitespaces after I noticed a > > > > couple of them. I did not explicitly scan for other stuff like spaces > > > > where there should be tabs, mostly because I haven't found a quick and > > > > reliable solution for that. I only noticed an inconsistent indentation > > > > when committing, so I fixed that too. > > > > > > You could try: > > > > > > $ git ls-files -- 'drivers/acpi/*.[ch]' | \ > > > xargs ./scripts/checkpatch.pl -f --fix-inplace --types=CODE_INDENT > > > > Thanks, that indeed looks like a decent solution. > > > > > Right now that produces: > > > --- > > > > [...] > > > > > diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c > [] > > > @@ -89,7 +89,7 @@ struct acpi_ac { > > > #define to_acpi_ac(x) power_supply_get_drvdata(x) > > > > > > > > > /* -------------------------------------------------------------------------- > > > - AC Adapter Management > > > + AC Adapter Management > > > -------------------------------------------------------------------------- */ > > > > I'm not too sure about the comments, but I can find the time to look > > over the output and adjust that if that's something you'd want me to do. > > Up to you. I hardly looked at the output. > > I'd generally prefer to use a single line comment like > > /* AC Adapter Management */ > > but I don't know how often that dashed block is used in ACPI. > > grep seems to show the texts are not correctly centered so it seems like > it was done by hand and not that some automation tool was used to create > those blocks. > > Maybe a separate patch could be done to change those if desired. If anyone has a problem with them. > But not by me. > > As far as I know, acpi was once autogenerated from a common source tree > and whitespace changes were once frowned on, but maybe that's changed or > or perhaps that's only for files in drivers/acpi/acpica/. The latter.
On 11/4/20 6:12 PM, Joe Perches wrote: [...] >> I'm not too sure about the comments, but I can find the time to look >> over the output and adjust that if that's something you'd want me to do. > > Up to you. I hardly looked at the output. > > I'd generally prefer to use a single line comment like > > /* AC Adapter Management */ > > but I don't know how often that dashed block is used in ACPI. > > grep seems to show the texts are not correctly centered so it seems like > it was done by hand and not that some automation tool was used to create > those blocks. > > Maybe a separate patch could be done to change those if desired. > But not by me. I'm hesitant to touch those, mostly as you said because they're subjective (and I don't really see any big issues with them). Seems to be the prevalent style in the drivers/acpi, although there are other block-like separator comments at least in drivers/acpi/dock.c. > As far as I know, acpi was once autogenerated from a common source tree > and whitespace changes were once frowned on, but maybe that's changed or > or perhaps that's only for files in drivers/acpi/acpica/. I don't know. > > https://acpica.org/downloads/linux Yeah, any changes to drivers/acpi/acpica would have to go through their repo. I'll go over the checkpatch output later and prepare a v2 that doesn't touch the comments, unless anyone has any issues with that. Regards, Max
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index dea8a60e18a4..14ee631cb7cf 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -175,7 +175,7 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev, * configure the IRQ assigned to this slot|dev|pin. The 'source_index' * indicates which resource descriptor in the resource template (of * the link device) this interrupt is allocated from. - * + * * NOTE: Don't query the Link Device for IRQ information at this time * because Link Device enumeration may not have occurred yet * (e.g. exists somewhere 'below' this _PRT entry in the ACPI diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 606da5d77ad3..fb4c5632a232 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -6,8 +6,8 @@ * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> * Copyright (C) 2002 Dominik Brodowski <devel@brodo.de> * - * TBD: - * 1. Support more than one IRQ resource entry per link device (index). + * TBD: + * 1. Support more than one IRQ resource entry per link device (index). * 2. Implement start/stop mechanism and use ACPI Bus Driver facilities * for IRQ management (e.g. start()->_SRS). */ @@ -249,8 +249,8 @@ static int acpi_pci_link_get_current(struct acpi_pci_link *link) } } - /* - * Query and parse _CRS to get the current IRQ assignment. + /* + * Query and parse _CRS to get the current IRQ assignment. */ status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS, @@ -396,7 +396,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) /* * "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt * Link Devices to move the PIRQs around to minimize sharing. - * + * * "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs * that the BIOS has already set to active. This is necessary because * ACPI has no automatic means of knowing what ISA IRQs are used. Note that @@ -414,7 +414,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) * * Note that PCI IRQ routers have a list of possible IRQs, * which may not include the IRQs this table says are available. - * + * * Since this heuristic can't tell the difference between a link * that no device will attach to, vs. a link which may be shared * by multiple active devices -- it is not optimal. diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 837b875d075e..9c4c3196cb07 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -13,7 +13,7 @@ * 1. via "Device Specific (D-State) Control" * 2. via "Power Resource Control". * The code below deals with ACPI Power Resources control. - * + * * An ACPI "power resource object" represents a software controllable power * plane, clock plane, or other resource depended on by a device. * @@ -690,7 +690,7 @@ int acpi_device_sleep_wake(struct acpi_device *dev, /* * Prepare a wakeup device, two steps (Ref ACPI 2.0:P229): - * 1. Power on the power resources required for the wakeup device + * 1. Power on the power resources required for the wakeup device * 2. Execute _DSW (Device Sleep Wake) or (deprecated in ACPI 3.0) _PSW (Power * State Wake) for the device, if present */ diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 5909e8fa4013..f00e66de6c53 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -627,7 +627,7 @@ int acpi_processor_preregister_performance( goto err_ret; /* - * Now that we have _PSD data from all CPUs, lets setup P-state + * Now that we have _PSD data from all CPUs, lets setup P-state * domain info. */ for_each_possible_cpu(i) { @@ -693,7 +693,7 @@ int acpi_processor_preregister_performance( if (match_pdomain->domain != pdomain->domain) continue; - match_pr->performance->shared_type = + match_pr->performance->shared_type = pr->performance->shared_type; cpumask_copy(match_pr->performance->shared_cpu_map, pr->performance->shared_cpu_map);
Remove trailing whitespace and fix some whitespace inconsitencies while at it. Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com> --- drivers/acpi/pci_irq.c | 2 +- drivers/acpi/pci_link.c | 12 ++++++------ drivers/acpi/power.c | 4 ++-- drivers/acpi/processor_perflib.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-)