Skip to content

Commit

Permalink
hwmon: acpi_power_meter: fix style issue
Browse files Browse the repository at this point in the history
Fix style issues found by checkpatch.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
  • Loading branch information
montjoie authored and intel-lab-lkp committed May 4, 2022
1 parent e21a58f commit 80ebab2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/hwmon/acpi_power_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ static struct sensor_template meter_attrs[] = {
RO_SENSOR_TEMPLATE("power1_average_interval_max", show_val, 1),
RO_SENSOR_TEMPLATE("power1_is_battery", show_val, 5),
RW_SENSOR_TEMPLATE(POWER_AVG_INTERVAL_NAME, show_avg_interval,
set_avg_interval, 0),
set_avg_interval, 0),
{},
};

Expand Down Expand Up @@ -530,6 +530,7 @@ static void remove_domain_devices(struct acpi_power_meter_resource *resource)

for (i = 0; i < resource->num_domain_devices; i++) {
struct acpi_device *obj = resource->domain_devices[i];

if (!obj)
continue;

Expand Down Expand Up @@ -580,7 +581,7 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource)
}

resource->holders_dir = kobject_create_and_add("measures",
&resource->acpi_dev->dev.kobj);
&resource->acpi_dev->dev.kobj);
if (!resource->holders_dir) {
res = -ENOMEM;
goto exit_free;
Expand All @@ -590,7 +591,7 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource)

for (i = 0; i < pss->package.count; i++) {
struct acpi_device *obj;
union acpi_object *element = &(pss->package.elements[i]);
union acpi_object *element = &pss->package.elements[i];

/* Refuse non-references */
if (element->type != ACPI_TYPE_LOCAL_REFERENCE)
Expand All @@ -603,7 +604,7 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource)
continue;

res = sysfs_create_link(resource->holders_dir, &obj->dev.kobj,
kobject_name(&obj->dev.kobj));
kobject_name(&obj->dev.kobj));
if (res) {
acpi_dev_put(obj);
resource->domain_devices[i] = NULL;
Expand Down Expand Up @@ -788,7 +789,7 @@ static int read_capabilities(struct acpi_power_meter_resource *resource)
str = &resource->model_number;

for (i = 11; i < 14; i++) {
union acpi_object *element = &(pss->package.elements[i]);
union acpi_object *element = &pss->package.elements[i];

if (element->type != ACPI_TYPE_STRING) {
res = -EINVAL;
Expand Down Expand Up @@ -868,8 +869,7 @@ static int acpi_power_meter_add(struct acpi_device *device)
if (!device)
return -EINVAL;

resource = kzalloc(sizeof(struct acpi_power_meter_resource),
GFP_KERNEL);
resource = kzalloc(sizeof(*resource), GFP_KERNEL);
if (!resource)
return -ENOMEM;

Expand All @@ -884,7 +884,8 @@ static int acpi_power_meter_add(struct acpi_device *device)
if (res)
goto exit_free;

resource->trip[0] = resource->trip[1] = -1;
resource->trip[0] = -1;
resource->trip[1] = -1;

res = setup_attrs(resource);
if (res)
Expand Down

0 comments on commit 80ebab2

Please sign in to comment.