Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4223623pxf; Tue, 23 Mar 2021 06:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxff4o/zD0jz5LMN/N641hrVRwUm4Wnuf8iWdFb4nAweiAZREglXkQkqS9zqg6R9IgKGWM X-Received: by 2002:a17:906:4b0e:: with SMTP id y14mr4675431eju.393.1616504560704; Tue, 23 Mar 2021 06:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616504560; cv=none; d=google.com; s=arc-20160816; b=0k9GCRCZX6IpWX3wDu/mUmxHcRyiRdME/QD4NeHLGylMjWTvomtDhfCzU0mAtD2eAV UPt+W6gA/uM3dz8klL3G9YFGo0oFKI7f8hGkHaRP8Dk5a0bHzz+oUBZr8Sd8vK+s3nkz FXFgMby6lDWAdX8++NOypi8KAUqeSoAF9o1UP/F22hIBYgtSSpHl9XrIu1GB8SMdzYAx H/L+n8FsHcN3BCoDk+Pw/4A88/v4BLUoBsBU6ZSh/WZanpZE8UF7BrKCA37tuYAc2THT sQy6b/+q9gCH+/uVhtSt9WvNelf3ANvrQFhYgk0nOIJUzBwX63PiQGQIl/wLWKr6JQWG YbTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=NWqoGODFGG/bFoPySriFkiHMxpjW4JTBPcRECCQ6ynU=; b=iialxniXMmch4FyHE8cChGa+5jtrjE3NF839DlNIz2sw9W6MPkbClYhERKKzLk62ED t6p1pipIdq+JZxg8+QgLTFzhFYfEFv0ziFYomHKM2p4AAD3uT2ztypJURyzNvz6Q7pef zc4P1Cu+YupD6wbtlpq/r1lWeKZ8cjGlrqQ1aLWXiPgFiZBET0pZZ8WqlRFBxjmjZqqI XqFzxmjYTrD3Mjsw7/wEGJDkUWaOpllKBTyYDJU6WEfhamUNo63K3N0Vc3P7gijlF97M uXAsDtohsm87myKFYZM/Bb81RiSeyLS7uAHm9NOjVcecglwey8CaeabTkUOQbWzN8bfB crDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si13595672edd.128.2021.03.23.06.02.13; Tue, 23 Mar 2021 06:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbhCWNA3 (ORCPT + 99 others); Tue, 23 Mar 2021 09:00:29 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:14850 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231296AbhCWNAE (ORCPT ); Tue, 23 Mar 2021 09:00:04 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4F4Wcn4fwYz92NZ; Tue, 23 Mar 2021 20:58:01 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Tue, 23 Mar 2021 20:59:52 +0800 From: Xiaofei Tan To: , CC: , , , Xiaofei Tan Subject: [PATCH] ACPI: AC: fix some errors and warnings reported by checkpatch.pl Date: Tue, 23 Mar 2021 20:57:27 +0800 Message-ID: <1616504247-48744-1-git-send-email-tanxiaofei@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix some errors and warnings reported by checkpatch.pl, including following five types: ERROR: "foo * bar" should be "foo *bar" ERROR: code indent should use tabs where possible WARNING: Block comments use a trailing */ on a separate line WARNING: braces {} are not necessary for single statement blocks WARNING: void function return statements are not generally useful Signed-off-by: Xiaofei Tan --- drivers/acpi/ac.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index b86ee6e..07987854 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -78,17 +78,16 @@ 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; @@ -109,9 +108,9 @@ 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) @@ -138,10 +137,9 @@ 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); @@ -174,8 +172,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, @@ -282,9 +278,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; } @@ -293,7 +288,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; @@ -352,9 +347,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; } -- 2.8.1