qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/9] Fix some style problems in net


From: no-reply
Subject: Re: [PATCH 0/9] Fix some style problems in net
Date: Tue, 22 Dec 2020 09:00:46 -0800 (PST)

Patchew URL: 
20201222082340.67405-1-zhanghan64@huawei.com/">https://patchew.org/QEMU/20201222082340.67405-1-zhanghan64@huawei.com/



Hi,

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

Type: series
Message-id: 20201222082340.67405-1-zhanghan64@huawei.com
Subject: [PATCH 0/9] Fix some style problems in net

=== 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
 - [tag update]      
patchew/20201221134931.1194806-1-david.edmondson@oracle.com -> 
patchew/20201221134931.1194806-1-david.edmondson@oracle.com
 * [new tag]         patchew/20201222082340.67405-1-zhanghan64@huawei.com -> 
patchew/20201222082340.67405-1-zhanghan64@huawei.com
Switched to a new branch 'test'
a1e8031 net: Fix the indent problems
3a9a235 net: Remove initialization of static ints
e1c36e1 net: Remove assignment in if condition
55fc567 net: Transfer tabs to spcaes
c96ec8e net: Fix lines over 90 characters
a9b2502 net: Transfer "foo* " to "foo *"
9dd5b80 net: Transfer // comments to /**/
cb5a663 net: Add braces for statements/fix braces' position
3256d58 net: Add spaces around operator/delete redundant spaces

=== OUTPUT BEGIN ===
1/9 Checking commit 3256d589d47c (net: Add spaces around operator/delete 
redundant spaces)
ERROR: braces {} are necessary for all arms of this statement
#24: FILE: net/checksum.c:44:
+    while (sum >> 16)
[...]

ERROR: suspect code indent for conditional statements (4, 7)
#128: FILE: net/tap-solaris.c:78:
+    if (*dev) {
        ptr = dev;

ERROR: trailing statements should be on next line
#131: FILE: net/tap-solaris.c:80:
+       while (*ptr && !qemu_isdigit((int)*ptr)) ptr++;

ERROR: braces {} are necessary for all arms of this statement
#131: FILE: net/tap-solaris.c:80:
+       while (*ptr && !qemu_isdigit((int)*ptr)) ptr++;
[...]

ERROR: suspect code indent for conditional statements (4, 7)
#137: FILE: net/tap-solaris.c:85:
+    if (ip_fd)
        close(ip_fd);

ERROR: braces {} are necessary for all arms of this statement
#137: FILE: net/tap-solaris.c:85:
+    if (ip_fd)
[...]

ERROR: do not use assignment in if condition
#146: FILE: net/tap-solaris.c:105:
+    if ((ppa = ioctl(tap_fd, I_STR, &strioc_ppa)) < 0)

ERROR: braces {} are necessary for all arms of this statement
#146: FILE: net/tap-solaris.c:105:
+    if ((ppa = ioctl(tap_fd, I_STR, &strioc_ppa)) < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement
#171: FILE: net/tap-solaris.c:127:
+    if (ioctl(if_fd, SIOCSLIFNAME, &ifr) < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement
#174: FILE: net/tap-solaris.c:129:
+    if (ioctl(if_fd, SIOCGLIFFLAGS, &ifr) < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement
#178: FILE: net/tap-solaris.c:132:
+    if (ioctl(if_fd, I_PUSH, "arp") < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement
#183: FILE: net/tap-solaris.c:136:
+    if (ioctl(ip_fd, I_POP, NULL) < 0)
[...]

ERROR: braces {} are necessary for all arms of this statement
#186: FILE: net/tap-solaris.c:138:
+    if (ioctl(ip_fd, I_PUSH, "arp") < 0)
[...]

ERROR: do not use assignment in if condition
#204: FILE: net/tap-solaris.c:154:
+    if ((ip_muxid = ioctl(ip_fd, I_LINK, if_fd)) < 0) {

ERROR: do not use assignment in if condition
#210: FILE: net/tap-solaris.c:159:
+    if ((arp_muxid = ioctl(ip_fd, link_type, arp_fd)) < 0)

ERROR: braces {} are necessary for all arms of this statement
#210: FILE: net/tap-solaris.c:159:
+    if ((arp_muxid = ioctl(ip_fd, link_type, arp_fd)) < 0)
[...]

ERROR: suspect code indent for conditional statements (4, 6)
#222: FILE: net/tap-solaris.c:169:
+    if (ioctl(ip_fd, SIOCSLIFMUXID, &ifr) < 0)
     {

ERROR: line over 90 characters
#297: FILE: net/tap-win32.c:174:
+static tun_buffer_t* 
get_buffer_from_output_queue_immediate(tap_win32_overlapped_t* const overlapped)

ERROR: "foo* bar" should be "foo *bar"
#297: FILE: net/tap-win32.c:174:
+static tun_buffer_t* 
get_buffer_from_output_queue_immediate(tap_win32_overlapped_t* const overlapped)

WARNING: line over 80 characters
#306: FILE: net/tap-win32.c:183:
+    if (overlapped->output_queue_front == NULL && 
overlapped->output_queue_back == NULL) {

ERROR: braces {} are necessary for all arms of this statement
#416: FILE: net/tap-win32.c:458:
+    if (!overlapped->tap_semaphore)
[...]

WARNING: line over 80 characters
#425: FILE: net/tap-win32.c:470:
+    result = GetOverlappedResult(overlapped->handle, 
&overlapped->write_overlapped,

WARNING: line over 80 characters
#434: FILE: net/tap-win32.c:503:
+        FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM,

ERROR: line over 90 characters
#443: FILE: net/tap-win32.c:534:
+                result = GetOverlappedResult(overlapped->handle, 
&overlapped->read_overlapped,

ERROR: line over 90 characters
#450: FILE: net/tap-win32.c:540:
+                    FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM,

WARNING: line over 80 characters
#463: FILE: net/tap-win32.c:550:
+                FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | 
FORMAT_MESSAGE_FROM_SYSTEM,

total: 22 errors, 4 warnings, 457 lines checked

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

2/9 Checking commit cb5a6632624a (net: Add braces for statements/fix braces' 
position)
ERROR: suspect code indent for conditional statements (7, 11)
#251: FILE: net/tap-solaris.c:80:
+       while (*ptr && !qemu_isdigit((int)*ptr)) {
+           ptr++;

ERROR: suspect code indent for conditional statements (4, 7)
#259: FILE: net/tap-solaris.c:87:
+    if (ip_fd) {
        close(ip_fd);

ERROR: do not use assignment in if condition
#270: FILE: net/tap-solaris.c:108:
+    if ((ppa = ioctl(tap_fd, I_STR, &strioc_ppa)) < 0) {

ERROR: do not use assignment in if condition
#328: FILE: net/tap-solaris.c:170:
+    if ((arp_muxid = ioctl(ip_fd, link_type, arp_fd)) < 0) {

ERROR: suspect code indent for conditional statements (4, 6)
#340: FILE: net/tap-solaris.c:181:
+    if (ioctl(ip_fd, SIOCSLIFMUXID, &ifr) < 0) {
       ioctl(ip_fd, I_PUNLINK , arp_muxid);

total: 5 errors, 0 warnings, 381 lines checked

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

3/9 Checking commit 9dd5b80ec06d (net: Transfer // comments to /**/)
4/9 Checking commit a9b2502fcb92 (net: Transfer "foo* " to "foo *")
WARNING: line over 80 characters
#56: FILE: net/tap-win32.c:126:
+static tun_buffer_t *get_buffer_from_free_list(tap_win32_overlapped_t *const 
overlapped)

ERROR: line over 90 characters
#68: FILE: net/tap-win32.c:139:
+static void put_buffer_on_free_list(tap_win32_overlapped_t *const overlapped, 
tun_buffer_t *const buffer)

ERROR: line over 90 characters
#77: FILE: net/tap-win32.c:148:
+static tun_buffer_t *get_buffer_from_output_queue(tap_win32_overlapped_t 
*const overlapped, const int block)

ERROR: line over 90 characters
#89: FILE: net/tap-win32.c:180:
+static tun_buffer_t 
*get_buffer_from_output_queue_immediate(tap_win32_overlapped_t *const 
overlapped)

ERROR: line over 90 characters
#95: FILE: net/tap-win32.c:185:
+static void put_buffer_on_output_queue(tap_win32_overlapped_t *const 
overlapped, tun_buffer_t *const buffer)

ERROR: line over 90 characters
#104: FILE: net/tap-win32.c:412:
+static void tap_win32_overlapped_init(tap_win32_overlapped_t *const 
overlapped, const HANDLE handle)

total: 5 errors, 1 warnings, 115 lines checked

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

5/9 Checking commit c96ec8e7f974 (net: Fix lines over 90 characters)
WARNING: Block comments use a leading /* on a separate line
#34: FILE: net/socket.c:358:
+    /* fd passed: multicast: "learn" dgram_dst address from bound address

ERROR: line over 90 characters
#74: FILE: net/tap-win32.c:151:
+static tun_buffer_t *get_buffer_from_output_queue(tap_win32_overlapped_t 
*const overlapped,

WARNING: line over 80 characters
#139: FILE: net/tap-win32.c:560:
+                    fprintf(stderr, "Tap-Win32: Error GetOverlappedResult %d - 
%s\n",

total: 1 errors, 2 warnings, 123 lines checked

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

6/9 Checking commit 55fc567376cd (net: Transfer tabs to spcaes)
7/9 Checking commit e1c36e115c99 (net: Remove assignment in if condition)
8/9 Checking commit 3a9a235f5e6f (net: Remove initialization of static ints)
9/9 Checking commit a1e8031d967e (net: Fix the indent problems)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
20201222082340.67405-1-zhanghan64@huawei.com/testing.checkpatch/?type=message">http://patchew.org/logs/20201222082340.67405-1-zhanghan64@huawei.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]