git: c0c2965f74ee - stable/13 - iwlwifi: constify another argument of iwl_print_hex_dump()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 28 Nov 2022 17:26:51 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=c0c2965f74ee7e4052a462613e837c9680861d0f

commit c0c2965f74ee7e4052a462613e837c9680861d0f
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-10-22 17:33:18 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-11-28 16:29:45 +0000

    iwlwifi: constify another argument of iwl_print_hex_dump()
    
    This is needed when enabling debugfs as it passes a const in which
    would otherwise be dropped.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 71ebd2d00b9618325ef6d0bb8c224d3d5f32160a)
---
 sys/contrib/dev/iwlwifi/iwl-debug.c | 4 ++++
 sys/contrib/dev/iwlwifi/iwl-debug.h | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/sys/contrib/dev/iwlwifi/iwl-debug.c b/sys/contrib/dev/iwlwifi/iwl-debug.c
index 5bb61151b93b..5a9c8bc70168 100644
--- a/sys/contrib/dev/iwlwifi/iwl-debug.c
+++ b/sys/contrib/dev/iwlwifi/iwl-debug.c
@@ -115,7 +115,11 @@ iwl_have_debug_level(enum iwl_dl level)
 /* Passing the iwl_drv * in seems pointless. */
 void
 iwl_print_hex_dump(void *drv __unused, enum iwl_dl level,
+#if defined(__linux__)
     const char *prefix, uint8_t *data, size_t len)
+#elif defined(__FreeBSD__)
+    const char *prefix, const uint8_t *data, size_t len)
+#endif
 {
 
 	/* Given we have a level, check for it. */
diff --git a/sys/contrib/dev/iwlwifi/iwl-debug.h b/sys/contrib/dev/iwlwifi/iwl-debug.h
index dac2c6b31562..43288a5a8d74 100644
--- a/sys/contrib/dev/iwlwifi/iwl-debug.h
+++ b/sys/contrib/dev/iwlwifi/iwl-debug.h
@@ -109,7 +109,11 @@ void __iwl_err(struct device *, enum iwl_err_mode, const char *, ...);
 
 #ifdef CONFIG_IWLWIFI_DEBUG
 bool iwl_have_debug_level(enum iwl_dl);
+#if defined(__linux__)
 void iwl_print_hex_dump(void *, enum iwl_dl, const char *, uint8_t *, size_t);
+#elif defined(__FreeBSD__)
+void iwl_print_hex_dump(void *, enum iwl_dl, const char *, const uint8_t *, size_t);
+#endif
 void __iwl_dbg(struct device *, u32, bool, const char *, const char *fmt, ...);
 
 #define	IWL_DPRINTF_DEV_PREFIX(_dev, _e, _prefix, _fmt, ...)		\