From patchwork Tue Sep 16 20:51:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 4920451 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9473A9F349 for ; Tue, 16 Sep 2014 20:55:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 813B0201DD for ; Tue, 16 Sep 2014 20:57:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B4EA2015D for ; Tue, 16 Sep 2014 20:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755315AbaIPUwL (ORCPT ); Tue, 16 Sep 2014 16:52:11 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:53957 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753749AbaIPUwJ (ORCPT ); Tue, 16 Sep 2014 16:52:09 -0400 Received: by mail-lb0-f169.google.com with SMTP id p9so612517lbv.0 for ; Tue, 16 Sep 2014 13:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MYnvkzwA6KkbnsnQVglBpWTZSZakI3e6qB5qJh5Ahrw=; b=jUapBjr5FldXINIj+XvljTxm0cPXJPaCZPR3q6tTUZ76FuRaxqCV97ARFEF7Ftgyox aDibN8yI6QBbseFobbeMdr2fo9imLPDC4k/oJQElvOwDvOfB2c/hl4OLdereNZQNbbp9 vDiqozlpBYuDNemDNNNP50+od3TDxax15Pxuc= 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=MYnvkzwA6KkbnsnQVglBpWTZSZakI3e6qB5qJh5Ahrw=; b=Egz+XcNZHQvGdJYJJUfsVYzPacCOeddm5hUKeihCC4uhEwx5xByYRQhpDzkkxxVe8C kJ3aCT88j/zVydIEDc/eZ4sAwE+qQ61Vg0RQNZF35euXmYVNEptaRDgTjIdgf7BIiJlW OLZRlVskF2OGpXP+S4XzMznlZpj3/rZMQyuCFXjTdKe9sXv5rPfuVxnFuBJhWkoOLWmE txX8qEEdgvx6mZvizYXujEWJ0CCktBmeBEryh1YWW7CrnYviVsvO89r2D1tIxYvrJXEL jT3seqyH9wyq1q5Fe+KLJ8OWkw51MOyNURotoX5VR3g/Q2Cj/7YtEzAa0GEzOHjXKhdS 3bgw== X-Gm-Message-State: ALoCoQmcY2eSQJxzEWDTiMkncygBFRA+my+7ofHPrS6HcwES5VUZmSZ7hHof1LVLDprsQdch2VZF X-Received: by 10.112.61.68 with SMTP id n4mr13614600lbr.91.1410900727871; Tue, 16 Sep 2014 13:52:07 -0700 (PDT) Received: from spencer.imf.au.dk ([130.225.20.51]) by mx.google.com with ESMTPSA id nb7sm5514091lbb.43.2014.09.16.13.52.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 13:52:06 -0700 (PDT) From: Rasmus Villemoes To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH 10/22] ACPI / battery: Replace strnicmp with strncasecmp Date: Tue, 16 Sep 2014 22:51:24 +0200 Message-Id: <1410900696-6481-11-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk> References: <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users. To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: Rasmus Villemoes --- drivers/acpi/battery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 5fdfe65..8ec8a89 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -695,7 +695,7 @@ static void acpi_battery_quirks(struct acpi_battery *battery) if (battery->power_unit && dmi_name_in_vendors("LENOVO")) { const char *s; s = dmi_get_system_info(DMI_PRODUCT_VERSION); - if (s && !strnicmp(s, "ThinkPad", 8)) { + if (s && !strncasecmp(s, "ThinkPad", 8)) { dmi_walk(find_battery, battery); if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH, &battery->flags) &&