mbox

[PULL,00/20] bsd-user style tweaks and start cleanup

Message ID 20210512171720.46744-1-imp@bsdimp.com (mailing list archive)
State New, archived
Headers show

Pull-request

https://gitlab.com/bsdimp/qemu.git tags/pull-bsd-user-20210511

Message

Warner Losh May 12, 2021, 5:17 p.m. UTC
The following changes since commit f9a576a818044133f8564e0d243ebd97df0b3280:

  Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20210506' into staging (2021-05-11 13:03:44 +0100)

are available in the Git repository at:

  https://gitlab.com/bsdimp/qemu.git tags/pull-bsd-user-20210511

for you to fetch changes up to afcbcff80bf81a3399e24c7908b17776e1489df9:

  bsd-user: rename linux_binprm to bsd_binprm (2021-05-11 13:53:52 -0600)

----------------------------------------------------------------

pull-bsd-user-20210511 is the next round of cleanups to bsd-user in merging the
bsd-user fork into qemu. It contains a number of style commits, as well as 3
commits that start to change things: Some unused files are deleted, building the
sparc and sparc64 targets are removed, and a structure is renamed.

The next set of pull requests will start to execute the following plan:
1. Move existing code around to have a structure similar to the bsd-user fork.
2. Incrementally merge groups of system calls, focused on making x86 work.
3. Once the groups of system calls are all merged, additional platforms will
   be added back.
4. Concurrently, as changes are requested as part of the merge happen, those
   changes will be merged into the fork.
5. Eventually, there will be no diference, and the bsd-user fork will only
   be a staging area for cutting-edge features prior to upstreaming into
   qemu mainline.

The bsd-user code in qemu has a lot of style issues. This cleans up a number in
the files touched. However, the checkpatch.pl detects some incremental issues in
the commits. The following are expected, but are corrected in later hashes in
this branch. MAINTAINERS does not need to be updated, since all the files added
or deleted are covered under existing regexp in MAINTAINERS.

Checking all commits since f9a576a818044133f8564e0d243ebd97df0b3280...
d60c3b932e2fa06aba5d7aa1c451b5d287095dc8:101: ERROR: consider using qemu_strtol in preference to strtol
d60c3b932e2fa06aba5d7aa1c451b5d287095dc8:142: ERROR: braces {} are necessary for all arms of this statement
d60c3b932e2fa06aba5d7aa1c451b5d287095dc8:145: ERROR: braces {} are necessary for all arms of this statement
total: 3 errors, 0 warnings, 119 lines checked
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:148: WARNING: line over 80 characters
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:330: ERROR: braces {} are necessary for all arms of this statement
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:340: ERROR: braces {} are necessary for all arms of this statement
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:381: ERROR: space prohibited between function name and open parenthesis '('
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:390: ERROR: spaces required around that '<' (ctx:VxV)
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:408: WARNING: Block comments use a leading /* on a separate line
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:409: WARNING: Block comments use * on subsequent lines
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:409: WARNING: Block comments use a trailing */ on a separate line
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:441: WARNING: line over 80 characters
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:445: WARNING: line over 80 characters
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:502: ERROR: line over 90 characters
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:551: ERROR: space required after that ',' (ctx:VxV)
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:552: ERROR: space required after that ',' (ctx:VxV)
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:587: ERROR: space required after that ';' (ctx:VxV)
b4bebeee1dee8d333bfa105a6c28fec5eb34b147:623: ERROR: suspect code indent for conditional statements (12, 14)
total: 9 errors, 6 warnings, 664 lines checked
86545e7afe3f822b8561c7ceee7540fc3b19c3f0:31: ERROR: space required after that ';' (ctx:VxV)
86545e7afe3f822b8561c7ceee7540fc3b19c3f0:40: ERROR: space required after that ';' (ctx:VxV)
total: 2 errors, 0 warnings, 60 lines checked
Use of uninitialized value $acpi_testexpected in string eq at scripts/checkpatch.pl line 1529.
65d58c91ef1a15ad945ece367983437576f8e82b:22: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
total: 0 errors, 1 warnings, 14 lines checked
Use of uninitialized value $acpi_testexpected in string eq at scripts/checkpatch.pl line 1529.
f8ce39701b5be032fb3f9c05e8adb4055f70eec2:21: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
total: 0 errors, 1 warnings, 0 lines checked
   FAIL one or more commits failed scripts/checkpatch.pl
Cleaning up file based variables
ERROR: Job failed: exit code 1

Warner Losh (20):
      bsd-user: whitespace changes
      bsd-user: style tweak: use C not C++ comments
      bsd-user: style tweak: Remove #if 0'd code
      bsd-user: style tweak: Use preferred block comments
      bsd-user: Remove commented out code
      bsd-user: style tweak: move extern to header file
      bsd-user: style tweak: remove spacing after '*' and add after }
      bsd-user: style tweak: Use preferred block comments
      bsd-user: style tweak: don't assign in if statements
      bsd-user: style tweak: use {} for all if statements, format else correctly
      bsd-user: style tweak: use {} consistently in for / if / else statements
      bsd-user: use qemu_strtoul in preference to strtol
      bsd-user: whitespace changes
      bsd-user: style tweak: keyword space (
      bsd-user: style tweak: keyword space (
      bsd-user: style tweak: Remove #if 0'd code
      bsd-user: style tweak: keyword space (
      bsd-user: remove target_signal.h, it's unused
      bsd-user: Stop building the sparc targets
      bsd-user: rename linux_binprm to bsd_binprm

 bsd-user/bsdload.c                           |   4 +-
 bsd-user/elfload.c                           | 328 +++++++++++++--------------
 bsd-user/i386/target_signal.h                |  20 --
 bsd-user/main.c                              | 290 ++++++++---------------
 bsd-user/mmap.c                              |  22 +-
 bsd-user/qemu.h                              | 127 ++++++-----
 bsd-user/signal.c                            |   1 -
 bsd-user/sparc/target_signal.h               |  27 ---
 bsd-user/sparc64/target_signal.h             |  27 ---
 bsd-user/strace.c                            |   8 -
 bsd-user/syscall.c                           |  18 +-
 bsd-user/uaccess.c                           |   2 +-
 bsd-user/x86_64/target_signal.h              |  19 --
 default-configs/targets/sparc-bsd-user.mak   |   3 -
 default-configs/targets/sparc64-bsd-user.mak |   4 -
 15 files changed, 348 insertions(+), 552 deletions(-)
 delete mode 100644 bsd-user/i386/target_signal.h
 delete mode 100644 bsd-user/sparc/target_signal.h
 delete mode 100644 bsd-user/sparc64/target_signal.h
 delete mode 100644 bsd-user/x86_64/target_signal.h
 delete mode 100644 default-configs/targets/sparc-bsd-user.mak
 delete mode 100644 default-configs/targets/sparc64-bsd-user.mak

Comments

no-reply@patchew.org May 12, 2021, 5:45 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20210512171720.46744-1-imp@bsdimp.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210512171720.46744-1-imp@bsdimp.com
Subject: [PULL 00/20] bsd-user style tweaks and start cleanup

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210512171720.46744-1-imp@bsdimp.com -> patchew/20210512171720.46744-1-imp@bsdimp.com
Switched to a new branch 'test'
2aa0f06 bsd-user: rename linux_binprm to bsd_binprm
e744264 bsd-user: Stop building the sparc targets
4fb5ace bsd-user: remove target_signal.h, it's unused
9950891 bsd-user: style tweak: keyword space (
91acd46 bsd-user: style tweak: Remove #if 0'd code
5e136ea bsd-user: style tweak: keyword space (
0f3d103 bsd-user: style tweak: keyword space (
dc9303a bsd-user: whitespace changes
0a03bb9 bsd-user: use qemu_strtoul in preference to strtol
6ee8628 bsd-user: style tweak: use {} consistently in for / if / else statements
0144028 bsd-user: style tweak: use {} for all if statements, format else correctly
3d59f14 bsd-user: style tweak: don't assign in if statements
97c0b3e bsd-user: style tweak: Use preferred block comments
584c4ff bsd-user: style tweak: remove spacing after '*' and add after }
8239005 bsd-user: style tweak: move extern to header file
7e7f935 bsd-user: Remove commented out code
764c1fd bsd-user: style tweak: Use preferred block comments
5c28edb bsd-user: style tweak: Remove #if 0'd code
eb26490 bsd-user: style tweak: use C not C++ comments
fbb73a2 bsd-user: whitespace changes

=== OUTPUT BEGIN ===
1/20 Checking commit fbb73a2dcc67 (bsd-user: whitespace changes)
ERROR: consider using qemu_strtol in preference to strtol
#102: FILE: bsd-user/main.c:834:
+            guest_base = strtol(argv[optind++], NULL, 0);

ERROR: braces {} are necessary for all arms of this statement
#143: FILE: bsd-user/main.c:1125:
+        for (i = 0; i < 8; i++)
[...]

ERROR: braces {} are necessary for all arms of this statement
#146: FILE: bsd-user/main.c:1127:
+        for (i = 0; i < 8; i++)
[...]

total: 3 errors, 0 warnings, 119 lines checked

Patch 1/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

2/20 Checking commit eb264903b567 (bsd-user: style tweak: use C not C++ comments)
3/20 Checking commit 5c28edb911a7 (bsd-user: style tweak: Remove #if 0'd code)
4/20 Checking commit 764c1fd2354d (bsd-user: style tweak: Use preferred block comments)
5/20 Checking commit 7e7f9355aca9 (bsd-user: Remove commented out code)
6/20 Checking commit 8239005bb526 (bsd-user: style tweak: move extern to header file)
7/20 Checking commit 584c4ffaa229 (bsd-user: style tweak: remove spacing after '*' and add after })
8/20 Checking commit 97c0b3ee8dcb (bsd-user: style tweak: Use preferred block comments)
9/20 Checking commit 3d59f140da1b (bsd-user: style tweak: don't assign in if statements)
10/20 Checking commit 0144028ea197 (bsd-user: style tweak: use {} for all if statements, format else correctly)
11/20 Checking commit 6ee8628e22e5 (bsd-user: style tweak: use {} consistently in for / if / else statements)
12/20 Checking commit 0a03bb93ea8c (bsd-user: use qemu_strtoul in preference to strtol)
13/20 Checking commit dc9303a0a28d (bsd-user: whitespace changes)
WARNING: line over 80 characters
#149: FILE: bsd-user/elfload.c:541:
+#define TARGET_ELF_PAGESTART(_v) ((_v) & ~(unsigned long)(TARGET_ELF_EXEC_PAGESIZE - 1))

ERROR: braces {} are necessary for all arms of this statement
#331: FILE: bsd-user/elfload.c:867:
+    if (sizeof(struct elf_phdr) * interp_elf_ex->e_phnum > TARGET_PAGE_SIZE)
[...]

ERROR: braces {} are necessary for all arms of this statement
#341: FILE: bsd-user/elfload.c:873:
+    if (!elf_phdata)
[...]

ERROR: space prohibited between function name and open parenthesis '('
#382: FILE: bsd-user/elfload.c:894:
+        free (elf_phdata);

ERROR: spaces required around that '<' (ctx:VxV)
#391: FILE: bsd-user/elfload.c:899:
+    for (i = 0; i<interp_elf_ex->e_phnum; i++, eppnt++) {
                  ^

WARNING: Block comments use a leading /* on a separate line
#409: FILE: bsd-user/elfload.c:905:
+        /* in order to avoid hardcoding the interpreter load

WARNING: Block comments use * on subsequent lines
#410: FILE: bsd-user/elfload.c:906:
+        /* in order to avoid hardcoding the interpreter load
+           address in qemu, we allocate a big enough memory zone */

WARNING: Block comments use a trailing */ on a separate line
#410: FILE: bsd-user/elfload.c:906:
+           address in qemu, we allocate a big enough memory zone */

WARNING: line over 80 characters
#442: FILE: bsd-user/elfload.c:934:
+                                eppnt->p_filesz + TARGET_ELF_PAGEOFFSET(eppnt->p_vaddr),

WARNING: line over 80 characters
#446: FILE: bsd-user/elfload.c:938:
+                                eppnt->p_offset - TARGET_ELF_PAGEOFFSET(eppnt->p_vaddr));

ERROR: line over 90 characters
#507: FILE: bsd-user/elfload.c:978:
+    elf_bss = TARGET_ELF_PAGESTART(elf_bss + qemu_host_page_size - 1); /* What we have mapped so far */

ERROR: space required after that ',' (ctx:VxV)
#554: FILE: bsd-user/elfload.c:1186:
+    bprm->p = copy_elf_strings(bprm->envc, bprm->envp, bprm->page,bprm->p);
                                                                  ^

ERROR: space required after that ',' (ctx:VxV)
#555: FILE: bsd-user/elfload.c:1187:
+    bprm->p = copy_elf_strings(bprm->argc, bprm->argv, bprm->page,bprm->p);
                                                                  ^

ERROR: space required after that ';' (ctx:VxV)
#590: FILE: bsd-user/elfload.c:1230:
+    for (i = 0;i < elf_ex.e_phnum; i++) {
               ^

ERROR: suspect code indent for conditional statements (12, 14)
#626: FILE: bsd-user/elfload.c:1268:
+            if (strcmp(elf_interpreter, "/usr/lib/libc.so.1") == 0 ||
[...]
               ibcs2_interpreter = 1;

total: 9 errors, 6 warnings, 666 lines checked

Patch 13/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

14/20 Checking commit 0f3d1031febe (bsd-user: style tweak: keyword space ()
ERROR: space required after that ';' (ctx:VxV)
#32: FILE: bsd-user/syscall.c:275:
+    for (i = 0;i < count; i++) {
               ^

ERROR: space required after that ';' (ctx:VxV)
#41: FILE: bsd-user/syscall.c:301:
+    for (i = 0;i < count; i++) {
               ^

total: 2 errors, 0 warnings, 60 lines checked

Patch 14/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

15/20 Checking commit 5e136eabe1c8 (bsd-user: style tweak: keyword space ()
16/20 Checking commit 91acd469d2ac (bsd-user: style tweak: Remove #if 0'd code)
17/20 Checking commit 995089146a3f (bsd-user: style tweak: keyword space ()
18/20 Checking commit 4fb5ace84ebe (bsd-user: remove target_signal.h, it's unused)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#23: 
deleted file mode 100644

total: 0 errors, 1 warnings, 14 lines checked

Patch 18/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/20 Checking commit e7442640054e (bsd-user: Stop building the sparc targets)
Use of uninitialized value $acpi_testexpected in string eq at ./scripts/checkpatch.pl line 1529.
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#22: 
deleted file mode 100644

total: 0 errors, 1 warnings, 0 lines checked

Patch 19/20 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
20/20 Checking commit 2aa0f068ff78 (bsd-user: rename linux_binprm to bsd_binprm)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210512171720.46744-1-imp@bsdimp.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Peter Maydell May 20, 2021, 5:41 p.m. UTC | #2
On Wed, 12 May 2021 at 18:26, Warner Losh <imp@bsdimp.com> wrote:
>
> The following changes since commit f9a576a818044133f8564e0d243ebd97df0b3280:
>
>   Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20210506' into staging (2021-05-11 13:03:44 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/bsdimp/qemu.git tags/pull-bsd-user-20210511
>
> for you to fetch changes up to afcbcff80bf81a3399e24c7908b17776e1489df9:
>
>   bsd-user: rename linux_binprm to bsd_binprm (2021-05-11 13:53:52 -0600)


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM