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@linaro.org X-Patchwork-Id: 5876511 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A7D979F37F for ; Wed, 25 Feb 2015 00:41:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAAA420148 for ; Wed, 25 Feb 2015 00:41:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B10482012E for ; Wed, 25 Feb 2015 00:41:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQPzY-0007aM-Ml; Wed, 25 Feb 2015 00:38:20 +0000 Received: from mail-ie0-f176.google.com ([209.85.223.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQPyQ-000725-EB for linux-arm-kernel@lists.infradead.org; Wed, 25 Feb 2015 00:37:11 +0000 Received: by iecvy18 with SMTP id vy18so688576iec.13 for ; Tue, 24 Feb 2015 16:36:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=27PY7FHPjJBpzenyPDqaIQ5C4obObhrrNSW0zD9ZbFA=; b=J3wOHM53voWQaNooXcEqIfza1ZKi6EPs1N/V2/VoPnt3MkKhVY0z4VTR4bwPzMsNrN cfCeePdUR8NUOJZCJ6AvrDqgJ/N/j+PuO79I3yfqvebbS9bE+hCzmq0jrSM+TZBs6IZ3 fy779PBRiHs/xUL1AJzXB9QSu+B7viQLsv3Wd0AqUsHKGvRBnfpZB4HAOYphJBQnRHqe aGUMhlI4WQxlAETJCndBoqrVGYj2PZHnf92pMfa1fAEYDCaD0oMmfw+AB8fsUB141Udw 6T30tLa934I2nPS0jUkw5QVoy/r3k+y45Y6Dt4ebb7v3QfZNX9t9LBvH9OCRlS5ZQAuX KWDw== X-Gm-Message-State: ALoCoQlkXM1J3aI6uKQ5GwNcWOfG5j88sTulyOevKJZUqR47vo/IAxCr2M9iOOvUtS9K/r66EX9c 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150224_163710_549996_2B31E5C5 X-CRM114-Status: GOOD ( 13.75 ) X-Spam-Score: -0.7 (/) Cc: linaro-kernel@lists.linaro.org, linux-ia64@vger.kernel.org, linaro-acpi@lists.linaro.org, patches@linaro.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devel@acpica.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; } /*