From patchwork Wed Jun 28 15:27:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 13295926 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 234AFEB64DA for ; Wed, 28 Jun 2023 15:29:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEX5I-0003IT-At; Wed, 28 Jun 2023 11:27:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEX59-0003H5-LC for qemu-devel@nongnu.org; Wed, 28 Jun 2023 11:27:48 -0400 Received: from bg4.exmail.qq.com ([43.155.67.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEX57-0004yu-7R for qemu-devel@nongnu.org; Wed, 28 Jun 2023 11:27:47 -0400 X-QQ-mid: bizesmtp72t1687966052tr3r64no Received: from ubuntu.. ( [111.196.130.174]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 28 Jun 2023 23:27:31 +0800 (CST) X-QQ-SSF: 00200000000000F0G000000A0000000 X-QQ-FEAT: xQoAiglG4R6wB1LBl/nmFf3sqqIgXKRxvklvQMMV1KOS4BOK5Wl8dzVSvq+0d AQH5Uc/MHuzTWeEVmGxShTLHyY6zzWu+9Jke9Xe5sHg+KUejB2AW1y4qUnpoaBl5Y0uBmij Vbzzd4YBL7yrvR274AKltErBPJKhwW1kAJxkO89rp2PGuE7T77raAz1fdC0WXz+6c1IYtKG Q4aA8I+tB9SBMqjZf9yAb2oG93ZcK0z8Dl4AtDsWANl0kogEcxaES4/L/zWjA1d3oibXkCz Io0ElCJpebM4cxi4uIM6AlObS6HhlQOOOooDiJjBuFuTpUf9V0NQzHx/BbU5+LJkGdsKfK+ o5ikJ9bG3R+gmh4vgPbs/tkQbZ7me5fKJfnOsb8V09Zlj9lBrfQAze5DCNlMA== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6150981274832304845 From: Bin Meng To: qemu-devel@nongnu.org Cc: Richard Henderson , Zhangjin Wu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PATCH v4 1/6] tests/tcg/cris: Fix the coding style Date: Wed, 28 Jun 2023 23:27:21 +0800 Message-Id: <20230628152726.110295-2-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230628152726.110295-1-bmeng@tinylab.org> References: <20230628152726.110295-1-bmeng@tinylab.org> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-0 Received-SPF: pass client-ip=43.155.67.158; envelope-from=bmeng@tinylab.org; helo=bg4.exmail.qq.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL=0.141, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The code style does not conform with QEMU's. Correct it so that the upcoming commit does not trigger checkpatch warnings. Signed-off-by: Bin Meng Acked-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- (no changes since v2) Changes in v2: - new patch: "tests/tcg/cris: Fix the coding style" tests/tcg/cris/libc/check_openpf5.c | 57 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/tests/tcg/cris/libc/check_openpf5.c b/tests/tcg/cris/libc/check_openpf5.c index 1f86ea283d..0037fbca4c 100644 --- a/tests/tcg/cris/libc/check_openpf5.c +++ b/tests/tcg/cris/libc/check_openpf5.c @@ -13,44 +13,41 @@ #include #include -int main (int argc, char *argv[]) +int main(int argc, char *argv[]) { - int i; - int filemax; + int i; + int filemax; #ifdef OPEN_MAX - filemax = OPEN_MAX; + filemax = OPEN_MAX; #else - filemax = sysconf (_SC_OPEN_MAX); + filemax = sysconf(_SC_OPEN_MAX); #endif - char *fn = malloc (strlen (argv[0]) + 2); - if (fn == NULL) - abort (); - strcpy (fn, "/"); - strcat (fn, argv[0]); + char *fn = malloc(strlen(argv[0]) + 2); + if (fn == NULL) { + abort(); + } + strcpy(fn, "/"); + strcat(fn, argv[0]); - for (i = 0; i < filemax + 1; i++) - { - if (open (fn, O_RDONLY) < 0) - { - /* Shouldn't happen too early. */ - if (i < filemax - 3 - 1) - { - fprintf (stderr, "i: %d\n", i); - abort (); - } - if (errno != EMFILE) - { - perror ("open"); - abort (); - } - goto ok; - } + for (i = 0; i < filemax + 1; i++) { + if (open(fn, O_RDONLY) < 0) { + /* Shouldn't happen too early. */ + if (i < filemax - 3 - 1) { + fprintf(stderr, "i: %d\n", i); + abort(); + } + if (errno != EMFILE) { + perror("open"); + abort(); + } + goto ok; + } } - abort (); + abort(); ok: - printf ("pass\n"); - exit (0); + printf("pass\n"); + exit(0); }