From patchwork Wed Feb 25 00:36:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 45001 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B91412029F for ; Wed, 25 Feb 2015 00:36:51 +0000 (UTC) Received: by labge10 with SMTP id ge10sf340627lab.3 for ; Tue, 24 Feb 2015 16:36:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=V8mC3G2TxrDQ6o//+r9GjS2Le+715Y6VR1r6ul6cImQ=; b=Gg1u38LR4YhZjtwIfNspu2MV7uolTLyoUkD/uQW9GmMkpFJadY5kV9taJOR/IYq7L9 JbIaPfkpFHjiSfeouz0FXi0v1H0VO1qlGZWG+CpVutWDTmO4ZuNCX4TnUmIGAresLBX2 IVElwpnvREo6uRTjllcyEvaFPwokvGelQjb0WpoufEdUax/aKbr3CBPgLv7Ja33pjLOY PRb9Oui2s+MQbmnPZ1N1L4WLYEyXAAIxkOD2syvo0o6podlPDyBokRcpB7k+lldpo/Jm DjmYWZWkuT9wXS6q7qsQElQ5w4yVGvR27Oyyh3smXi14M1DEUzh6an1AKRc5Ngb5zNKl grVA== X-Gm-Message-State: ALoCoQnIojd8GNU0zwb5PZ/TcM9UeXoH9zK4QCWCsirWPNf6KZ49MBRFsHEo/bsZHslqBb62YBQr X-Received: by 10.112.25.7 with SMTP id y7mr67067lbf.21.1424824610558; Tue, 24 Feb 2015 16:36:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.231 with SMTP id bb7ls749054lab.50.gmail; Tue, 24 Feb 2015 16:36:50 -0800 (PST) X-Received: by 10.152.170.199 with SMTP id ao7mr417307lac.27.1424824610276; Tue, 24 Feb 2015 16:36:50 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id u3si1556301laj.107.2015.02.24.16.36.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 16:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbjb6 with SMTP id b6so557241lbj.2 for ; Tue, 24 Feb 2015 16:36:50 -0800 (PST) X-Received: by 10.152.28.5 with SMTP id x5mr446441lag.112.1424824610139; Tue, 24 Feb 2015 16:36:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2269097lbj; Tue, 24 Feb 2015 16:36:49 -0800 (PST) X-Received: by 10.107.14.141 with SMTP id 135mr1201255ioo.15.1424824606264; Tue, 24 Feb 2015 16:36:46 -0800 (PST) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com. [209.85.223.175]) by mx.google.com with ESMTPS id fy6si12290400icb.64.2015.02.24.16.36.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 16:36:46 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.223.175 as permitted sender) client-ip=209.85.223.175; Received: by iecat20 with SMTP id at20so701457iec.12 for ; Tue, 24 Feb 2015 16:36:45 -0800 (PST) X-Received: by 10.107.18.22 with SMTP id a22mr1314153ioj.48.1424824605563; Tue, 24 Feb 2015 16:36:45 -0800 (PST) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by mx.google.com with ESMTPSA id d6sm21312437iod.11.2015.02.24.16.36.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 16:36:44 -0800 (PST) From: al.stone@linaro.org To: rjw@rjwysocki.net, lenb@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, robert.moore@intel.com, tony.luck@intel.com, fenghua.yu@intel.com Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, linux-arm-kernel@lists.infradead.org, linaro-acpi@lists.linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.org Subject: [PATCH v3 3/9] ACPI: clean up checkpatch warnings for various bits of syntax Date: Tue, 24 Feb 2015 17:36:19 -0700 Message-Id: <1424824585-6405-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424824585-6405-1-git-send-email-al.stone@linaro.org> References: <1424824585-6405-1-git-send-email-al.stone@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Al Stone In preparation for later splitting out some of the arch-dependent code from osl.c, clean up a bunch of warnings for odd bits of syntax: -- remove CVS keyword markers -- remove a space from between a function name and an opening parenthesis -- clean up all but one line > 80 characters (one just looks silly if you make it less than 80) -- add blank lines after declarations in functions -- remove extraneous braces ({}) Signed-off-by: Al Stone --- drivers/acpi/osl.c | 75 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 865317c..46317ff 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -1,5 +1,5 @@ /* - * acpi_osl.c - OS-dependent functions ($Revision: 83 $) + * acpi_osl.c - OS-dependent functions * * Copyright (C) 2000 Andrew Henroid * Copyright (C) 2001, 2002 Andy Grover @@ -161,7 +161,7 @@ static u32 acpi_osi_handler(acpi_string interface, u32 supported) return supported; } -static void __init acpi_request_region (struct acpi_generic_address *gas, +static void __init acpi_request_region(struct acpi_generic_address *gas, unsigned int length, char *desc) { u64 addr; @@ -180,33 +180,41 @@ static void __init acpi_request_region (struct acpi_generic_address *gas, static int __init acpi_reserve_resources(void) { - acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, acpi_gbl_FADT.pm1_event_length, - "ACPI PM1a_EVT_BLK"); + acpi_request_region(&acpi_gbl_FADT.xpm1a_event_block, + acpi_gbl_FADT.pm1_event_length, + "ACPI PM1a_EVT_BLK"); - acpi_request_region(&acpi_gbl_FADT.xpm1b_event_block, acpi_gbl_FADT.pm1_event_length, - "ACPI PM1b_EVT_BLK"); + acpi_request_region(&acpi_gbl_FADT.xpm1b_event_block, + acpi_gbl_FADT.pm1_event_length, + "ACPI PM1b_EVT_BLK"); - acpi_request_region(&acpi_gbl_FADT.xpm1a_control_block, acpi_gbl_FADT.pm1_control_length, - "ACPI PM1a_CNT_BLK"); + acpi_request_region(&acpi_gbl_FADT.xpm1a_control_block, + acpi_gbl_FADT.pm1_control_length, + "ACPI PM1a_CNT_BLK"); - acpi_request_region(&acpi_gbl_FADT.xpm1b_control_block, acpi_gbl_FADT.pm1_control_length, - "ACPI PM1b_CNT_BLK"); + acpi_request_region(&acpi_gbl_FADT.xpm1b_control_block, + acpi_gbl_FADT.pm1_control_length, + "ACPI PM1b_CNT_BLK"); if (acpi_gbl_FADT.pm_timer_length == 4) - acpi_request_region(&acpi_gbl_FADT.xpm_timer_block, 4, "ACPI PM_TMR"); + acpi_request_region(&acpi_gbl_FADT.xpm_timer_block, 4, + "ACPI PM_TMR"); - acpi_request_region(&acpi_gbl_FADT.xpm2_control_block, acpi_gbl_FADT.pm2_control_length, - "ACPI PM2_CNT_BLK"); + acpi_request_region(&acpi_gbl_FADT.xpm2_control_block, + acpi_gbl_FADT.pm2_control_length, + "ACPI PM2_CNT_BLK"); /* Length of GPE blocks must be a non-negative multiple of 2 */ if (!(acpi_gbl_FADT.gpe0_block_length & 0x1)) acpi_request_region(&acpi_gbl_FADT.xgpe0_block, - acpi_gbl_FADT.gpe0_block_length, "ACPI GPE0_BLK"); + acpi_gbl_FADT.gpe0_block_length, + "ACPI GPE0_BLK"); if (!(acpi_gbl_FADT.gpe1_block_length & 0x1)) acpi_request_region(&acpi_gbl_FADT.xgpe1_block, - acpi_gbl_FADT.gpe1_block_length, "ACPI GPE1_BLK"); + acpi_gbl_FADT.gpe1_block_length, + "ACPI GPE1_BLK"); return 0; } @@ -215,6 +223,7 @@ device_initcall(acpi_reserve_resources); void acpi_os_printf(const char *fmt, ...) { va_list args; + va_start(args, fmt); acpi_os_vprintf(fmt, args); va_end(args); @@ -227,11 +236,10 @@ void acpi_os_vprintf(const char *fmt, va_list args) vsprintf(buffer, fmt, args); #ifdef ENABLE_DEBUGGER - if (acpi_in_debugger) { + if (acpi_in_debugger) kdb_printf("%s", buffer); - } else { + else pr_cont("%s", buffer); - } #else pr_cont("%s", buffer); #endif @@ -879,6 +887,7 @@ void acpi_os_stall(u32 us) u64 acpi_os_get_timer(void) { u64 time_ns = ktime_to_ns(ktime_get()); + do_div(time_ns, 100); return time_ns; } @@ -891,15 +900,14 @@ acpi_status acpi_os_read_port(acpi_io_address port, u32 *value, u32 width) value = &dummy; *value = 0; - if (width <= 8) { + if (width <= 8) *(u8 *) value = inb(port); - } else if (width <= 16) { + else if (width <= 16) *(u16 *) value = inw(port); - } else if (width <= 32) { + else if (width <= 32) *(u32 *) value = inl(port); - } else { + else BUG(); - } return AE_OK; } @@ -908,15 +916,14 @@ EXPORT_SYMBOL(acpi_os_read_port); acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width) { - if (width <= 8) { + if (width <= 8) outb(value, port); - } else if (width <= 16) { + else if (width <= 16) outw(value, port); - } else if (width <= 32) { + else if (width <= 32) outl(value, port); - } else { + else BUG(); - } return AE_OK; } @@ -932,6 +939,7 @@ static inline u64 read64(const volatile void __iomem *addr) static inline u64 read64(const volatile void __iomem *addr) { u64 l, h; + l = readl(addr); h = readl(addr+4); return l | (h << 32); @@ -1116,8 +1124,8 @@ static void acpi_os_execute_deferred(struct work_struct *work) * * RETURN: Status * - * DESCRIPTION: Depending on type, either queues function for deferred execution or - * immediately executes function on a separate thread. + * DESCRIPTION: Depending on type, either queues function for deferred + * execution or immediately executes function on a separate thread. * ******************************************************************************/ @@ -1128,6 +1136,7 @@ acpi_status acpi_os_execute(acpi_execute_type type, struct acpi_os_dpc *dpc; struct workqueue_struct *queue; int ret; + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Scheduling function [%p(%p)] for deferred execution.\n", function, context)); @@ -1199,7 +1208,8 @@ struct acpi_hp_work { static void acpi_hotplug_work_fn(struct work_struct *work) { - struct acpi_hp_work *hpw = container_of(work, struct acpi_hp_work, work); + struct acpi_hp_work *hpw = container_of(work, struct acpi_hp_work, + work); acpi_os_wait_events_complete(); acpi_device_hotplug(hpw->adev, hpw->src); @@ -1693,6 +1703,7 @@ void acpi_os_delete_lock(acpi_spinlock handle) acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp) { acpi_cpu_flags flags; + spin_lock_irqsave(lockp, flags); return flags; } @@ -1869,6 +1880,7 @@ acpi_status acpi_os_prepare_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control) { int rc = 0; + if (__acpi_os_prepare_sleep) rc = __acpi_os_prepare_sleep(sleep_state, pm1a_control, pm1b_control); @@ -1890,6 +1902,7 @@ acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b) { int rc = 0; + if (__acpi_os_prepare_extended_sleep) rc = __acpi_os_prepare_extended_sleep(sleep_state, val_a, val_b);