qemu-trivial
[Top][All Lists]
Advanced

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

Re: [PATCH] mark <zlib.h> with for-crc32 in a consistent manner


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] mark <zlib.h> with for-crc32 in a consistent manner
Date: Tue, 27 Aug 2024 13:46:37 +0200
User-agent: Mozilla Thunderbird

+Richard

On 27/8/24 12:02, Michael Tokarev wrote:
in many cases, <zlib.h> is only included for crc32 function,
and in some of them, there's a comment saying that, but in
a different way.  In one place (hw/net/rtl8139.c), there was
another #include added between the comment and <zlib.h> include.

Make all such comments to be on the same line as #include, make
it consistent, and also add a few missing comments, including
hw/nvram/mac_nvram.c which uses adler32 instead.

There's no code changes.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
  hw/net/cadence_gem.c             | 2 +-
  hw/net/dp8393x.c                 | 2 +-
  hw/net/ftgmac100.c               | 3 +--
  hw/net/i82596.c                  | 2 +-
  hw/net/imx_fec.c                 | 3 +--
  hw/net/lan9118.c                 | 3 +--
  hw/net/mcf_fec.c                 | 3 +--
  hw/net/npcm7xx_emc.c             | 3 +--
  hw/net/rtl8139.c                 | 4 +---
  hw/net/smc91c111.c               | 3 +--
  hw/net/stellaris_enet.c          | 2 +-
  hw/nvram/mac_nvram.c             | 2 +-
  target/arm/helper.c              | 2 +-
  target/arm/tcg/helper-a64.c      | 2 +-
  target/loongarch/tcg/op_helper.c | 2 +-
  15 files changed, 15 insertions(+), 23 deletions(-)


diff --git a/target/arm/helper.c b/target/arm/helper.c
index 0a582c1cd3..3f77b40734 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -19,7 +19,7 @@
  #include "qemu/crc32c.h"
  #include "qemu/qemu-print.h"
  #include "exec/exec-all.h"
-#include <zlib.h> /* For crc32 */
+#include <zlib.h> /* for crc32 */
  #include "hw/irq.h"
  #include "sysemu/cpu-timers.h"
  #include "sysemu/kvm.h"
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
index 21a9abd90a..56b431faf5 100644
--- a/target/arm/tcg/helper-a64.c
+++ b/target/arm/tcg/helper-a64.c
@@ -33,7 +33,7 @@
  #include "qemu/int128.h"
  #include "qemu/atomic128.h"
  #include "fpu/softfloat.h"
-#include <zlib.h> /* For crc32 */
+#include <zlib.h> /* for crc32 */
/* C2.4.7 Multiply and divide */
  /* special cases for 0 and LLONG_MIN are mandated by the standard */
diff --git a/target/loongarch/tcg/op_helper.c b/target/loongarch/tcg/op_helper.c
index fe79c62fa4..b17208e5b9 100644
--- a/target/loongarch/tcg/op_helper.c
+++ b/target/loongarch/tcg/op_helper.c
@@ -14,7 +14,7 @@
  #include "exec/cpu_ldst.h"
  #include "internals.h"
  #include "qemu/crc32c.h"
-#include <zlib.h>
+#include <zlib.h> /* for crc32 */
  #include "cpu-csr.h"
/* Exceptions helpers */

Maybe next step is to add declarations of crc32[c]/adler32
prototypes in "include/crypto/crc32.h", and implement them falling
back to zlib in host/include/generic/host/crypto/crc32.h (or
crypto/crc32-zlib.c if we need).

Then introduce HAVE_CRC32_ACCEL and implement host-optimized
methods in host/include/{arm,aarch64,loongarch64}/host/crypto/crc32.h?




reply via email to

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