From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751882AbbHBUHz (ORCPT ); Sun, 2 Aug 2015 16:07:55 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:57774 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbbHBUHy (ORCPT ); Sun, 2 Aug 2015 16:07:54 -0400 X-IronPort-AV: E=Sophos;i="5.15,596,1432591200"; d="scan'208";a="172439604" Date: Sun, 2 Aug 2015 22:07:51 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: =?ISO-8859-15?Q?Zolt=E1n_Lajos_Kis?= cc: oleg.drokin@intel.com, andreas.dilger@intel.com, gregkh@linuxfoundation.org, bgolaszewski@baylibre.com, john.hammond@intel.com, dmitry4ever@gmail.com, HPDD-discuss@ml01.01.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings In-Reply-To: <1438545085-23103-1-git-send-email-zoltan.lajos.kis@gmail.com> Message-ID: References: <1438545085-23103-1-git-send-email-zoltan.lajos.kis@gmail.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1587987265-1438546072=:2044" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1587987265-1438546072=:2044 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Sun, 2 Aug 2015, Zoltán Lajos Kis wrote: > Fixes the following sparse warnings: > > drivers/staging/lustre/lustre/ptlrpc/service.c:72:35: warning: symbol > 'ptlrpc_alloc_rqbd' was not declared. Should it be static? > 1065 drivers/staging/lustre/lustre/ptlrpc/service.c:105:1: warning: > symbol 'ptlrpc_free_rqbd' was not declared. Should it be static? > 1066 drivers/staging/lustre/lustre/ptlrpc/service.c:122:1: warning: > symbol 'ptlrpc_grow_req_bufs' was not declared. Should it be static? > 1067 drivers/staging/lustre/lustre/ptlrpc/service.c:3055:5: warning: > symbol 'ptlrpc_svcpt_health_check' was not declared. Should it be > static? Try to come up with a commit message that says something more than "fix". Something like "Make static some functions that are not used outside the file in which they are defined" would make clear what is done and why. It would be nice to say that sparse helped you find the problem, but goal of the change should not be to silence sparse. julia > Signed-off-by: Zoltán Lajos Kis " > --- > drivers/staging/lustre/lustre/ptlrpc/service.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c > index cf9477d..d3265a8 100644 > --- a/drivers/staging/lustre/lustre/ptlrpc/service.c > +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c > @@ -69,7 +69,7 @@ LIST_HEAD(ptlrpc_all_services); > /** Used to protect the \e ptlrpc_all_services list */ > struct mutex ptlrpc_all_services_mutex; > > -struct ptlrpc_request_buffer_desc * > +static struct ptlrpc_request_buffer_desc * > ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt) > { > struct ptlrpc_service *svc = svcpt->scp_service; > @@ -101,7 +101,7 @@ ptlrpc_alloc_rqbd(struct ptlrpc_service_part *svcpt) > return rqbd; > } > > -void > +static void > ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd) > { > struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt; > @@ -118,7 +118,7 @@ ptlrpc_free_rqbd(struct ptlrpc_request_buffer_desc *rqbd) > kfree(rqbd); > } > > -int > +static int > ptlrpc_grow_req_bufs(struct ptlrpc_service_part *svcpt, int post) > { > struct ptlrpc_service *svc = svcpt->scp_service; > @@ -3052,7 +3052,7 @@ EXPORT_SYMBOL(ptlrpc_unregister_service); > * Right now, it just checks to make sure that requests aren't languishing > * in the queue. We'll use this health check to govern whether a node needs > * to be shot, so it's intentionally non-aggressive. */ > -int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt) > +static int ptlrpc_svcpt_health_check(struct ptlrpc_service_part *svcpt) > { > struct ptlrpc_request *request = NULL; > struct timeval right_now; > -- > 1.9.1 > > --8323328-1587987265-1438546072=:2044--