Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1198301 > unrolled thread
| Started by | Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> |
|---|---|
| First post | 2015-08-02 22:00 +0200 |
| Last post | 2015-08-02 22:40 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> - 2015-08-02 22:00 +0200
Re: [PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-08-02 22:10 +0200
[PATCH v2] staging: lustre: service.c: make local functions static Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> - 2015-08-02 22:40 +0200
| From | Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> |
|---|---|
| Date | 2015-08-02 22:00 +0200 |
| Subject | [PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings |
| Message-ID | <pT7Am-5uQ-9@gated-at.bofh.it> |
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?
Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>"
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Julia Lawall <julia.lawall@lip6.fr> |
|---|---|
| Date | 2015-08-02 22:10 +0200 |
| Subject | Re: [PATCH] staging: lustre: ptlrpc service.c fix sparse static warnings |
| Message-ID | <pT7K3-5VF-25@gated-at.bofh.it> |
| In reply to | #1198301 |
[Multipart message — attachments visible in raw view] — view raw
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 <zoltan.lajos.kis@gmail.com>"
> ---
> 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
>
>
[toc] | [prev] | [next] | [standalone]
| From | Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com> |
|---|---|
| Date | 2015-08-02 22:40 +0200 |
| Subject | [PATCH v2] staging: lustre: service.c: make local functions static |
| Message-ID | <pT8d4-6tx-13@gated-at.bofh.it> |
| In reply to | #1198307 |
Makes functions that are not used outside the file in which they are defined
static, as reported by sparse:
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?
Signed-off-by: Zoltán Lajos Kis <zoltan.lajos.kis@gmail.com>"
---
v2: Made commit message and subject line more descriptive
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web