* [PATCH] block: Fix sparse warning
@ 2012-11-19 11:00 Tushar Behera
2012-12-06 23:32 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Tushar Behera @ 2012-11-19 11:00 UTC (permalink / raw)
To: linux-kernel; +Cc: axboe, patches
blk_drain_queue is only used in this file, so should be marked static.
Fixes following sparse warning.
block/blk-core.c:361:6: warning: symbol 'blk_drain_queue' was not
declared. Should it be static?
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
block/blk-core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index a8b1527..5db63eb 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -358,7 +358,7 @@ EXPORT_SYMBOL(blk_put_queue);
* If not, only ELVPRIV requests are drained. The caller is responsible
* for ensuring that no new requests which need to be drained are queued.
*/
-void blk_drain_queue(struct request_queue *q, bool drain_all)
+static void blk_drain_queue(struct request_queue *q, bool drain_all)
{
int i;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block: Fix sparse warning
2012-11-19 11:00 [PATCH] block: Fix sparse warning Tushar Behera
@ 2012-12-06 23:32 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2012-12-06 23:32 UTC (permalink / raw)
To: Tushar Behera; +Cc: linux-kernel, axboe, patches
On Mon, 19 Nov 2012 16:30:40 +0530
Tushar Behera <tushar.behera@linaro.org> wrote:
> blk_drain_queue is only used in this file, so should be marked static.
>
> Fixes following sparse warning.
>
> block/blk-core.c:361:6: warning: symbol 'blk_drain_queue' was not
> declared. Should it be static?
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
> block/blk-core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index a8b1527..5db63eb 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -358,7 +358,7 @@ EXPORT_SYMBOL(blk_put_queue);
> * If not, only ELVPRIV requests are drained. The caller is responsible
> * for ensuring that no new requests which need to be drained are queued.
> */
> -void blk_drain_queue(struct request_queue *q, bool drain_all)
> +static void blk_drain_queue(struct request_queue *q, bool drain_all)
> {
> int i;
nit: the objective of this patch is not to reduce the sparse output; it
is to improve the kernel by giving an unnecessarily-global symbol
static scope.
So a better title is one which describes the code fix. The fact that
sparse happened to detect it is less important. I chose
"block/blk-core.c: make blk_drain_queue() static".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-06 23:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 11:00 [PATCH] block: Fix sparse warning Tushar Behera
2012-12-06 23:32 ` Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.