From nobody Tue Feb 10 02:43:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1608656083; cv=none; d=zohomail.com; s=zohoarc; b=SVw5qxP5ibTmDZ5mbSlrBWs4i492Weit7TxUoC8w5yHNy2y7dPDGPwOgBmSF1AnHEBNXlqSW7bBmWmKHWrSnB+ZihhTv7g5YRbLXvdLfBalD/yo/y4yxRWYDb+i9DkOCNRnWWYv4/2i4B4EcHel3BWwwQuVlOz24qtrA1M5BShA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608656083; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TwUnha0HGnmEmqF7nicuF85CdPLcPOE5V3zUeR5PnN0=; b=TxsMa61u2G4eFx4PPRoXH/1j0Z1n7TFYVMsAsVS5Qln95hxckfpM1jNBvbXQ/MqIoVjvQ2pKV2coCHM0Zt4CvZqUGXW+OC4rEBA2+S3dMcvhxQLnc2BFKgibJ79kohweDnpQcYXWGtMOZvLF1uGZvLbKNr6CUHPlVIOdJwgo+To= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1608656083205180.98908832642758; Tue, 22 Dec 2020 08:54:43 -0800 (PST) Received: from localhost ([::1]:48292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kriG4-00019k-AD for importer@patchew.org; Tue, 22 Dec 2020 09:03:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krdBX-0001kM-Jb; Tue, 22 Dec 2020 03:38:23 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:2619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krdBS-0002cY-1z; Tue, 22 Dec 2020 03:38:23 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4D0V7y50Lmz7JYl; Tue, 22 Dec 2020 16:37:18 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Tue, 22 Dec 2020 16:37:52 +0800 From: Zhang Han To: Subject: [PATCH 3/9] net: Transfer // comments to /**/ Date: Tue, 22 Dec 2020 16:23:34 +0800 Message-ID: <20201222082340.67405-4-zhanghan64@huawei.com> X-Mailer: git-send-email 2.29.1.59.gf9b6481aed In-Reply-To: <20201222082340.67405-1-zhanghan64@huawei.com> References: <20201222082340.67405-1-zhanghan64@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.35; envelope-from=zhanghan64@huawei.com; helo=szxga07-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 22 Dec 2020 08:55:42 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, hunongda@huawei.com, qemu-trivial@nongnu.org, hang.zhanghailiang@huawei.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Do not use C99 // comments, thransfer // to /**/ Signed-off-by: Zhang Han --- net/checksum.c | 6 ++--- net/tap-solaris.c | 2 +- net/tap-win32.c | 60 +++++++++++++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/net/checksum.c b/net/checksum.c index b78bf15098..eb2eff5fa4 100644 --- a/net/checksum.c +++ b/net/checksum.c @@ -52,9 +52,9 @@ uint16_t net_checksum_tcpudp(uint16_t length, uint16_t pr= oto, { uint32_t sum =3D 0; =20 - sum +=3D net_checksum_add(length, buf); // payload - sum +=3D net_checksum_add(8, addrs); // src + dst address - sum +=3D proto + length; // protocol & length + sum +=3D net_checksum_add(length, buf); /* payload */ + sum +=3D net_checksum_add(8, addrs); /* src + dst address */ + sum +=3D proto + length; /* protocol & length */ return net_checksum_finish(sum); } =20 diff --git a/net/tap-solaris.c b/net/tap-solaris.c index 1c8d5f7982..a0a5456ab6 100644 --- a/net/tap-solaris.c +++ b/net/tap-solaris.c @@ -35,7 +35,7 @@ #include #include #include -#include // must come after ip.h +#include /* must come after ip.h */ #include #include #include diff --git a/net/tap-win32.c b/net/tap-win32.c index 0a5252ab55..0f0d95cdbb 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -38,9 +38,11 @@ #include #include =20 -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -// TAP IOCTLs -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +/* + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * TAP IOCTLs + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + */ =20 #define TAP_CONTROL_CODE(request, method) \ CTL_CODE(FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) @@ -55,26 +57,32 @@ #define TAP_IOCTL_GET_LOG_LINE TAP_CONTROL_CODE(8, METHOD_BUFFERE= D) #define TAP_IOCTL_CONFIG_DHCP_SET_OPT TAP_CONTROL_CODE(9, METHOD_BUFFERE= D) =20 -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -// Registry keys -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +/* + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * Registry keys + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + */ =20 #define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-= E325-11CE-BFC1-08002BE10318}" =20 #define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Netwo= rk\\{4D36E972-E325-11CE-BFC1-08002BE10318}" =20 -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -// Filesystem prefixes -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +/* + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * Filesystem prefixes + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + */ =20 #define USERMODEDEVICEDIR "\\\\.\\Global\\" #define TAPSUFFIX ".tap" =20 -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -// Compile time configuration -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +/* + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + * Compile time configuration + * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + */ =20 -//#define DEBUG_TAP_WIN32 +/* #define DEBUG_TAP_WIN32 */ =20 /* FIXME: The asynch write path appears to be broken at * present. WriteFile() ignores the lpNumberOfBytesWritten parameter @@ -121,7 +129,7 @@ static tun_buffer_t* get_buffer_from_free_list(tap_win3= 2_overlapped_t* const ove WaitForSingleObject(overlapped->free_list_semaphore, INFINITE); EnterCriticalSection(&overlapped->free_list_cs); buffer =3D overlapped->free_list; -// assert(buffer !=3D NULL); + /* assert(buffer !=3D NULL); */ overlapped->free_list =3D buffer->next; LeaveCriticalSection(&overlapped->free_list_cs); buffer->next =3D NULL; @@ -142,11 +150,11 @@ static tun_buffer_t* get_buffer_from_output_queue(tap= _win32_overlapped_t* const tun_buffer_t* buffer =3D NULL; DWORD result, timeout =3D block ? INFINITE : 0L; =20 - // Non-blocking call + /* Non-blocking call */ result =3D WaitForSingleObject(overlapped->output_queue_semaphore, tim= eout); =20 switch (result) { - // The semaphore object was signaled. + /* The semaphore object was signaled. */ case WAIT_OBJECT_0: EnterCriticalSection(&overlapped->output_queue_cs); =20 @@ -160,9 +168,9 @@ static tun_buffer_t* get_buffer_from_output_queue(tap_w= in32_overlapped_t* const LeaveCriticalSection(&overlapped->output_queue_cs); break; =20 - // Semaphore was nonsignaled, so a time-out occurred. + /* Semaphore was nonsignaled, so a time-out occurred. */ case WAIT_TIMEOUT: - // Cannot open another window. + /* Cannot open another window. */ break; } =20 @@ -420,20 +428,20 @@ static void tap_win32_overlapped_init(tap_win32_overl= apped_t* const overlapped, InitializeCriticalSection(&overlapped->free_list_cs); =20 overlapped->output_queue_semaphore =3D CreateSemaphore( - NULL, // default security attributes - 0, // initial count - TUN_MAX_BUFFER_COUNT, // maximum count - NULL); // unnamed semaphore + NULL, /* default security attributes */ + 0, /* initial count */ + TUN_MAX_BUFFER_COUNT, /* maximum count */ + NULL); /* unnamed semaphore */ =20 if (!overlapped->output_queue_semaphore) { fprintf(stderr, "error creating output queue semaphore!\n"); } =20 overlapped->free_list_semaphore =3D CreateSemaphore( - NULL, // default security attributes - TUN_MAX_BUFFER_COUNT, // initial count - TUN_MAX_BUFFER_COUNT, // maximum count - NULL); // unnamed semaphore + NULL, /* default security attributes */ + TUN_MAX_BUFFER_COUNT, /* initial count */ + TUN_MAX_BUFFER_COUNT, /* maximum count */ + NULL); /* unnamed semaphore */ =20 if (!overlapped->free_list_semaphore) { fprintf(stderr, "error creating free list semaphore!\n"); --=20 2.29.1.59.gf9b6481aed