Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1938776pxf; Fri, 26 Mar 2021 20:54:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmHjuOZ/U6b788Px4Go8sPj+IrTaccnpM8z9jgf/7WwThdnwVhl6k2TE0lQrdut6NCt4vq X-Received: by 2002:aa7:c7c5:: with SMTP id o5mr18119687eds.31.1616817268814; Fri, 26 Mar 2021 20:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616817268; cv=none; d=google.com; s=arc-20160816; b=o+//U14Ay2AoW5vyMFthLiYLtKAjJ38nBHqy/GFfI4I6i1r8F60hf+OQU8+btEl09X su9U0tYY6qIbeRUXeVxMgfxl+laDO9gRry8tI1kdH8xi+XNT++yp+t5hZlk416O/c+Es TpVg3FFGRWHXjoe5uwW7aDUJyR6amLYPzM1ABTwv8LLQzbFhtIA6HMZ1h7PDAciOdXCA NWWRr2G3I9j8spcaISK9wBA0kmQ3pGhVfLPitCDpS66yNUibp5AoNGuHoykwrjx0VO6n MPEeX8iMlyqvhRylMeSkkOGO1Hz1Sf53Ri+dQKNpuonvRtNuXC7DQMFlen6Qcp1FJYNO 4Beg== 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=4q1qfv1LYu8jomX5Q+XLpZ/WjhWfDq+3stIeiXk33HU=; b=WNgVmDXtcm3DGfAd34VB/0tIPWRhle67bXjHDQefMqVdmsiFMvVhHZJiI+f9yDkNDI BHJYmJy6ClOGRCC4jIsmDw1vDF8Y42RK0ryIhopIZyQBe0VIjCMp4gY9kBYchd2JGjSK HyBcoouPbBba9w1vu2a5w+2oHNj5dGjFWIkbqh7fd5a6u2wbbA/7j7WnsjUFqpCHWXEI eMYYOP6iGS72OHLvFpKTbuksYwBdVfwI86B1HbU7KJLwIPjyZ/SFAHPHxgHGJW9j/irA J9JXQghtybdBY0OiZ1nA3IDWQIBPo90M0/VMeaqMhfezSbgtUGMirflcpss6OLB+Zs3F /sMQ== 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 w19si1720370eds.331.2021.03.26.20.54.04; Fri, 26 Mar 2021 20:54:28 -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 S231149AbhC0DuP (ORCPT + 99 others); Fri, 26 Mar 2021 23:50:15 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14496 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230152AbhC0Dti (ORCPT ); Fri, 26 Mar 2021 23:49:38 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4F6lCp6xgpzySrp; Sat, 27 Mar 2021 11:47:34 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Sat, 27 Mar 2021 11:49:29 +0800 From: Xiaofei Tan To: , CC: , , , Xiaofei Tan Subject: [PATCH v2] ACPI: AC: fix some coding style issues Date: Sat, 27 Mar 2021 11:47:01 +0800 Message-ID: <1616816821-39369-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 coding style issues reported by checkpatch.pl, including following 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 WARNING: CVS style keyword markers, these will _not_ be updated Signed-off-by: Xiaofei Tan --- drivers/acpi/ac.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index b86ee6e..b0cb662 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -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 * Copyright (C) 2001, 2002 Paul Diefenbaugh @@ -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; @@ -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) @@ -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); @@ -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, @@ -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; } @@ -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; @@ -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; } -- 2.8.1