From 1e20950a2029d7b164551128ee6e7d34eb27bf13 Mon Sep 17 00:00:00 2001 From: markeryang Date: Fri, 8 Jan 2021 14:57:14 +0800 Subject: [PATCH] sync patch --- ...g_null-qualify-ctx-argument-as-const.patch | 38 +++++++++++++++++++ kmod.spec | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 backport-libkmod-kmod_log_null-qualify-ctx-argument-as-const.patch diff --git a/backport-libkmod-kmod_log_null-qualify-ctx-argument-as-const.patch b/backport-libkmod-kmod_log_null-qualify-ctx-argument-as-const.patch new file mode 100644 index 0000000..4ac11d0 --- /dev/null +++ b/backport-libkmod-kmod_log_null-qualify-ctx-argument-as-const.patch @@ -0,0 +1,38 @@ +From 95ed3e75365b4922f4d5f3e024a26fe230f3a315 Mon Sep 17 00:00:00 2001 +From: Yauheni Kaliuta +Date: Sun, 29 Nov 2020 18:47:37 +0200 +Subject: [PATCH] libkmod: kmod_log_null: qualify ctx argument as const +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +kmod_log_null() does not change ctx (does nothing). + +Fix warnings + +In file included from libkmod/libkmod-index.c:33: +libkmod/libkmod-index.c: In function ‘index_mm_open’: +libkmod/libkmod-index.c:757:6: warning: passing argument 1 of ‘kmod_log_null’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] + 757 | DBG(ctx, "file=%s\n", filename); + +Signed-off-by: Yauheni Kaliuta +--- + libkmod/libkmod-internal.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h +index b22ac2a..398af9c 100644 +--- a/libkmod/libkmod-internal.h ++++ b/libkmod/libkmod-internal.h +@@ -11,7 +11,7 @@ + #include "libkmod.h" + + static _always_inline_ _printf_format_(2, 3) void +- kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {} ++ kmod_log_null(const struct kmod_ctx *ctx, const char *format, ...) {} + + #define kmod_log_cond(ctx, prio, arg...) \ + do { \ +-- +2.23.0 + diff --git a/kmod.spec b/kmod.spec index 858dbb1..21caeee 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 4 +Release: 5 Summary: Kernel module management # GPLv2+ is used by programs, LGPLv2+ is used for libraries. License: GPLv2+ and LGPLv2+ @@ -11,6 +11,7 @@ Source2: depmod.conf.dist Patch6000: backport-libkmod-fix-return-error-when-opening-index.patch Patch6001: backport-libkmod-allow-modules.alias.builtin-to-be-optional.patch +Patch6002: backport-libkmod-kmod_log_null-qualify-ctx-argument-as-const.patch Patch9000: bugfix-kmod-20-8-depmod-Don-t-unlinkat-orig-depfile-and-add-fsync.patch BuildRequires: gcc chrpath zlib-devel xz-devel libxslt openssl-devel @@ -106,6 +107,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %doc TODO NEWS README %changelog +* Fri Jan 8 2020 xinghe - 27-5 +- fix compilation warning + * Fri Aug 21 2020 WangShuo - 27-4 - unnecessary message -- Gitee