From patchwork Tue Sep 16 20:51:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 4920261 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@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 923159F349 for ; Tue, 16 Sep 2014 20:50:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5807820172 for ; Tue, 16 Sep 2014 20:52:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68080201DD for ; Tue, 16 Sep 2014 20:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755469AbaIPUwY (ORCPT ); Tue, 16 Sep 2014 16:52:24 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:50270 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753062AbaIPUwX (ORCPT ); Tue, 16 Sep 2014 16:52:23 -0400 Received: by mail-la0-f48.google.com with SMTP id ty20so599093lab.21 for ; Tue, 16 Sep 2014 13:52:21 -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=DxOV5RrjksFr/BN2xVYbhE/ZBVVHX5Yz/rS2kCIPXrw=; b=A/VkLjaeL72gWKHoOQKUFSlNkXuxC31QIK0CawWQ0vY9aFhj4oxUo5iUiZr5k9NO+T 6GPZDkx91qKEBIhcFIR+ndTVR/CeSpqCFGaoUVkuU1KZpwDAPBBmweDzWJVBTUCeH1Dx d4eyZbFVkfIzjPITxwyD7mYybRObnAeDpKDhs= 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=DxOV5RrjksFr/BN2xVYbhE/ZBVVHX5Yz/rS2kCIPXrw=; b=MPz/1YRZjAbrpivKn+CixdLhFDRwRKCGApyP0sVGqJocSk4L16K+DMgIlqpCvx7v+f s0YbBc3wJ1Vn1GWfAf3ctaBHq3aP/J5DrXAdBJl35jYwXlcHRxrPCVnAxs1UIolMc7rJ mxJBxId5PdNnZhXj/4GXV4OfCAUtsefHSAX6xF7DU4oZ5d/LcBwBgDU/IzIfNAfvIftW b/2PgnvyfrULGJRmdg+PVljT+hTUgCbcNiFhIRWjqwgb8Dnhygg/BfwEqOT9aFFiUiID 1Mjoio+e4m2zXCx/YVNxwD9kw3Y7XR3+ptd+KHBkyJ1CJAgmDaYxcL1Y6R7RWbew6SCo poVA== X-Gm-Message-State: ALoCoQm66HQvBLF62eT8YOdPb3KNKNi84uQjORRRRYjWBI3TxHi/dElMiaWGGuoE204YSn8miSMq X-Received: by 10.112.130.68 with SMTP id oc4mr24219661lbb.41.1410900741661; Tue, 16 Sep 2014 13:52:21 -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.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 13:52:21 -0700 (PDT) From: Rasmus Villemoes To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org Subject: [PATCH 21/22] Thermal: Replace strnicmp with strncasecmp Date: Tue, 16 Sep 2014 22:51:35 +0200 Message-Id: <1410900696-6481-22-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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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: Zhang Rui Cc: Eduardo Valentin Cc: linux-pm@vger.kernel.org Signed-off-by: Rasmus Villemoes Acked-by: Zhang Rui --- drivers/thermal/thermal_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 71b0ec0..1e23f4f 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -66,7 +66,7 @@ static struct thermal_governor *__find_governor(const char *name) return def_governor; list_for_each_entry(pos, &thermal_governor_list, governor_list) - if (!strnicmp(name, pos->name, THERMAL_NAME_LENGTH)) + if (!strncasecmp(name, pos->name, THERMAL_NAME_LENGTH)) return pos; return NULL; @@ -104,7 +104,7 @@ int thermal_register_governor(struct thermal_governor *governor) name = pos->tzp->governor_name; - if (!strnicmp(name, governor->name, THERMAL_NAME_LENGTH)) + if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH)) pos->governor = governor; } @@ -129,7 +129,7 @@ void thermal_unregister_governor(struct thermal_governor *governor) mutex_lock(&thermal_list_lock); list_for_each_entry(pos, &thermal_tz_list, node) { - if (!strnicmp(pos->governor->name, governor->name, + if (!strncasecmp(pos->governor->name, governor->name, THERMAL_NAME_LENGTH)) pos->governor = NULL; } @@ -1665,7 +1665,7 @@ struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name) mutex_lock(&thermal_list_lock); list_for_each_entry(pos, &thermal_tz_list, node) - if (!strnicmp(name, pos->type, THERMAL_NAME_LENGTH)) { + if (!strncasecmp(name, pos->type, THERMAL_NAME_LENGTH)) { found++; ref = pos; }