Skip to content

Commit

Permalink
Merge branch 'acpi-misc'
Browse files Browse the repository at this point in the history
* acpi-misc:
  ACPI: dock: fix some coding style issues
  ACPI: sysfs: fix some coding style issues
  ACPI: PM: add a missed blank line after declarations
  ACPI: custom_method: fix a coding style issue
  ACPI: CPPC: fix some coding style issues
  ACPI: button: fix some coding style issues
  ACPI: battery: fix some coding style issues
  ACPI: acpi_pad: add a missed blank line after declarations
  ACPI: LPSS: add a missed blank line after declarations
  ACPI: ipmi: remove useless return statement for void function
  ACPI: processor: fix some coding style issues
  ACPI: APD: fix a block comment align issue
  ACPI: AC: fix some coding style issues
  ACPI: fix various typos in comments
  • Loading branch information
Rafael J. Wysocki committed Apr 26, 2021
2 parents aad659e + 6ee4bdc commit b6237f6
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 133 deletions.
30 changes: 9 additions & 21 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $)
* acpi_ac.c - ACPI AC Adapter Driver (Revision: 27)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
Expand Down Expand Up @@ -78,17 +78,14 @@ static struct acpi_driver acpi_ac_driver = {
struct acpi_ac {
struct power_supply *charger;
struct power_supply_desc charger_desc;
struct acpi_device * device;
struct acpi_device *device;
unsigned long long state;
struct notifier_block battery_nb;
};

#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)
{
acpi_status status = AE_OK;
Expand All @@ -109,9 +106,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
return 0;
}

/* --------------------------------------------------------------------------
sysfs I/F
-------------------------------------------------------------------------- */
/* sysfs I/F */
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
Expand All @@ -138,10 +133,7 @@ static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};

/* --------------------------------------------------------------------------
Driver Model
-------------------------------------------------------------------------- */

/* Driver Model */
static void acpi_ac_notify(struct acpi_device *device, u32 event)
{
struct acpi_ac *ac = acpi_driver_data(device);
Expand Down Expand Up @@ -174,8 +166,6 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
acpi_notifier_call_chain(device, event, (u32) ac->state);
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
}

return;
}

static int acpi_ac_battery_notify(struct notifier_block *nb,
Expand All @@ -187,7 +177,7 @@ static int acpi_ac_battery_notify(struct notifier_block *nb,
/*
* On HP Pavilion dv6-6179er AC status notifications aren't triggered
* when adapter is plugged/unplugged. However, battery status
* notifcations are triggered when battery starts charging or
* notifications are triggered when battery starts charging or
* discharging. Re-reading AC status triggers lost AC notifications,
* if AC status has changed.
*/
Expand Down Expand Up @@ -282,9 +272,8 @@ static int acpi_ac_add(struct acpi_device *device)
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
register_acpi_notifier(&ac->battery_nb);
end:
if (result) {
if (result)
kfree(ac);
}

return result;
}
Expand All @@ -293,7 +282,7 @@ static int acpi_ac_add(struct acpi_device *device)
static int acpi_ac_resume(struct device *dev)
{
struct acpi_ac *ac;
unsigned old_state;
unsigned int old_state;

if (!dev)
return -EINVAL;
Expand Down Expand Up @@ -352,9 +341,8 @@ static int __init acpi_ac_init(void)
}

result = acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) {
if (result < 0)
return -ENODEV;
}

return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/acpi_apd.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ static const struct apd_device_desc hip08_spi_desc = {

#endif

/**
* Create platform device during acpi scan attach handle.
* Return value > 0 on success of creating device.
*/
/*
* Create platform device during acpi scan attach handle.
* Return value > 0 on success of creating device.
*/
static int acpi_apd_create_device(struct acpi_device *adev,
const struct acpi_device_id *id)
{
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpi_ipmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ static void ipmi_register_bmc(int iface, struct device *dev)
ipmi_dev_release(ipmi_device);
err_ref:
put_device(smi_data.dev);
return;
}

static void ipmi_bmc_gone(int iface)
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
static int is_memory(struct acpi_resource *res, void *not_used)
{
struct resource r;

return !acpi_dev_resource_memory(res, &r);
}

Expand Down Expand Up @@ -1200,6 +1201,7 @@ static int acpi_lpss_poweroff_noirq(struct device *dev)
if (pdata->dev_desc->resume_from_noirq) {
/* This is analogous to the acpi_lpss_suspend_noirq() case. */
int ret = acpi_lpss_do_poweroff_late(dev);

if (ret)
return ret;
}
Expand Down
4 changes: 4 additions & 0 deletions drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ static void round_robin_cpu(unsigned int tsk_index)
static void exit_round_robin(unsigned int tsk_index)
{
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);

cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
tsk_in_cpu[tsk_index] = -1;
}
Expand Down Expand Up @@ -265,6 +266,7 @@ static ssize_t rrtime_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned long num;

if (kstrtoul(buf, 0, &num))
return -EINVAL;
if (num < 1 || num >= 100)
Expand All @@ -286,6 +288,7 @@ static ssize_t idlepct_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned long num;

if (kstrtoul(buf, 0, &num))
return -EINVAL;
if (num < 1 || num >= 100)
Expand All @@ -307,6 +310,7 @@ static ssize_t idlecpus_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned long num;

if (kstrtoul(buf, 0, &num))
return -EINVAL;
mutex_lock(&isolated_cpus_lock);
Expand Down
18 changes: 5 additions & 13 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
DEFINE_PER_CPU(struct acpi_processor *, processors);
EXPORT_PER_CPU_SYMBOL(processors);

/* --------------------------------------------------------------------------
Errata Handling
-------------------------------------------------------------------------- */

/* Errata Handling */
struct acpi_processor_errata errata __read_mostly;
EXPORT_SYMBOL_GPL(errata);

Expand Down Expand Up @@ -151,10 +148,7 @@ static int acpi_processor_errata(void)
return result;
}

/* --------------------------------------------------------------------------
Initialization
-------------------------------------------------------------------------- */

/* Initialization */
#ifdef CONFIG_ACPI_HOTPLUG_CPU
int __weak acpi_map_cpu(acpi_handle handle,
phys_cpuid_t physid, u32 acpi_id, int *pcpu)
Expand Down Expand Up @@ -306,6 +300,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
*/
if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) {
int ret = acpi_processor_hotadd_init(pr);

if (ret)
return ret;
}
Expand Down Expand Up @@ -431,10 +426,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)
{
struct acpi_processor *pr;
Expand Down Expand Up @@ -892,7 +884,7 @@ int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu,

info->count = last_index;

end:
end:
kfree(buffer.pointer);

return ret;
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpi_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ acpi_video_get_next_level(struct acpi_video_device *device,
break;
}
}
/* Ajust level_current to closest available level */
/* Adjust level_current to closest available level */
level_current += delta;
for (i = ACPI_VIDEO_FIRST_LEVEL; i < device->brightness->count; i++) {
l = device->brightness->levels[i];
Expand Down Expand Up @@ -1555,7 +1555,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,

/*
* Win8 requires setting bit2 of _DOS to let firmware know it shouldn't
* preform any automatic brightness change on receiving a notification.
* perform any automatic brightness change on receiving a notification.
*/
static int acpi_video_bus_start_devices(struct acpi_video_bus *video)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ EXPORT_SYMBOL_GPL(erst_disable);

static struct acpi_table_erst *erst_tab;

/* ERST Error Log Address Range atrributes */
/* ERST Error Log Address Range attributes */
#define ERST_RANGE_RESERVED 0x0001
#define ERST_RANGE_NVRAM 0x0002
#define ERST_RANGE_SLOW 0x0004
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/hest.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* APEI Hardware Error Souce Table support
* APEI Hardware Error Source Table support
*
* HEST describes error sources in detail; communicates operational
* parameters (i.e. severity levels, masking bits, and threshold
Expand Down
Loading

0 comments on commit b6237f6

Please sign in to comment.