From patchwork Wed Feb 25 00:36:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 45002 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 182D32029F for ; Wed, 25 Feb 2015 00:36:59 +0000 (UTC) Received: by lamq1 with SMTP id q1sf358710lam.0 for ; Tue, 24 Feb 2015 16:36:58 -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=27PY7FHPjJBpzenyPDqaIQ5C4obObhrrNSW0zD9ZbFA=; b=gapnW0PWuShsgDBf/Daaxe8d9PRR3hbJxe1KeALS/Cx1BM2T5m28N+L+i4czldv7Gv ZXXCAO1kLhSAVm6FLcbwcP2KC+cFz+gDg0ITXHPcLDRe5lz5HY4Z/X2abGkdmj3bvpSx ZarHLVXeD1jTbcLLEoYxH1LL6jE5eMRLe7O2cNiiYk63PAjDSsp4SZa7zt/E+3sdLVzA fatwpwiz55U09dUGm6iFbwGtMI6ANBDV8R0li3dyl5jav6eIWVwj1bU5+mmffNFl3lNH o4Mj95vcRsL+1cZeItIjPlL5nT849mYpTa2HOaqbIDQW4H0vLODWIH1fULcM+rC0rYIX gRpA== X-Gm-Message-State: ALoCoQmXSsCpPYDhnLwTnmAA5ufWkVLoXMzZl3g3O2FfzYAV6rSvlEZ0TUdI8UYsCCucTPgDxv9g X-Received: by 10.112.159.227 with SMTP id xf3mr71201lbb.11.1424824618091; Tue, 24 Feb 2015 16:36:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.9 with SMTP id bc9ls809012lab.101.gmail; Tue, 24 Feb 2015 16:36:57 -0800 (PST) X-Received: by 10.112.181.231 with SMTP id dz7mr399203lbc.47.1424824617878; Tue, 24 Feb 2015 16:36:57 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id wv11si28008808lac.84.2015.02.24.16.36.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 16:36:57 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbvn10 with SMTP id n10so521314lbv.6 for ; Tue, 24 Feb 2015 16:36:57 -0800 (PST) X-Received: by 10.112.204.197 with SMTP id la5mr421391lbc.29.1424824617789; Tue, 24 Feb 2015 16:36:57 -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 h5csp2269146lbj; Tue, 24 Feb 2015 16:36:56 -0800 (PST) X-Received: by 10.107.153.193 with SMTP id b184mr1115915ioe.85.1424824610127; Tue, 24 Feb 2015 16:36:50 -0800 (PST) Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com. [209.85.223.174]) by mx.google.com with ESMTPS id pn8si3456495icb.34.2015.02.24.16.36.49 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 al.stone@linaro.org designates 209.85.223.174 as permitted sender) client-ip=209.85.223.174; Received: by iecrl12 with SMTP id rl12so809913iec.2 for ; Tue, 24 Feb 2015 16:36:49 -0800 (PST) X-Received: by 10.50.107.7 with SMTP id gy7mr1203719igb.49.1424824609385; Tue, 24 Feb 2015 16:36:49 -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.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 16:36:47 -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 4/9] ACPI: clean up checkpatch warnings for items with possible semantic value Date: Tue, 24 Feb 2015 17:36:20 -0700 Message-Id: <1424824585-6405-5-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.170 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 some warnings from checkpatch that fall into more semantic issues; none of these should change functionality, but they do touch lines of code with semantic significance: -- replaced #include with #include -- replaced extern that was only being used for sizeof() with a #define -- removed use of else after breaks/returns when not useful -- moved __initdata to the proper place in a definition -- moved EXPORT_SYMBOL to a line immediately after the function -- removed unnecessary return statements from void functions Signed-off-by: Al Stone --- drivers/acpi/osl.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 46317ff..af6dda7 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -40,9 +40,8 @@ #include #include #include - -#include -#include +#include +#include #include "internal.h" @@ -66,7 +65,7 @@ struct acpi_os_dpc { int acpi_in_debugger; EXPORT_SYMBOL(acpi_in_debugger); -extern char line_buf[80]; +#define DEBUGGER_LINE_BUFLEN 80 #endif /*ENABLE_DEBUGGER */ static int (*__acpi_os_prepare_sleep)(u8 sleep_state, u32 pm1a_ctrl, @@ -268,10 +267,8 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) return efi.acpi20; else if (efi.acpi != EFI_INVALID_TABLE_ADDR) return efi.acpi; - else { - pr_err(PREFIX "System description tables not found\n"); - return 0; - } + pr_err(PREFIX "System description tables not found\n"); + return 0; } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) { acpi_physical_address pa = 0; @@ -594,7 +591,7 @@ static const char * const table_sigs[] = { #define ACPI_HEADER_SIZE sizeof(struct acpi_table_header) #define ACPI_OVERRIDE_TABLES 64 -static struct cpio_data __initdata acpi_initrd_files[ACPI_OVERRIDE_TABLES]; +static struct cpio_data acpi_initrd_files[ACPI_OVERRIDE_TABLES] __initdata; #define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT) @@ -806,10 +803,10 @@ static irqreturn_t acpi_irq(int irq, void *dev_id) if (handled) { acpi_irq_handled++; return IRQ_HANDLED; - } else { - acpi_irq_not_handled++; - return IRQ_NONE; } + + acpi_irq_not_handled++; + return IRQ_NONE; } acpi_status @@ -911,7 +908,6 @@ acpi_status acpi_os_read_port(acpi_io_address port, u32 *value, u32 width) return AE_OK; } - EXPORT_SYMBOL(acpi_os_read_port); acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width) @@ -927,7 +923,6 @@ acpi_status acpi_os_write_port(acpi_io_address port, u32 value, u32 width) return AE_OK; } - EXPORT_SYMBOL(acpi_os_write_port); #ifdef readq @@ -1362,7 +1357,7 @@ u32 acpi_os_get_line(char *buffer) if (acpi_in_debugger) { u32 chars; - kdb_read(buffer, sizeof(line_buf)); + kdb_read(buffer, sizeof(DEBUGGER_LINE_BUFLEN)); /* remove the CR kdb includes */ chars = strlen(buffer) - 1; @@ -1490,8 +1485,6 @@ static void __init set_osi_linux(unsigned int enable) acpi_osi_setup("Linux"); else acpi_osi_setup("!Linux"); - - return; } static void __init acpi_cmdline_osi_linux(unsigned int enable) @@ -1499,8 +1492,6 @@ static void __init acpi_cmdline_osi_linux(unsigned int enable) osi_linux.cmdline = 1; /* cmdline set the default and override DMI */ osi_linux.dmi = 0; set_osi_linux(enable); - - return; } void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) @@ -1512,8 +1503,6 @@ void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */ set_osi_linux(enable); - - return; } /*