From patchwork Thu Jan 1 16:58:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5557221 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82A80BF6C3 for ; Thu, 1 Jan 2015 16:55:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F3F42024C for ; Thu, 1 Jan 2015 16:55:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 89F0920220 for ; Thu, 1 Jan 2015 16:55:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbbAAQzd (ORCPT ); Thu, 1 Jan 2015 11:55:33 -0500 Received: from mail-wg0-f43.google.com ([74.125.82.43]:45161 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751487AbbAAQzc (ORCPT ); Thu, 1 Jan 2015 11:55:32 -0500 Received: by mail-wg0-f43.google.com with SMTP id k14so5471472wgh.16 for ; Thu, 01 Jan 2015 08:55:31 -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; bh=fGo1Lqru34ZehfqFrjH/C55AShHZ7k1pbu5gdBOTWvQ=; b=i2rWSmUD/Z8J3aYMxcX8C/ux+91Q4fJXc6Vsxea5tQBAYi7o+9VdgU+KORjZdP9ewt br3vMEO/4CsKqFrdtAXmV7alLfi6+yCsCl/wDnjyEbaZAap7PZGGCi/noXOpqKyJypts /U63ueaHcIVPwvdXAS8c8evl8rbAGtmjCgFwsMWBisALjOIyGkxnMnm6oaSx0fzdqk9R dIcDOrgMlwRJU5GhJY4BouZ4GdSUItUucH5ZMRgG0HNl0Nz/haoU7EsmbzF7rju82GW5 NoamrKFmfRczQNrhlxjVMLSglPgafBAG/+QQ3pEwcXnipbC0CAb+2Via5FieUx5/7K+t Hbrw== X-Gm-Message-State: ALoCoQkdyWZHORlylJBTdpLYrMeCvv9QL9Z/2KgJRIfiMFF82RjNqOxEt+z7PuDv4nHiRVrw9U7z X-Received: by 10.194.94.227 with SMTP id df3mr145100433wjb.34.1420131331180; Thu, 01 Jan 2015 08:55:31 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id lg7sm51263250wic.0.2015.01.01.08.55.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jan 2015 08:55:30 -0800 (PST) From: Rickard Strandqvist To: Yehuda Sadeh , Sage Weil Cc: Rickard Strandqvist , Alex Elder , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] block: rbd.c: Remove unused function Date: Thu, 1 Jan 2015 17:58:32 +0100 Message-Id: <1420131512-30585-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Remove the function copy_token() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/block/rbd.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 27b71a0..922f1ab 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4776,36 +4776,6 @@ static inline size_t next_token(const char **buf) } /* - * Finds the next token in *buf, and if the provided token buffer is - * big enough, copies the found token into it. The result, if - * copied, is guaranteed to be terminated with '\0'. Note that *buf - * must be terminated with '\0' on entry. - * - * Returns the length of the token found (not including the '\0'). - * Return value will be 0 if no token is found, and it will be >= - * token_size if the token would not fit. - * - * The *buf pointer will be updated to point beyond the end of the - * found token. Note that this occurs even if the token buffer is - * too small to hold it. - */ -static inline size_t copy_token(const char **buf, - char *token, - size_t token_size) -{ - size_t len; - - len = next_token(buf); - if (len < token_size) { - memcpy(token, *buf, len); - *(token + len) = '\0'; - } - *buf += len; - - return len; -} - -/* * Finds the next token in *buf, dynamically allocates a buffer big * enough to hold a copy of it, and copies the token into the new * buffer. The copy is guaranteed to be terminated with '\0'. Note