From patchwork Wed Feb 20 00:45:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2165771 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A6E85DF24C for ; Wed, 20 Feb 2013 00:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933380Ab3BTAqC (ORCPT ); Tue, 19 Feb 2013 19:46:02 -0500 Received: from mail-ie0-f169.google.com ([209.85.223.169]:39924 "EHLO mail-ie0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933373Ab3BTAqB (ORCPT ); Tue, 19 Feb 2013 19:46:01 -0500 Received: by mail-ie0-f169.google.com with SMTP id 13so9433131iea.28 for ; Tue, 19 Feb 2013 16:46:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=M1HSRmdQ+yrxPA62VMsC+Oa4NFbekW6RKhmLplrekns=; b=jZOf77uOQ2h/SxIqrWi5v8turkWbvQfDjUMYOprgjHo6ie8Hy2P3UfEkSt9Rs6QsU4 WXU2jvgVGId4ATCK0+v67lv+jvoEwZq1dMeJNbJo9j6l8zIFkKmu3oc+N0gRyVdxyCTB 9h9ShGdoqx2u9hfp7oWkA1HV3TsYZvCHbCi46vw7tgcDbymLKL71S+pjMiLUosDE4Ufs semAunt4kk/Pjaeipgkzi4R64OminTlUyLKbZaXTYLDItZZqO4VrRcmiO3kyp9DxGj5H zhukCCx1LfZJRoUCvZiCJ903YxJUCBFJXe5xns/ILgei9BlZbB82wcaZwa9MmC27axAN bNKw== X-Received: by 10.50.88.233 with SMTP id bj9mr10370781igb.55.1361321160854; Tue, 19 Feb 2013 16:46:00 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id ww6sm12627972igb.2.2013.02.19.16.45.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 16:45:59 -0800 (PST) Message-ID: <51241CC6.5090101@inktank.com> Date: Tue, 19 Feb 2013 18:45:58 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: ceph-devel Subject: [PATCH] libceph: eliminate sparse warnings X-Gm-Message-State: ALoCoQnmwQuvendWi+C3SEpjPi/XIHCetIfn0B1KP/8Qg4iHyJF6S43b7QSB9rohu6wbJM8GeTE+ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Eliminate most of the problems in the libceph code that cause sparse to issue warnings. - Convert functions that are never referenced externally to have static scope. - Pass NULL rather than 0 for a pointer argument in one spot in ceph_monc_delete_snapid() This partially resolves: http://tracker.ceph.com/issues/4184 Reported-by: Fengguang Wu Signed-off-by: Alex Elder --- net/ceph/crypto.c | 7 ++++--- net/ceph/messenger.c | 2 +- net/ceph/mon_client.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index af14cb4..6e7a236 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -423,7 +423,8 @@ int ceph_encrypt2(struct ceph_crypto_key *secret, void *dst, size_t *dst_len, } } -int ceph_key_instantiate(struct key *key, struct key_preparsed_payload *prep) +static int ceph_key_instantiate(struct key *key, + struct key_preparsed_payload *prep) { struct ceph_crypto_key *ckey; size_t datalen = prep->datalen; @@ -458,12 +459,12 @@ err: return ret; } -int ceph_key_match(const struct key *key, const void *description) +static int ceph_key_match(const struct key *key, const void *description) { return strcmp(key->description, description) == 0; } -void ceph_key_destroy(struct key *key) { +static void ceph_key_destroy(struct key *key) { struct ceph_crypto_key *ckey = key->payload.data; ceph_crypto_key_destroy(ckey); diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 8a62a55..ab702cd 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -172,7 +172,7 @@ static void encode_my_addr(struct ceph_messenger *msgr) */ static struct workqueue_struct *ceph_msgr_wq; -void _ceph_msgr_exit(void) +static void _ceph_msgr_exit(void) { if (ceph_msgr_wq) { destroy_workqueue(ceph_msgr_wq); diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index 812eb3b..aef5b10 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c @@ -697,7 +697,7 @@ int ceph_monc_delete_snapid(struct ceph_mon_client *monc, u32 pool, u64 snapid) { return do_poolop(monc, POOL_OP_CREATE_UNMANAGED_SNAP, - pool, snapid, 0, 0); + pool, snapid, NULL, 0); }