Skip to contentSkip to conversation

: minor compiler warning and lsqa fixes

PATCH In review David Disseldorp 2 participants 5 messages Oct 11, 2022

lore
Share & tools
lore
#0 lore raw

cover : minor compiler warning and lsqa fixes

I couple of minor clean-ups I had laying around:

 lsqa.pl                | 2 +-
 src/seek_sanity_test.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
#1 lore raw

PATCH 1/2 lsqa.pl: fix --header output

7e98d41a ("fstests: move test group info to test files") replaces the post-header "seq" assignment with "./common/preamble\n_begin_fstest ..." Update lsqa.pl to recognise the "./common/preamble" line as a header divider.

---
 lsqa.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lsqa.pl +1 -1
index 8ca1167f..63bee582 100755
@@ -99,7 +99,7 @@ sub get_qa_header($) {
 	m/^# SPDX/i		and next; # SPDX tags
 	m/^# Copyright/i	and next; # Copyright tags
 	m/^#\s*\-{10}/		and last; # dashed lines
-	m/^seq/i		and last; # test start
+	m/^\. \.\/common\/preamble/ and last; # test start
 
 	s/^# *//;
 
Signature · 1 line
2.35.3
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] lsqa.pl: fix --header output

Quoted 15 lines · David Disseldorp

7e98d41a ("fstests: move test group info to test files") replaces the post-header "seq" assignment with "./common/preamble\n_begin_fstest ..." Update lsqa.pl to recognise the "./common/preamble" line as a header divider.

---
 lsqa.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lsqa.pl +0 -0
index 8ca1167f..63bee582 100755

lsqa.pl sub get_qa_header($) { · line 102

Quoted 5 lines
lsqa.pl +1 -1
@@ -99,7 +99,7 @@ sub get_qa_header($) {
 	m/^# SPDX/i		and next; # SPDX tags
 	m/^# Copyright/i	and next; # Copyright tags
 	m/^#\s*\-{10}/		and last; # dashed lines
-	m/^seq/i		and last; # test start
+	m/^\. \.\/common\/preamble/ and last; # test start

I think that makes sense, I don't have better idea, so ..

Quoted 6 lines
lsqa.pl +0 -0
 	s/^# *//;
 
Signature · 1 line
2.35.3
#3 lore raw

PATCH 2/2 seek_sanity_test: drop unused pagesz

In reply to David Disseldorp

b91889d7 ("seek_sanity_test: use XFS ioctls to determine file allocation unit size") left this unused, resulting in:

seek_sanity_test.c: In function 'get_io_sizes':
seek_sanity_test.c:70:6: warning: unused variable 'pagesz'

  int pagesz = sysconf(_SC_PAGE_SIZE);
      ^~~~~~
---
 src/seek_sanity_test.c | 1 -
 1 file changed, 1 deletion(-)
src/seek_sanity_test.c +0 -1
index 78f835e8..8a586f74 100644
@@ -67,7 +67,6 @@ static int get_io_sizes(int fd)
 	off_t pos = 0, offset = 1;
 	struct stat buf;
 	int shift, ret;
-	int pagesz = sysconf(_SC_PAGE_SIZE);
 
 	ret = detect_xfs_alloc_unit(fd);
 	if (!ret)
Signature · 1 line
2.35.3
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] seek_sanity_test: drop unused pagesz

Quoted 10 lines · David Disseldorp

b91889d7 ("seek_sanity_test: use XFS ioctls to determine file allocation unit size") left this unused, resulting in:

seek_sanity_test.c: In function 'get_io_sizes':
seek_sanity_test.c:70:6: warning: unused variable 'pagesz'

  int pagesz = sysconf(_SC_PAGE_SIZE);
      ^~~~~~

---

OK, finally we can't stand this warning :)

Quoted 18 lines
 src/seek_sanity_test.c | 1 -
 1 file changed, 1 deletion(-)
src/seek_sanity_test.c +0 -1
index 78f835e8..8a586f74 100644
@@ -67,7 +67,6 @@ static int get_io_sizes(int fd)
 	off_t pos = 0, offset = 1;
 	struct stat buf;
 	int shift, ret;
-	int pagesz = sysconf(_SC_PAGE_SIZE);
 
 	ret = detect_xfs_alloc_unit(fd);
 	if (!ret)
Signature · 1 line
2.35.3