From patchwork Tue Sep 16 20:51:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 4920521 Return-Path: X-Original-To: patchwork-cifs-client@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 33E9D9F349 for ; Tue, 16 Sep 2014 20:56:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 082F020172 for ; Tue, 16 Sep 2014 20:58:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2556B2015D for ; Tue, 16 Sep 2014 20:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755818AbaIPU6t (ORCPT ); Tue, 16 Sep 2014 16:58:49 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:61803 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755158AbaIPUwD (ORCPT ); Tue, 16 Sep 2014 16:52:03 -0400 Received: by mail-la0-f47.google.com with SMTP id mc6so605624lab.34 for ; Tue, 16 Sep 2014 13:52:02 -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=mqEex10VFJAxXY5ADs41JG2nozELFBTcw7sJmiehdzA=; b=QRC0NcCG8DurIufAsZisJ8j8xdXBuwAid2ueVXMLc7QAFBBpSDdVBXU77NzxbOVpxJ 1JdnQ+PxqJ9Sx2TbEL5qzfYqfL4k7jB6k79v7jLJ86ZQV5KFc2uguek8MlOF6cCwuo83 E6kWJrGedSsWHH57jkYSUz44Ph0RmJ4Ulwq0c= 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=mqEex10VFJAxXY5ADs41JG2nozELFBTcw7sJmiehdzA=; b=ASXh+Q8WQwWVg3UyTaKi0KW/hEQIWxCsFMsVj/PQWOKk+RujafE8vhTO18fAfQQgk5 KIjLpep0TxJPsp3QFlba9CZFnxfx5Nw/Hd6/10eSXWCQUZfzX5bStFXvakapysMBLaiw bSyY12HCM13iSyOSdFGg9zGu1PE1htgoSEl5oVuRAlB3VzMqVijf5QvIs83Cf5BrNc+a +L06DMY5sm6OR9joqEio0I+Yjk7n154qdNcvoaX965Jzh3P4fTjgPzSRG8D0ZTem+GfZ yOLoXw6lTLG2iD2m4HfMJRWh7s86LU9ysQJ7tJ4OI5p7Wbw1DIiskr87Wp9kbbjcDsZp /f9Q== X-Gm-Message-State: ALoCoQn4lglMoeHbPf/Yxw+qgi6zID8H0pkcJVxtlk+cTzhMVRbfPPBsQ/O6oc/HQnwAFAsRbizJ X-Received: by 10.152.7.212 with SMTP id l20mr39751012laa.7.1410900722123; Tue, 16 Sep 2014 13:52:02 -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.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 13:52:01 -0700 (PDT) From: Rasmus Villemoes To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH 05/22] cifs: Replace strnicmp with strncasecmp Date: Tue, 16 Sep 2014 22:51:19 +0200 Message-Id: <1410900696-6481-6-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-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@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=ham 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: Steve French Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Rasmus Villemoes --- fs/cifs/cifs_dfs_ref.c | 6 +++--- fs/cifs/connect.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index 58df174..b8602f1 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c @@ -195,15 +195,15 @@ char *cifs_compose_mount_options(const char *sb_mountdata, else noff = tkn_e - (sb_mountdata + off) + 1; - if (strnicmp(sb_mountdata + off, "unc=", 4) == 0) { + if (strncasecmp(sb_mountdata + off, "unc=", 4) == 0) { off += noff; continue; } - if (strnicmp(sb_mountdata + off, "ip=", 3) == 0) { + if (strncasecmp(sb_mountdata + off, "ip=", 3) == 0) { off += noff; continue; } - if (strnicmp(sb_mountdata + off, "prefixpath=", 11) == 0) { + if (strncasecmp(sb_mountdata + off, "prefixpath=", 11) == 0) { off += noff; continue; } diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 8a9fded..48e079e 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1705,7 +1705,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, goto cifs_parse_mount_err; } - if (strnicmp(string, "default", 7) != 0) { + if (strncasecmp(string, "default", 7) != 0) { vol->iocharset = kstrdup(string, GFP_KERNEL); if (!vol->iocharset) { @@ -1777,7 +1777,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, if (string == NULL) goto out_nomem; - if (strnicmp(string, "1", 1) == 0) { + if (strncasecmp(string, "1", 1) == 0) { /* This is the default */ break; }