From patchwork Wed May 4 10:30:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12837627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66D10C433FE for ; Wed, 4 May 2022 10:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348114AbiEDKeU (ORCPT ); Wed, 4 May 2022 06:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348106AbiEDKeS (ORCPT ); Wed, 4 May 2022 06:34:18 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973341402B for ; Wed, 4 May 2022 03:30:40 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id k126-20020a1ca184000000b003943fd07180so554712wme.3 for ; Wed, 04 May 2022 03:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vVvWe9CoZBTdNyE3eHbun0xPih5mbPe7IlFMtVIhZ0k=; b=G/k6F7kYqnZzccb/RHvYUNQ+cmItTgNY2NoAzmvysDGNT9sYZQ+gnOOEp9NrTXesP/ nllwOMFbfQzmDY79kENJAS3Cr9of3xravd1Cs8QaC52GH4DTYELD1BuPp6aH1ejniSMl Yow1xWQpSz9DCQCsNcZ0RDnRkY2dmPELeMhJqERNvHAk3ikwaLajXlK74wdgNvBVVCAQ sYuB6Omwr3P9ADIRWwesA2VNLz2rPDHMkaQnzdSaeu16Lg72w72CMKjpCqGWD1Yk6dM8 sq26YYAW10WDCeouuFJPPsH5FIX930Xq5sDhKa3tiLBIsc2jJiR7vQ5myGG3u/LDmzCn CFgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vVvWe9CoZBTdNyE3eHbun0xPih5mbPe7IlFMtVIhZ0k=; b=pz+rHWmuDjGbI7h2M3xq1wgQ0/AzOcISGPv1AdZ7FiBwai7RN3/BsQt4EC1JwiOFPe i3F8Xj49QVue7t99hgXHCkv9I+dRtmjXQZG0GC0+DpMZzInrO/2ff6QwEIFNnyBiNMme v9kPZK+QQOzTYaAlhrUZl3WOPvRgj8JyMh0YAbRoo0YY4MfQRT7STai4R7DDApKyMRQx c4RUoqeimEWYxRXNdmdnqeZGOA8kbOHhy4fD2jOryWi+9jdbaasLJBFilof2AS7OsOYK n73O9VCzAh9tswE3wryNzYyaNFdHawa9eCiYGMKMsbv8MZIPkG7yANYLJ3BLsEmCkiq/ bknQ== X-Gm-Message-State: AOAM533E8BQfdYDyJigYarngyy5YnD+Y5nld7OxGTDDCtMqjSROjjWSY K9CqLd3aclFZEUXE51rQDGD4DpxBHvzA3Q== X-Google-Smtp-Source: ABdhPJynx1ZvRXZ75QK4hcCQuYNk4l01zutV1yAb+3OC1A919J6T4sHa6uQUS5Htut6lA6azQH8elg== X-Received: by 2002:a7b:cc17:0:b0:38d:af7:3848 with SMTP id f23-20020a7bcc17000000b0038d0af73848mr7164990wmh.41.1651660239194; Wed, 04 May 2022 03:30:39 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id k6-20020a05600c1c8600b0039429bfebebsm7521395wms.3.2022.05.04.03.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 03:30:38 -0700 (PDT) From: Corentin Labbe To: jdelvare@suse.com, linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH v2 1/2] hwmon: acpi_power_meter: fix style issue Date: Wed, 4 May 2022 10:30:27 +0000 Message-Id: <20220504103028.493155-2-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220504103028.493155-1-clabbe@baylibre.com> References: <20220504103028.493155-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Fix style issues found by checkpatch. Signed-off-by: Corentin Labbe --- drivers/hwmon/acpi_power_meter.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index c405a5869581..d2545a1be9fc 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -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), {}, }; @@ -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; @@ -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; @@ -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) @@ -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; @@ -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; @@ -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; @@ -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)