Fix some style problems in net
Subsystems (2)
cover Fix some style problems in net
Some style problems in net directory are found by checkpatch.pl. Fix these style problems.
Zhang Han (9):
net: Add spaces around operator/delete redundant spaces
net: Add braces for statements/fix braces' position
net: transfer // comments to /**/
net: transfer "foo* bar" to "foo *"
net: fix lines over 90 characters
net: Transfer tabs to spcaes
net: remove assignment in if condition
net: Remove initialization of static ints
net: Fix the indent problems
net/checksum.c | 11 +- net/eth.c | 2 +- net/net.c | 26 +++-- net/queue.c | 5 +- net/slirp.c | 8 +- net/socket.c | 32 +++--- net/tap-bsd.c | 6 +- net/tap-linux.c | 20 ++-- net/tap-linux.h | 10 +- net/tap-solaris.c | 76 ++++++++------ net/tap-win32.c | 258 +++++++++++++++++++++++++--------------------- net/vde.c | 4 +- net/vhost-user.c | 2 +- 13 files changed, 259 insertions(+), 201 deletions(-)
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 1/9 net: Add spaces around operator/delete redundant spaces
Fix problems about spaces:
-operator needs spaces around it, add them.
-somespaces are redundant, remove them.
--- net/checksum.c | 4 +-- net/eth.c | 2 +- net/net.c | 2 +- net/queue.c | 2 +- net/socket.c | 12 +++---- net/tap-solaris.c | 42 +++++++++++----------- net/tap-win32.c | 90 +++++++++++++++++++++++------------------------ net/vde.c | 2 +- net/vhost-user.c | 2 +- 9 files changed, 79 insertions(+), 79 deletions(-)
net/checksum.c +2 -2
@@ -41,8 +41,8 @@ uint32_t net_checksum_add_cont(int len, uint8_t *buf, int seq)uint16_t net_checksum_finish (uint32_t sum) { -while (sum>>16 ) - sum = (sum &0xFFFF )+(sum >>16 ); +while (sum >>16 ) + sum = (sum &0xFFFF ) + (sum >>16 );return ~sum; }
net/eth.c +1 -1
@@ -334,7 +334,7 @@ eth_setup_ip4_fragmentation(const void *l2hdr, size_t l2hdr_len,assert (frag_offset %IP_FRAG_UNIT_SIZE ==0 );assert ((frag_off_units & ~IP_OFFMASK ) ==0 ); - orig_flags =be16_to_cpu (iphdr->ip_off) & ~(IP_OFFMASK |IP_MF ); + orig_flags =be16_to_cpu (iphdr->ip_off) & ~(IP_OFFMASK |IP_MF ); new_ip_off = frag_off_units | orig_flags | (more_frags ?IP_MF :0 ); iphdr->ip_off =cpu_to_be16 (new_ip_off); iphdr->ip_len =cpu_to_be16 (l3payload_len + l3hdr_len);
net/net.c +1 -1
@@ -179,7 +179,7 @@ static int qemu_macaddr_get_free(void)void qemu_macaddr_default_if_unset (MACAddr *macaddr) { -static const MACAddr zero = { .a = {0 ,0 ,0 ,0 ,0 ,0 } }; +static const MACAddr zero = { .a = {0 ,0 ,0 ,0 ,0 ,0 } };static const MACAddr base = { .a = {0x52 ,0x54 ,0x00 ,0x12 ,0x34 ,0 } };if (memcmp (macaddr, &zero,sizeof (zero)) !=0 ) {
net/queue.c +1 -1
@@ -57,7 +57,7 @@ struct NetQueue { QTAILQ_HEAD(, NetPacket) packets; - unsigned delivering : 1; + unsigned delivering:1; };NetQueue *qemu_new_net_queue (NetQueueDeliverFunc *deliver,void *opaque)
net/socket.c +6 -6
@@ -455,15 +455,15 @@ static NetSocketState *net_socket_fd_init(NetClientState *peer, int fd, int is_connected, const char *mc, Error **errp) { - int so_type = -1, optlen=sizeof(so_type); + int so_type = -1, optlen = sizeof(so_type); -if (getsockopt (fd,SOL_SOCKET ,SO_TYPE , (char *)&so_type, - (socklen_t *)&optlen)<0 ) { +if (getsockopt (fd,SOL_SOCKET ,SO_TYPE , (char *)&so_type, + (socklen_t *)&optlen) <0 ) {error_setg (errp,"can't get socket option SO_TYPE" );closesocket (fd);return NULL ; } -switch (so_type) { +switch (so_type) {case SOCK_DGRAM :return net_socket_fd_init_dgram (peer, model, name, fd, is_connected, mc, errp);
@@ -484,7 +484,7 @@ static void net_socket_accept(void *opaque)socklen_t len;int fd; -for (;;) { +for (;;) { len =sizeof (saddr); fd =qemu_accept (s->listen_fd, (struct sockaddr *)&saddr, &len);if (fd <0 && errno !=EINTR ) {
@@ -574,7 +574,7 @@ static int net_socket_connect_init(NetClientState *peer,qemu_set_nonblock (fd); connected =0 ; -for (;;) { +for (;;) { ret =connect (fd, (struct sockaddr *)&saddr,sizeof (saddr));if (ret <0 ) {if (errno ==EINTR || errno ==EWOULDBLOCK ) {
net/tap-solaris.c +21 -21
119 lines not on this page · raw message
net/tap-win32.c +45 -45
254 lines not on this page · raw message
net/vde.c +1 -1
@@ -92,7 +92,7 @@ static int net_vde_init(NetClientState *peer, const char *model, }; vde =vde_open (init_sock, (char *)"QEMU" , &args); -if (!vde){ +if (!vde) {error_setg_errno (errp, errno,"Could not open vde" );return -1 ; }
net/vhost-user.c +1 -1
@@ -235,7 +235,7 @@ static void chr_closed_bh(void *opaque) s =DO_UPCAST (NetVhostUserState, nc, ncs[0 ]); -for (i = queues -1 ; i >=0 ; i--) { +for (i = queues -1 ; i >=0 ; i--) { s =DO_UPCAST (NetVhostUserState, nc, ncs[i]);if (s->vhost_net) {
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 2/9 net: Add braces for statements/fix braces' position
In reply to Zhang HanFix problems about braces:
-braces are necessary for all arms of if/for/while statements -open brace { should follow if/for/while statements on the same line -else should follow close brace '}'
--- net/checksum.c | 3 ++- net/net.c | 24 ++++++++++++++++-------- net/queue.c | 3 ++- net/slirp.c | 6 ++++-- net/socket.c | 9 ++++++--- net/tap-bsd.c | 3 +-- net/tap-linux.c | 20 +++++++++++++------- net/tap-solaris.c | 37 ++++++++++++++++++++++++------------- net/tap-win32.c | 33 ++++++++++++++++----------------- 9 files changed, 84 insertions(+), 54 deletions(-)
net/checksum.c +2 -1
@@ -41,8 +41,9 @@ uint32_t net_checksum_add_cont(int len, uint8_t *buf, int seq)uint16_t net_checksum_finish (uint32_t sum) { -while (sum >>16 ) +while (sum >>16 ) { sum = (sum &0xFFFF ) + (sum >>16 ); + }return ~sum; }
net/net.c +16 -8
@@ -794,8 +794,9 @@ NetClientState *qemu_find_netdev(const char *id)NetClientState *nc; QTAILQ_FOREACH(nc, &net_clients, next) { -if (nc->info->type ==NET_CLIENT_DRIVER_NIC ) +if (nc->info->type ==NET_CLIENT_DRIVER_NIC ) {continue ; + }if (!strcmp (nc->name, id)) {return nc; }
@@ -829,9 +830,11 @@ static int nic_get_free_idx(void) {int index; -for (index =0 ; index <MAX_NICS ; index++) -if (!nd_table[index].used) +for (index =0 ; index <MAX_NICS ; index++) { +if (!nd_table[index].used) {return index; + } + }return -1 ; }
@@ -857,10 +860,12 @@ void qemu_check_nic_model(NICInfo *nd, const char *model) models[0 ] = model; models[1 ] =NULL ; -if (qemu_show_nic_models (nd->model, models)) +if (qemu_show_nic_models (nd->model, models)) {exit (0 ); -if (qemu_find_nic_model (nd, models, model) <0 ) + } +if (qemu_find_nic_model (nd, models, model) <0 ) {exit (1 ); + } } int qemu_find_nic_model(NICInfo *nd, const char * const *models,
@@ -868,12 +873,14 @@ int qemu_find_nic_model(NICInfo *nd, const char * const *models, {int i; -if (!nd->model) +if (!nd->model) { nd->model =g_strdup (default_model); + }for (i =0 ; models[i]; i++) { -if (strcmp (nd->model, models[i]) ==0 ) +if (strcmp (nd->model, models[i]) ==0 ) {return i; + } }error_report ("Unsupported NIC model: %s" , nd->model);
@@ -1219,8 +1226,9 @@ RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,/* only query information on queue 0 since the info is per nic, * not per queue */ -if (nc->queue_index !=0 ) +if (nc->queue_index !=0 ) {continue ; + }if (nc->info->query_rx_filter) { info = nc->info->query_rx_filter (nc);
net/queue.c +2 -1
@@ -250,8 +250,9 @@ void qemu_net_queue_purge(NetQueue *queue, NetClientState *from)bool qemu_net_queue_flush (NetQueue *queue) { -if (queue->delivering) +if (queue->delivering) {return false; + }while (!QTAILQ_EMPTY (&queue->packets)) {NetPacket *packet;
net/slirp.c +4 -2
@@ -53,13 +53,15 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)int len; p = *pp; p1 =strchr (p, sep); -if (!p1) +if (!p1) {return -1 ; + } len = p1 - p; p1++;if (buf_size >0 ) { -if (len > buf_size -1 ) +if (len > buf_size -1 ) { len = buf_size -1 ; + }memcpy (buf, p, len); buf[len] ='\0' ; }
net/socket.c +6 -3
@@ -165,8 +165,9 @@ static void net_socket_send(void *opaque) size =qemu_recv (s->fd, buf1,sizeof (buf1),0 );if (size <0 ) { -if (errno !=EWOULDBLOCK ) +if (errno !=EWOULDBLOCK ) { goto eoc; + } }else if (size ==0 ) {/* end of connection */ eoc:
@@ -199,8 +200,9 @@ static void net_socket_send_dgram(void *opaque)int size; size =qemu_recv (s->fd, s->rs.buf,sizeof (s->rs.buf),0 ); -if (size <0 ) +if (size <0 ) {return ; + }if (size ==0 ) {/* end of connection */ net_socket_read_poll (s, false);
@@ -301,8 +303,9 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr,qemu_set_nonblock (fd);return fd; fail: -if (fd >=0 ) +if (fd >=0 ) {closesocket (fd); + }return -1 ; }
net/tap-bsd.c +1 -2
@@ -68,8 +68,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,TFR (fd =open (dname,O_RDWR ));if (fd >=0 ) {break ; - } -else if (errno ==ENXIO || errno ==ENOENT ) { + }else if (errno ==ENXIO || errno ==ENOENT ) {break ; }if (*ifname) {
net/tap-linux.c +13 -7
@@ -97,10 +97,11 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, } } -if (ifname[0 ] !='\0' ) +if (ifname[0 ] !='\0' ) {pstrcpy (ifr.ifr_name,IFNAMSIZ , ifname); -else + }else {pstrcpy (ifr.ifr_name,IFNAMSIZ ,"tap%d" ); + } ret =ioctl (fd,TUNSETIFF , (void *) &ifr);if (ret !=0 ) {if (ifname[0 ] !='\0' ) {
@@ -167,8 +168,9 @@ int tap_probe_has_ufo(int fd) offload =TUN_F_CSUM |TUN_F_UFO ; -if (ioctl (fd,TUNSETOFFLOAD , offload) <0 ) +if (ioctl (fd,TUNSETOFFLOAD , offload) <0 ) {return 0 ; + }return 1 ; }
@@ -248,14 +250,18 @@ void tap_fd_set_offload(int fd, int csum, int tso4,if (csum) { offload |=TUN_F_CSUM ; -if (tso4) +if (tso4) { offload |=TUN_F_TSO4 ; -if (tso6) + } +if (tso6) { offload |=TUN_F_TSO6 ; -if ((tso4 || tso6) && ecn) + } +if ((tso4 || tso6) && ecn) { offload |=TUN_F_TSO_ECN ; -if (ufo) + } +if (ufo) { offload |=TUN_F_UFO ; + } }if (ioctl (fd,TUNSETOFFLOAD , offload) !=0 ) {
net/tap-solaris.c +24 -13
@@ -77,13 +77,16 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)if (*dev) { ptr = dev; -while (*ptr && !qemu_isdigit ((int )*ptr)) ptr++; +while (*ptr && !qemu_isdigit ((int )*ptr)) { + ptr++; + } ppa =atoi (ptr); }/* Check if IP device was opened */ -if (ip_fd) +if (ip_fd) {close (ip_fd); + }TFR (ip_fd =open ("/dev/udp" ,O_RDWR ,0 ));if (ip_fd <0 ) {
@@ -102,8 +105,9 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp) strioc_ppa.ic_timout =0 ; strioc_ppa.ic_len =sizeof (ppa); strioc_ppa.ic_dp = (char *)&ppa; -if ((ppa =ioctl (tap_fd,I_STR , &strioc_ppa)) <0 ) +if ((ppa =ioctl (tap_fd,I_STR , &strioc_ppa)) <0 ) {error_report ("Can't assign new interface" ); + }TFR (if_fd =open ("/dev/tap" ,O_RDWR ,0 ));if (if_fd <0 ) {
@@ -115,8 +119,9 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)return -1 ; } -if (ioctl (if_fd,SIOCGLIFFLAGS , &ifr) <0 ) +if (ioctl (if_fd,SIOCGLIFFLAGS , &ifr) <0 ) {error_report ("Can't get flags" ); + }snprintf (actual_name,32 ,"tap%d" , ppa);pstrcpy (ifr.lifr_name,sizeof (ifr.lifr_name), actual_name);
@@ -124,23 +129,29 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp) ifr.lifr_ppa = ppa;/* Assign ppa according to the unit number returned by tun device */ -if (ioctl (if_fd,SIOCSLIFNAME , &ifr) <0 ) +if (ioctl (if_fd,SIOCSLIFNAME , &ifr) <0 ) {error_report ("Can't set PPA %d" , ppa); -if (ioctl (if_fd,SIOCGLIFFLAGS , &ifr) <0 ) + } +if (ioctl (if_fd,SIOCGLIFFLAGS , &ifr) <0 ) {error_report ("Can't get flags" ); + }/* Push arp module to if_fd */ -if (ioctl (if_fd,I_PUSH ,"arp" ) <0 ) +if (ioctl (if_fd,I_PUSH ,"arp" ) <0 ) {error_report ("Can't push ARP module (2)" ); + }/* Push arp module to ip_fd */ -if (ioctl (ip_fd,I_POP ,NULL ) <0 ) +if (ioctl (ip_fd,I_POP ,NULL ) <0 ) {error_report ("I_POP failed" ); -if (ioctl (ip_fd,I_PUSH ,"arp" ) <0 ) + } +if (ioctl (ip_fd,I_PUSH ,"arp" ) <0 ) {error_report ("Can't push ARP module (3)" ); + }/* Open arp_fd */ TFR (arp_fd =open ("/dev/tap" ,O_RDWR ,0 )); -if (arp_fd <0 ) +if (arp_fd <0 ) {error_report ("Can't open %s" ,"/dev/tap" ); + }/* Set ifname to arp */ strioc_if.ic_cmd =SIOCSLIFNAME ;
@@ -156,8 +167,9 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)return -1 ; } -if ((arp_muxid =ioctl (ip_fd, link_type, arp_fd)) <0 ) +if ((arp_muxid =ioctl (ip_fd, link_type, arp_fd)) <0 ) {error_report ("Can't link TAP device to ARP" ); + }close (if_fd);
@@ -166,8 +178,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp) ifr.lifr_ip_muxid = ip_muxid; ifr.lifr_arp_muxid = arp_muxid; -if (ioctl (ip_fd,SIOCSLIFMUXID , &ifr) <0 ) - { +if (ioctl (ip_fd,SIOCSLIFMUXID , &ifr) <0 ) {ioctl (ip_fd,I_PUNLINK , arp_muxid);ioctl (ip_fd,I_PUNLINK , ip_muxid);error_report ("Can't set multiplexor id" );
net/tap-win32.c +16 -17
@@ -70,7 +70,6 @@#define USERMODEDEVICEDIR "\\\\.\\Global\\"#define TAPSUFFIX ".tap" -//====================== // Compile time configuration //======================
@@ -146,8 +145,7 @@ static tun_buffer_t* get_buffer_from_output_queue(tap_win32_overlapped_t* const// Non-blocking call result =WaitForSingleObject (overlapped->output_queue_semaphore, timeout); -switch (result) - { +switch (result) {// The semaphore object was signaled. case WAIT_OBJECT_0 :EnterCriticalSection (&overlapped->output_queue_cs);
@@ -233,9 +231,9 @@ static int is_tap_win32_dev(const char *guid)NULL , NULL); -if (status ==ERROR_NO_MORE_ITEMS ) +if (status ==ERROR_NO_MORE_ITEMS ) {break ; -else if (status !=ERROR_SUCCESS ) { + }else if (status !=ERROR_SUCCESS ) {return FALSE; }
@@ -312,8 +310,7 @@ static int get_device_guid(return -1 ; } -while (!stop) - { +while (!stop) {char enum_name[256 ];char connection_string[256 ];HKEY connection_key;
@@ -332,9 +329,9 @@ static int get_device_guid(NULL , NULL); -if (status ==ERROR_NO_MORE_ITEMS ) +if (status ==ERROR_NO_MORE_ITEMS ) {break ; -else if (status !=ERROR_SUCCESS ) { + }else if (status !=ERROR_SUCCESS ) {return -1 ; }
@@ -363,8 +360,7 @@ static int get_device_guid(if (status !=ERROR_SUCCESS || name_type !=REG_SZ ) { ++i;continue ; - } -else { + }else {if (is_tap_win32_dev (enum_name)) {snprintf (name, name_size,"%s" , enum_name);if (actual_name) {
@@ -374,8 +370,7 @@ static int get_device_guid( ++i;continue ; } - } -else { + }else {snprintf (actual_name, actual_name_size,"%s" , name_data); } }
@@ -390,8 +385,9 @@ static int get_device_guid(RegCloseKey (control_net_key); -if (stop ==0 ) +if (stop ==0 ) {return -1 ; + }return 0 ; }
@@ -455,8 +451,9 @@ static void tap_win32_overlapped_init(tap_win32_overlapped_t* const overlapped, }/* To count buffers, initially no-signal. */ overlapped->tap_semaphore =CreateSemaphore (NULL ,0 ,TUN_MAX_BUFFER_COUNT ,NULL ); -if (!overlapped->tap_semaphore) +if (!overlapped->tap_semaphore) {fprintf (stderr,"error creating tap_semaphore.\n" ); + } } static int tap_win32_write(tap_win32_overlapped_t *overlapped,
@@ -470,8 +467,9 @@ static int tap_win32_write(tap_win32_overlapped_t *overlapped, result =GetOverlappedResult (overlapped->handle, &overlapped->write_overlapped, &write_size, FALSE); -if (!result &&GetLastError () ==ERROR_IO_INCOMPLETE ) +if (!result &&GetLastError () ==ERROR_IO_INCOMPLETE ) {WaitForSingleObject (overlapped->write_event,INFINITE ); + }#endif result = WriteFile(overlapped->handle, buffer, size,
@@ -614,8 +612,9 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle, } rc =get_device_guid (device_guid,sizeof (device_guid), name_buffer,sizeof (name_buffer)); -if (rc) +if (rc) {return -1 ; + } snprintf(device_path, sizeof(device_path), "%s%s%s", USERMODEDEVICEDIR,
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 3/9 net: Transfer // comments to /**/
In reply to Zhang HanDo not use C99 // comments, thransfer // to /**/
--- net/checksum.c | 6 ++--- net/tap-solaris.c | 2 +- net/tap-win32.c | 60 +++++++++++++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 30 deletions(-)
net/checksum.c +3 -3
@@ -52,9 +52,9 @@ uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto, {uint32_t sum =0 ; - sum +=net_checksum_add (length, buf);// payload - sum +=net_checksum_add (8 , addrs);// src + dst address - sum += proto + length;// protocol & length + sum +=net_checksum_add (length, buf);/* payload */ + sum +=net_checksum_add (8 , addrs);/* src + dst address */ + sum += proto + length;/* protocol & length */ return net_checksum_finish (sum); }
net/tap-solaris.c +1 -1
@@ -35,7 +35,7 @@#include <netinet/in.h> #include <netinet/in_systm.h> #include <netinet/ip.h> -#include <netinet/ip_icmp.h> // must come after ip.h +#include <netinet/ip_icmp.h> /* must come after ip.h */ #include <netinet/udp.h> #include <netinet/tcp.h> #include <net/if.h>
net/tap-win32.c +34 -26
116 lines not on this page · raw message
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 4/9 net: Transfer "foo* " to "foo *"
In reply to Zhang HanFix style problems about "foo*"
-"foo* bar" should be "foo *bar".
-"foo* const bar" should be "foo * const bar".
-"(foo*)" should be "(foo *)"
--- net/slirp.c | 2 +- net/tap-win32.c | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-)
net/slirp.c +1 -1
@@ -809,7 +809,7 @@ static void slirp_smb_cleanup(SlirpState *s) } } -static int slirp_smb (SlirpState * s,const char *exported_dir, +static int slirp_smb (SlirpState *s,const char *exported_dir,struct in_addr vserver_addr,Error **errp) {char *smb_conf;
net/tap-win32.c +17 -17
@@ -101,7 +101,7 @@typedef struct tun_buffer_s {unsigned char buffer[TUN_BUFFER_SIZE ];unsigned long read_size; -struct tun_buffer_s * next; +struct tun_buffer_s *next; }tun_buffer_t ; typedef struct tap_win32_overlapped {
@@ -116,16 +116,16 @@ typedef struct tap_win32_overlapped {OVERLAPPED read_overlapped;OVERLAPPED write_overlapped;tun_buffer_t buffers[TUN_MAX_BUFFER_COUNT ]; -tun_buffer_t * free_list; -tun_buffer_t * output_queue_front; -tun_buffer_t * output_queue_back; +tun_buffer_t *free_list; +tun_buffer_t *output_queue_front; +tun_buffer_t *output_queue_back; } tap_win32_overlapped_t;static tap_win32_overlapped_t tap_overlapped; -static tun_buffer_t *get_buffer_from_free_list (tap_win32_overlapped_t *const overlapped) +static tun_buffer_t *get_buffer_from_free_list (tap_win32_overlapped_t *const overlapped) { -tun_buffer_t * buffer =NULL ; +tun_buffer_t *buffer =NULL ;WaitForSingleObject (overlapped->free_list_semaphore,INFINITE );EnterCriticalSection (&overlapped->free_list_cs); buffer = overlapped->free_list;
@@ -136,7 +136,7 @@ static tun_buffer_t* get_buffer_from_free_list(tap_win32_overlapped_t* const overeturn buffer; } -static void put_buffer_on_free_list (tap_win32_overlapped_t *const overlapped,tun_buffer_t *const buffer) +static void put_buffer_on_free_list (tap_win32_overlapped_t *const overlapped,tun_buffer_t *const buffer) {EnterCriticalSection (&overlapped->free_list_cs); buffer->next = overlapped->free_list;
@@ -145,9 +145,9 @@ static void put_buffer_on_free_list(tap_win32_overlapped_t* const overlapped, tuReleaseSemaphore (overlapped->free_list_semaphore,1 ,NULL ); } -static tun_buffer_t *get_buffer_from_output_queue (tap_win32_overlapped_t *const overlapped,const int block) +static tun_buffer_t *get_buffer_from_output_queue (tap_win32_overlapped_t *const overlapped,const int block) { -tun_buffer_t * buffer =NULL ; +tun_buffer_t *buffer =NULL ;DWORD result, timeout = block ?INFINITE :0L ;/* Non-blocking call */
@@ -177,12 +177,12 @@ static tun_buffer_t* get_buffer_from_output_queue(tap_win32_overlapped_t* constreturn buffer; } -static tun_buffer_t *get_buffer_from_output_queue_immediate (tap_win32_overlapped_t *const overlapped) +static tun_buffer_t *get_buffer_from_output_queue_immediate (tap_win32_overlapped_t *const overlapped) {return get_buffer_from_output_queue (overlapped,0 ); } -static void put_buffer_on_output_queue (tap_win32_overlapped_t *const overlapped,tun_buffer_t *const buffer) +static void put_buffer_on_output_queue (tap_win32_overlapped_t *const overlapped,tun_buffer_t *const buffer) {EnterCriticalSection (&overlapped->output_queue_cs);
@@ -409,7 +409,7 @@ static int tap_win32_set_status(HANDLE handle, int status) &status, sizeof(status), &len, NULL); } -static void tap_win32_overlapped_init (tap_win32_overlapped_t *const overlapped,const HANDLE handle) +static void tap_win32_overlapped_init (tap_win32_overlapped_t *const overlapped,const HANDLE handle) { overlapped->handle = handle;
@@ -452,7 +452,7 @@ static void tap_win32_overlapped_init(tap_win32_overlapped_t* const overlapped, {unsigned index;for (index =0 ; index <TUN_MAX_BUFFER_COUNT ; index++) { -tun_buffer_t * element = &overlapped->buffers[index]; +tun_buffer_t *element = &overlapped->buffers[index]; element->next = overlapped->free_list; overlapped->free_list = element; }
@@ -520,11 +520,11 @@ static int tap_win32_write(tap_win32_overlapped_t *overlapped, static DWORD WINAPI tap_win32_thread_entry(LPVOID param) { -tap_win32_overlapped_t *overlapped = (tap_win32_overlapped_t *)param; +tap_win32_overlapped_t *overlapped = (tap_win32_overlapped_t *)param;unsigned long read_size;BOOL result;DWORD dwError; -tun_buffer_t * buffer =get_buffer_from_free_list (overlapped); +tun_buffer_t *buffer =get_buffer_from_free_list (overlapped);for (;;) {
@@ -578,7 +578,7 @@ static int tap_win32_read(tap_win32_overlapped_t *overlapped, {int size =0 ; -tun_buffer_t * buffer =get_buffer_from_output_queue_immediate (overlapped); +tun_buffer_t *buffer =get_buffer_from_output_queue_immediate (overlapped);if (buffer !=NULL ) { *pbuf = buffer->buffer;
@@ -594,7 +594,7 @@ static int tap_win32_read(tap_win32_overlapped_t *overlapped,static void tap_win32_free_buffer (tap_win32_overlapped_t *overlapped,uint8_t *pbuf) { -tun_buffer_t * buffer = (tun_buffer_t *)pbuf; +tun_buffer_t *buffer = (tun_buffer_t *)pbuf;put_buffer_on_free_list (overlapped, buffer); }
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 5/9 net: Fix lines over 90 characters
In reply to Zhang HanFix the line width of code.
--- net/socket.c | 11 +++++++---- net/tap-win32.c | 39 ++++++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 17 deletions(-)
net/socket.c +7 -4
@@ -113,7 +113,9 @@ static ssize_t net_socket_receive(NetClientState *nc, const uint8_t *buf, size_treturn size; } -static ssize_t net_socket_receive_dgram (NetClientState *nc,const uint8_t *buf,size_t size) +static ssize_t net_socket_receive_dgram (NetClientState *nc, +const uint8_t *buf, +size_t size) {NetSocketState *s =DO_UPCAST (NetSocketState, nc, nc);ssize_t ret;
@@ -353,9 +355,10 @@ static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer, sa_type = sa->type;qapi_free_SocketAddress (sa); -/* fd passed: multicast: "learn" dgram_dst address from bound address and save it -* Because this may be "shared" socket from a "master" process, datagrams would be recv() -* by ONLY ONE process: we must "clone" this dgram socket --jjo +/* fd passed: multicast: "learn" dgram_dst address from bound address +* and save it. Because this may be "shared" socket from a "master" process, +* datagrams would be recv() by ONLY ONE process: we must "clone" +* this dgram socket --jjo */ if (is_connected && mcast !=NULL ) {
net/tap-win32.c +26 -13
@@ -63,9 +63,11 @@* ================= */ -#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" +#define ADAPTER_KEY \ + "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" -#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" +#define NETWORK_CONNECTIONS_KEY \ + "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"/* * ======================
@@ -136,7 +138,8 @@ static tun_buffer_t *get_buffer_from_free_list(tap_win32_overlapped_t *const overeturn buffer; } -static void put_buffer_on_free_list (tap_win32_overlapped_t *const overlapped,tun_buffer_t *const buffer) +static void put_buffer_on_free_list (tap_win32_overlapped_t *const overlapped, +tun_buffer_t *const buffer) {EnterCriticalSection (&overlapped->free_list_cs); buffer->next = overlapped->free_list;
@@ -145,7 +148,8 @@ static void put_buffer_on_free_list(tap_win32_overlapped_t *const overlapped, tuReleaseSemaphore (overlapped->free_list_semaphore,1 ,NULL ); } -static tun_buffer_t *get_buffer_from_output_queue (tap_win32_overlapped_t *const overlapped,const int block) +static tun_buffer_t *get_buffer_from_output_queue (tap_win32_overlapped_t *const overlapped, +const int block) {tun_buffer_t *buffer =NULL ;DWORD result, timeout = block ?INFINITE :0L ;
@@ -182,7 +186,8 @@ static tun_buffer_t *get_buffer_from_output_queue_immediate(tap_win32_overlappedreturn get_buffer_from_output_queue (overlapped,0 ); } -static void put_buffer_on_output_queue (tap_win32_overlapped_t *const overlapped,tun_buffer_t *const buffer) +static void put_buffer_on_output_queue (tap_win32_overlapped_t *const overlapped, +tun_buffer_t *const buffer) {EnterCriticalSection (&overlapped->output_queue_cs);
@@ -194,7 +199,7 @@ static void put_buffer_on_output_queue(tap_win32_overlapped_t *const overlapped, overlapped->output_queue_back = buffer; } -LeaveCriticalSection (&overlapped->output_queue_cs); +LeaveCriticalSection (&overlapped->ou412tput_queue_cs);ReleaseSemaphore (overlapped->output_queue_semaphore,1 ,NULL ); }
@@ -409,7 +414,8 @@ static int tap_win32_set_status(HANDLE handle, int status) &status, sizeof(status), &len, NULL); } -static void tap_win32_overlapped_init (tap_win32_overlapped_t *const overlapped,const HANDLE handle) +static void tap_win32_overlapped_init (tap_win32_overlapped_t *const overlapped, +const HANDLE handle) { overlapped->handle = handle;
@@ -447,7 +453,9 @@ static void tap_win32_overlapped_init(tap_win32_overlapped_t *const overlapped,fprintf (stderr,"error creating free list semaphore!\n" ); } - overlapped->free_list = overlapped->output_queue_front = overlapped->output_queue_back =NULL ; + overlapped->free_list = overlapped->output_queue_front = + overlapped->output_queue_back = +NULL ; {unsigned index;
@@ -537,16 +545,20 @@ static DWORD WINAPI tap_win32_thread_entry(LPVOID param) dwError =GetLastError ();if (dwError ==ERROR_IO_PENDING ) {WaitForSingleObject (overlapped->read_event,INFINITE ); - result =GetOverlappedResult (overlapped->handle, &overlapped->read_overlapped, + result =GetOverlappedResult (overlapped->handle, + &overlapped->read_overlapped, &read_size, FALSE);if (!result) {#ifdef DEBUG_TAP_WIN32 LPVOID lpBuffer; dwError =GetLastError (); -FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |FORMAT_MESSAGE_FROM_SYSTEM , -NULL , dwError,MAKELANGID (LANG_NEUTRAL ,SUBLANG_DEFAULT ), +FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | +FORMAT_MESSAGE_FROM_SYSTEM , +NULL , dwError, +MAKELANGID (LANG_NEUTRAL ,SUBLANG_DEFAULT ), (LPTSTR ) &lpBuffer,0 ,NULL ); -fprintf (stderr,"Tap-Win32: Error GetOverlappedResult %d - %s\n" , dwError, lpBuffer); +fprintf (stderr,"Tap-Win32: Error GetOverlappedResult %d - %s\n" , + dwError, lpBuffer);LocalFree (lpBuffer);#endif }
@@ -619,7 +631,8 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,snprintf (name_buffer,sizeof (name_buffer),"%s" , preferred_name); } - rc =get_device_guid (device_guid,sizeof (device_guid), name_buffer,sizeof (name_buffer)); + rc =get_device_guid (device_guid,sizeof (device_guid), + name_buffer,sizeof (name_buffer));if (rc) {return -1 ; }
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 6/9 net: Transfer tabs to spcaes
In reply to Zhang HanCode indent use spaces instead of tabs.
--- net/tap-linux.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/tap-linux.h +5 -5
@@ -44,10 +44,10 @@#define IFF_DETACH_QUEUE 0x0400/* Features for GSO (TUNSETOFFLOAD). */ -#define TUN_F_CSUM 0x01/* You can hand me unchecksummed packets. */ -#define TUN_F_TSO4 0x02/* I can handle TSO for IPv4 packets */ -#define TUN_F_TSO6 0x04/* I can handle TSO for IPv6 packets */ -#define TUN_F_TSO_ECN 0x08/* I can handle TSO with ECN bits. */ -#define TUN_F_UFO 0x10/* I can handle UFO packets */ +#define TUN_F_CSUM 0x01/* You can hand me unchecksummed packets. */ +#define TUN_F_TSO4 0x02/* I can handle TSO for IPv4 packets */ +#define TUN_F_TSO6 0x04/* I can handle TSO for IPv6 packets */ +#define TUN_F_TSO_ECN 0x08/* I can handle TSO with ECN bits. */ +#define TUN_F_UFO 0x10/* I can handle UFO packets */ #endif /* QEMU_TAP_LINUX_H */
Signature · 1 line
2.29.1.59.gf9b6481aed
Re: [PATCH 6/9] net: Transfer tabs to spcaes
Quoted 6 lines · Zhang Han
Code indent use spaces instead of tabs.
Signed-off-by Zhang Han <[email protected]>--- net/tap-linux.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
FWIW typo "spaces" in subject (no need to repost).
PATCH 7/9 net: Remove assignment in if condition
In reply to Zhang HanPut the assignment before the if condition
--- net/tap-bsd.c | 3 ++- net/tap-solaris.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-)
net/tap-bsd.c +2 -1
@@ -176,7 +176,8 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,if (fd <0 ) {/* Tap device not specified or does not exist. */ -if ((fd =tap_open_clone (ifname, ifname_size, errp)) <0 ) { + fd =tap_open_clone (ifname, ifname_size, errp); +if (fd <0 ) {return -1 ; } }
net/tap-solaris.c +6 -3
@@ -105,7 +105,8 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp) strioc_ppa.ic_timout =0 ; strioc_ppa.ic_len =sizeof (ppa); strioc_ppa.ic_dp = (char *)&ppa; -if ((ppa =ioctl (tap_fd,I_STR , &strioc_ppa)) <0 ) { + ppa = ioctl(tap_fd, I_STR, &strioc_ppa)); +if (ppa <0 ) {error_report ("Can't assign new interface" ); }
@@ -162,12 +163,14 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)error_report ("Can't set ifname to arp" ); } -if ((ip_muxid =ioctl (ip_fd,I_LINK , if_fd)) <0 ) { + ip_muxid =ioctl (ip_fd,I_LINK , if_fd); +if (ip_muxid <0 ) {error_setg (errp,"Can't link TAP device to IP" );return -1 ; } -if ((arp_muxid =ioctl (ip_fd, link_type, arp_fd)) <0 ) { + arp_muxid =ioctl (ip_fd, link_type, arp_fd); +if (arp_muxid <0 ) {error_report ("Can't link TAP device to ARP" ); }
Signature · 1 line
2.29.1.59.gf9b6481aed
Re: [PATCH 7/9] net: Remove assignment in if condition
Quoted 7 lines · Zhang Han
Put the assignment before the if condition
Signed-off-by Zhang Han <[email protected]>--- net/tap-bsd.c | 3 ++- net/tap-solaris.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-)
PATCH 8/9 net: Remove initialization of static ints
In reply to Zhang HanDo not initialise statics to 0 or NULL
--- net/tap-solaris.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/tap-solaris.c +2 -2
@@ -63,10 +63,10 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)/* FIXME leaks like a sieve on error paths */ /* FIXME suspicious: many errors are reported, then ignored */ int tap_fd, if_fd, ppa =-1 ; -static int ip_fd =0 ; +static int ip_fd;char *ptr; -static int arp_fd =0 ; +static int arp_fd;int ip_muxid, arp_muxid;struct strioctl strioc_if, strioc_ppa;int link_type =I_PLINK ;
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 9/9 net: Fix the indent problems
In reply to Zhang HanFix Suspect code indent for statements
--- net/tap-solaris.c | 18 +++++++++--------- net/tap-win32.c | 28 ++++++++++++++-------------- net/vde.c | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-)
net/tap-solaris.c +9 -9
@@ -76,16 +76,16 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)memset (&ifr,0x0 ,sizeof (ifr));if (*dev) { - ptr = dev; -while (*ptr && !qemu_isdigit ((int )*ptr)) { - ptr++; - } - ppa =atoi (ptr); + ptr = dev; +while (*ptr && !qemu_isdigit ((int )*ptr)) { + ptr++; + } + ppa =atoi (ptr); }/* Check if IP device was opened */ if (ip_fd) { -close (ip_fd); +close (ip_fd); }TFR (ip_fd =open ("/dev/udp" ,O_RDWR ,0 ));
@@ -182,9 +182,9 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp) ifr.lifr_arp_muxid = arp_muxid;if (ioctl (ip_fd,SIOCSLIFMUXID , &ifr) <0 ) { -ioctl (ip_fd,I_PUNLINK , arp_muxid); -ioctl (ip_fd,I_PUNLINK , ip_muxid); -error_report ("Can't set multiplexor id" ); +ioctl (ip_fd,I_PUNLINK , arp_muxid); +ioctl (ip_fd,I_PUNLINK , ip_muxid); +error_report ("Can't set multiplexor id" ); }snprintf (dev, dev_size,"tap%d" , ppa);
net/tap-win32.c +14 -14
@@ -158,24 +158,24 @@ static tun_buffer_t *get_buffer_from_output_queue(tap_win32_overlapped_t *const result =WaitForSingleObject (overlapped->output_queue_semaphore, timeout);switch (result) { -/* The semaphore object was signaled. */ -case WAIT_OBJECT_0 : -EnterCriticalSection (&overlapped->output_queue_cs); +/* The semaphore object was signaled. */ +case WAIT_OBJECT_0 : +EnterCriticalSection (&overlapped->output_queue_cs); - buffer = overlapped->output_queue_front; - overlapped->output_queue_front = buffer->next; + buffer = overlapped->output_queue_front; + overlapped->output_queue_front = buffer->next; -if (overlapped->output_queue_front ==NULL ) { - overlapped->output_queue_back =NULL ; - } +if (overlapped->output_queue_front ==NULL ) { + overlapped->output_queue_back =NULL ; + } -LeaveCriticalSection (&overlapped->output_queue_cs); -break ; +LeaveCriticalSection (&overlapped->output_queue_cs); +break ; -/* Semaphore was nonsignaled, so a time-out occurred. */ -case WAIT_TIMEOUT : -/* Cannot open another window. */ -break ; +/* Semaphore was nonsignaled, so a time-out occurred. */ +case WAIT_TIMEOUT : +/* Cannot open another window. */ +break ; }return buffer;
net/vde.c +1 -1
@@ -55,7 +55,7 @@ static ssize_t vde_receive(NetClientState *nc, const uint8_t *buf, size_t size)ssize_t ret;do { - ret =vde_send (s->vde, (const char *)buf, size,0 ); + ret =vde_send (s->vde, (const char *)buf, size,0 ); }while (ret <0 && errno ==EINTR );return ret;
Signature · 1 line
2.29.1.59.gf9b6481aed
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
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/[email protected] -> patchew/[email protected]
* [new tag] patchew/[email protected] -> patchew/[email protected]
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
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]
ping?
This patch set is submmitted a month ago, and have received no replies. Did I miss any replies?
The link follows:
http://patchwork.ozlabs.org/project/qemu-devel/cover/[email protected]/
ping?This patch set about code style problem in net receives no replies.
Did I miss any response?
The link follows:
http://patchwork.ozlabs.org/project/qemu-devel/cover/[email protected]/