diff mbox series

[6/7] lib: make a few symbols static

Message ID 20250206212145.7732-7-sandeen@redhat.com (mailing list archive)
State New
Headers show
Series fstests: enable sparse checking & fix fallout | expand

Commit Message

Eric Sandeen Feb. 6, 2025, 9:20 p.m. UTC
There are a few symbols in lib/tlibio.c which should be static,
and sparse notices this so fix it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 lib/tlibio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Darrick J. Wong Feb. 6, 2025, 10:46 p.m. UTC | #1
On Thu, Feb 06, 2025 at 03:20:01PM -0600, Eric Sandeen wrote:
> There are a few symbols in lib/tlibio.c which should be static,
> and sparse notices this so fix it.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Yep, that's pretty straightforward.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  lib/tlibio.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/tlibio.c b/lib/tlibio.c
> index 22ff1adc..2aa8175b 100644
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -82,6 +82,7 @@ static void lio_async_signal_handler(int sig);
>  /*
>   * Define the structure as used in lio_parse_arg1 and lio_help1
>   */
> +static
>  struct lio_info_type  Lio_info1[] = {
>      { "s", LIO_IO_SYNC, "sync i/o" },
>      { "p", LIO_IO_ASYNC|LIO_WAIT_SIGACTIVE, "async i/o using a loop to wait for a signal" },
> @@ -101,6 +102,7 @@ struct lio_info_type  Lio_info1[] = {
>  /*
>   * Define the structure used by lio_parse_arg2 and lio_help2
>   */
> +static
>  struct lio_info_type  Lio_info2[] = {
>      { "sync",      LIO_IO_SYNC,		"sync i/o (read/write)"},
>      { "async",     LIO_IO_ASYNC,	"async i/o (reada/writea/aio_read/aio_write)" },
> @@ -120,7 +122,7 @@ struct lio_info_type  Lio_info2[] = {
>  	"all random i/o types and wait methods (except nowait)" },
>  };
>  
> -char Lio_SysCall[PATH_MAX];	/* string containing last i/o system call */
> +static char Lio_SysCall[PATH_MAX];	/* string containing last i/o system call */
>  
>  static volatile int Received_signal = 0;	/* number of signals received */
>  static volatile int Rec_signal;
> -- 
> 2.48.0
> 
>
Christoph Hellwig Feb. 7, 2025, 5 a.m. UTC | #2
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/lib/tlibio.c b/lib/tlibio.c
index 22ff1adc..2aa8175b 100644
--- a/lib/tlibio.c
+++ b/lib/tlibio.c
@@ -82,6 +82,7 @@  static void lio_async_signal_handler(int sig);
 /*
  * Define the structure as used in lio_parse_arg1 and lio_help1
  */
+static
 struct lio_info_type  Lio_info1[] = {
     { "s", LIO_IO_SYNC, "sync i/o" },
     { "p", LIO_IO_ASYNC|LIO_WAIT_SIGACTIVE, "async i/o using a loop to wait for a signal" },
@@ -101,6 +102,7 @@  struct lio_info_type  Lio_info1[] = {
 /*
  * Define the structure used by lio_parse_arg2 and lio_help2
  */
+static
 struct lio_info_type  Lio_info2[] = {
     { "sync",      LIO_IO_SYNC,		"sync i/o (read/write)"},
     { "async",     LIO_IO_ASYNC,	"async i/o (reada/writea/aio_read/aio_write)" },
@@ -120,7 +122,7 @@  struct lio_info_type  Lio_info2[] = {
 	"all random i/o types and wait methods (except nowait)" },
 };
 
-char Lio_SysCall[PATH_MAX];	/* string containing last i/o system call */
+static char Lio_SysCall[PATH_MAX];	/* string containing last i/o system call */
 
 static volatile int Received_signal = 0;	/* number of signals received */
 static volatile int Rec_signal;