From patchwork Mon Dec 7 11:50:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 57784 Delivered-To: patch@linaro.org Received: by 10.202.179.86 with SMTP id c83csp945590oif; Mon, 7 Dec 2015 03:55:28 -0800 (PST) X-Received: by 10.98.70.141 with SMTP id o13mr43107655pfi.44.1449489328225; Mon, 07 Dec 2015 03:55:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gy7si2448901pac.227.2015.12.07.03.55.26; Mon, 07 Dec 2015 03:55:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932372AbbLGLzX (ORCPT + 28 others); Mon, 7 Dec 2015 06:55:23 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:33390 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756034AbbLGLuq (ORCPT ); Mon, 7 Dec 2015 06:50:46 -0500 Received: by wmec201 with SMTP id c201so161526501wme.0 for ; Mon, 07 Dec 2015 03:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=fjEj6FrWrsRMpnm7diAqMdKOi3iOBrgl5SNzPvpzmRc=; b=C1WWLhjiJLplwH5fkvp8TT3I69nZU55LoHI7TGRJWAHVOJ5mLQj2NSJ14B3mr8XZZC rAEZkn6FIWEPcWifbWSnyKyQYXMPK3oh0TvleAOSfyXhqez6hotgymSyGLVi4aFO28RB HZZ0auHaapvv0RplD/ScXTN+zGArMpus45Qg+1Ru3O/gIoH9MkwYpP8ByzbjFn1LcEZZ kBfpQ6tU3HEl0C9g8KYmwXLDKhPkVRoxasfzJ2VNcXVNwXFW5oyO7ZZa9nJDUcVW+dQJ 2qIZRufyJVhSsOe3XaPjBGS9bwSbBhcquz7Wtgl6M9v8J2CbOk1VCS34d70+OKg/2kF6 bWHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=fjEj6FrWrsRMpnm7diAqMdKOi3iOBrgl5SNzPvpzmRc=; b=hiLWgFau0t09HtTkUbaolqa33NqhpEWTMaWtzDmKZZhAu3XLZICh3rwRnvKlmd8u/N wDWqqfp5GJOuHtlU/7OriVtVuBiW3fp4M2gXg6IqCjqobTtC84eEZgywPzDjTDEVevdG uwnRxfHMkORu1zWYsUBFQtZtGvoEzlKkUL5JOWGBqBOaRAdztQYu4d5oTcey7wNuGo21 q8TvxmW4Fl2wFRajACFtwTQuuVQSLpEi+MrUqRyiycZwv0cD2WaTs3NIx9DTP07KoVUW FpSkDfsvPS0jXibbu0k9rBJwlSfozS47/1slFCQ9sSJNp3W4lJ6AN1DB71MiFvUbMgSW z/2Q== X-Gm-Message-State: ALoCoQnCLKl3IGy71XLfMztOKKXuK7PZjh7nkrY8Y0N192mI7MI9Qd2zOyekerM3XOyjtuDQGthE X-Received: by 10.194.200.227 with SMTP id jv3mr33549139wjc.20.1449489044826; Mon, 07 Dec 2015 03:50:44 -0800 (PST) Received: from localhost.localdomain (host81-129-174-134.range81-129.btcentralplus.com. [81.129.174.134]) by smtp.gmail.com with ESMTPSA id z1sm24806533wje.35.2015.12.07.03.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Dec 2015 03:50:44 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/19] mfd: ab8500-core: Fix many warnings reported by Checkpatch Date: Mon, 7 Dec 2015 11:50:17 +0000 Message-Id: <1449489032-14374-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449489032-14374-1-git-send-email-lee.jones@linaro.org> References: <1449489032-14374-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org WARNING: Block comments use a trailing */ on a separate line + * */ WARNING: Block comments use a trailing */ on a separate line + * bank on higher 8 bits and reg in lower */ WARNING: Block comments use a trailing */ on a separate line + * bank on higher 8 bits and reg in lower */ WARNING: suspect code indent for conditional statements (8, 24) + if (unlikely(*offset == 17)) + *offset = 24; WARNING: suspect code indent for conditional statements (8, 24) + if (unlikely(*offset == 16)) + *offset = 25; WARNING: suspect code indent for conditional statements (8, 24) + if ((i == 3) && (*offset >= 24)) + *offset += 2; WARNING: ENOSYS means 'invalid syscall nr' and nothing else + return -ENOSYS; WARNING: static const char * array should probably be static const char * const + static const char *switch_off_status[] = { WARNING: static const char * array should probably be static const char * const + static const char *turn_on_status[] = { total: 0 errors, 9 warnings, 1867 lines checked Cc: Linus Walleij Signed-off-by: Lee Jones --- drivers/mfd/ab8500-core.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index fefbe4c..4080f01 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -113,7 +113,7 @@ #define AB8500_SWITCH_OFF_STATUS 0x00 #define AB8500_TURN_ON_STATUS 0x00 -#define AB8505_TURN_ON_STATUS_2 0x04 +#define AB8505_TURN_ON_STATUS_2 0x04 #define AB8500_CH_USBCH_STAT1_REG 0x02 #define VBUS_DET_DBNC100 0x02 @@ -211,7 +211,7 @@ static int set_register_interruptible(struct ab8500 *ab8500, u8 bank, /* * Put the u8 bank and u8 register together into a an u16. * The bank on higher 8 bits and register in lower 8 bits. - * */ + */ u16 addr = ((u16)bank) << 8 | reg; dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data); @@ -243,8 +243,6 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, u8 reg, u8 *value) { int ret; - /* put the u8 bank and u8 reg together into a an u16. - * bank on higher 8 bits and reg in lower */ u16 addr = ((u16)bank) << 8 | reg; mutex_lock(&ab8500->lock); @@ -278,8 +276,6 @@ static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank, u8 reg, u8 bitmask, u8 bitvalues) { int ret; - /* put the u8 bank and u8 reg together into a an u16. - * bank on higher 8 bits and reg in lower */ u16 addr = ((u16)bank) << 8 | reg; mutex_lock(&ab8500->lock); @@ -449,12 +445,12 @@ static void update_latch_offset(u8 *offset, int i) { /* Fix inconsistent ITFromLatch25 bit mapping... */ if (unlikely(*offset == 17)) - *offset = 24; + *offset = 24; /* Fix inconsistent ab8540 bit mapping... */ if (unlikely(*offset == 16)) - *offset = 25; + *offset = 25; if ((i == 3) && (*offset >= 24)) - *offset += 2; + *offset += 2; } static int ab8500_handle_hierarchical_line(struct ab8500 *ab8500, @@ -590,12 +586,12 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np) /* If ->irq_base is zero this will give a linear mapping */ ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node, - num_irqs, 0, - &ab8500_irq_ops, ab8500); + num_irqs, 0, + &ab8500_irq_ops, ab8500); if (!ab8500->domain) { dev_err(ab8500->dev, "Failed to create irqdomain\n"); - return -ENOSYS; + return -ENODEV; } return 0; @@ -1549,7 +1545,7 @@ static struct attribute_group ab9540_attr_group = { static int ab8500_probe(struct platform_device *pdev) { - static const char *switch_off_status[] = { + static const char * const switch_off_status[] = { "Swoff bit programming", "Thermal protection activation", "Vbat lower then BattOk falling threshold", @@ -1558,7 +1554,7 @@ static int ab8500_probe(struct platform_device *pdev) "Battery level lower than power on reset threshold", "Power on key 1 pressed longer than 10 seconds", "DB8500 thermal shutdown"}; - static const char *turn_on_status[] = { + static const char * const turn_on_status[] = { "Battery rising (Vbat)", "Power On Key 1 dbF", "Power On Key 2 dbF",