From 19f7b4e3a1fefd84f3cc80653ee84cae3b3d07b8 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 4 Sep 2025 12:06:45 -0700 Subject: [PATCH 1/4] patches: mainline: Drop mt7996 -Wuninitialized-const-pointer change This was merged in the networking 6.17-rc5 pull request. Link: https://git.kernel.org/linus/d69eb204c255c35abd9e8cb621484e8074c75eaa Signed-off-by: Nathan Chancellor --- ...e_hdr_before_passing_to_skb_put_data.patch | 65 ------------------- patches/mainline/series | 1 - 2 files changed, 66 deletions(-) delete mode 100644 patches/mainline/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch diff --git a/patches/mainline/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch b/patches/mainline/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch deleted file mode 100644 index 6d5ea24e..00000000 --- a/patches/mainline/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch +++ /dev/null @@ -1,65 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] wifi: mt76: mt7996: Initialize hdr before passing to - skb_put_data() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 15:33:25 -0700 -Message-Id: <20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A new warning in clang [1] points out a couple of places where a hdr -variable is not initialized then passed along to skb_put_data(). - - drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:1894:21: warning: variable 'hdr' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer] - 1894 | skb_put_data(skb, &hdr, sizeof(hdr)); - | ^~~ - drivers/net/wireless/mediatek/mt76/mt7996/mcu.c:3386:21: warning: variable 'hdr' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer] - 3386 | skb_put_data(skb, &hdr, sizeof(hdr)); - | ^~~ - -Zero initialize these headers as done in other places in the driver when -there is nothing stored in the header. - -Cc: stable@vger.kernel.org -Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") -Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] -Closes: https://github.com/ClangBuiltLinux/linux/issues/2104 -Link: https://lore.kernel.org/r/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org -Signed-off-by: Nathan Chancellor ---- - drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -index 994526c65bfc..640abb4dce7f 100644 ---- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -@@ -1879,8 +1879,8 @@ mt7996_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) - int mt7996_mcu_set_fixed_rate_ctrl(struct mt7996_dev *dev, - void *data, u16 version) - { -+ struct uni_header hdr = {}; - struct ra_fixed_rate *req; -- struct uni_header hdr; - struct sk_buff *skb; - struct tlv *tlv; - int len; -@@ -3373,7 +3373,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) - { - struct { - u8 __rsv[4]; -- } __packed hdr; -+ } __packed hdr = {}; - struct hdr_trans_blacklist *req_blacklist; - struct hdr_trans_en *req_en; - struct sk_buff *skb; - ---- -base-commit: eb8352ee2d1e70f916fac02094dca2b435076fa4 -change-id: 20250715-mt7996-fix-uninit-const-pointer-01e1dd03d444 - -Best regards, --- -Nathan Chancellor - diff --git a/patches/mainline/series b/patches/mainline/series index 160c8c9b..e8fde710 100644 --- a/patches/mainline/series +++ b/patches/mainline/series @@ -1,2 +1 @@ 20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch -20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch From 8cf8b56aca8d056f4fc141966b537dcb2f03a092 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 4 Sep 2025 12:15:28 -0700 Subject: [PATCH 2/4] patches: Use upstream metadata for mt7996 change in remaining trees Signed-off-by: Nathan Chancellor --- ...a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} | 26 ++++++------------- patches/6.12/series | 2 +- ...a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} | 26 ++++++------------- patches/6.6/series | 2 +- ...a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} | 26 ++++++------------- patches/stable/series | 2 +- ...a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} | 26 ++++++------------- patches/tip/series | 2 +- 8 files changed, 36 insertions(+), 76 deletions(-) rename patches/6.12/{20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch => 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} (74%) rename patches/6.6/{20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch => 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} (74%) rename patches/stable/{20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch => 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} (74%) rename patches/tip/{20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch => 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch} (74%) diff --git a/patches/6.12/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch b/patches/6.12/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch similarity index 74% rename from patches/6.12/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch rename to patches/6.12/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch index 6d5ea24e..98bb609a 100644 --- a/patches/6.12/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch +++ b/patches/6.12/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch @@ -1,12 +1,7 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] wifi: mt76: mt7996: Initialize hdr before passing to - skb_put_data() +From 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 15 Jul 2025 15:33:25 -0700 -Message-Id: <20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit +Subject: wifi: mt76: mt7996: Initialize hdr before passing to skb_put_data() A new warning in clang [1] points out a couple of places where a hdr variable is not initialized then passed along to skb_put_data(). @@ -25,14 +20,15 @@ Cc: stable@vger.kernel.org Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] Closes: https://github.com/ClangBuiltLinux/linux/issues/2104 -Link: https://lore.kernel.org/r/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org Signed-off-by: Nathan Chancellor +Link: https://patch.msgid.link/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org +Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -index 994526c65bfc..640abb4dce7f 100644 +index 3593fd40c51b6c..fe1b34386de232 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -1879,8 +1879,8 @@ mt7996_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) @@ -45,7 +41,7 @@ index 994526c65bfc..640abb4dce7f 100644 struct sk_buff *skb; struct tlv *tlv; int len; -@@ -3373,7 +3373,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) +@@ -3372,7 +3372,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) { struct { u8 __rsv[4]; @@ -54,12 +50,6 @@ index 994526c65bfc..640abb4dce7f 100644 struct hdr_trans_blacklist *req_blacklist; struct hdr_trans_en *req_en; struct sk_buff *skb; - ---- -base-commit: eb8352ee2d1e70f916fac02094dca2b435076fa4 -change-id: 20250715-mt7996-fix-uninit-const-pointer-01e1dd03d444 - -Best regards, --- -Nathan Chancellor +-- +cgit 1.2.3-korg diff --git a/patches/6.12/series b/patches/6.12/series index 789dce32..bb0b70dd 100644 --- a/patches/6.12/series +++ b/patches/6.12/series @@ -1,3 +1,3 @@ 0001-HACK-rtl8712-Zero-initialize-val-in-read_rfreg_hdl.patch +87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch 20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch -20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch diff --git a/patches/6.6/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch b/patches/6.6/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch similarity index 74% rename from patches/6.6/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch rename to patches/6.6/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch index 6d5ea24e..98bb609a 100644 --- a/patches/6.6/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch +++ b/patches/6.6/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch @@ -1,12 +1,7 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] wifi: mt76: mt7996: Initialize hdr before passing to - skb_put_data() +From 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 15 Jul 2025 15:33:25 -0700 -Message-Id: <20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit +Subject: wifi: mt76: mt7996: Initialize hdr before passing to skb_put_data() A new warning in clang [1] points out a couple of places where a hdr variable is not initialized then passed along to skb_put_data(). @@ -25,14 +20,15 @@ Cc: stable@vger.kernel.org Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] Closes: https://github.com/ClangBuiltLinux/linux/issues/2104 -Link: https://lore.kernel.org/r/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org Signed-off-by: Nathan Chancellor +Link: https://patch.msgid.link/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org +Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -index 994526c65bfc..640abb4dce7f 100644 +index 3593fd40c51b6c..fe1b34386de232 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -1879,8 +1879,8 @@ mt7996_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) @@ -45,7 +41,7 @@ index 994526c65bfc..640abb4dce7f 100644 struct sk_buff *skb; struct tlv *tlv; int len; -@@ -3373,7 +3373,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) +@@ -3372,7 +3372,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) { struct { u8 __rsv[4]; @@ -54,12 +50,6 @@ index 994526c65bfc..640abb4dce7f 100644 struct hdr_trans_blacklist *req_blacklist; struct hdr_trans_en *req_en; struct sk_buff *skb; - ---- -base-commit: eb8352ee2d1e70f916fac02094dca2b435076fa4 -change-id: 20250715-mt7996-fix-uninit-const-pointer-01e1dd03d444 - -Best regards, --- -Nathan Chancellor +-- +cgit 1.2.3-korg diff --git a/patches/6.6/series b/patches/6.6/series index 54904ac3..8e4a0d5a 100644 --- a/patches/6.6/series +++ b/patches/6.6/series @@ -1,3 +1,3 @@ 0001-HACK-rtl8712-Zero-initialize-val-in-read_rfreg_hdl.patch -20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch +87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch ccc35ff2fd2911986b716a87fe65e03fac2312c9.patch diff --git a/patches/stable/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch b/patches/stable/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch similarity index 74% rename from patches/stable/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch rename to patches/stable/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch index 6d5ea24e..98bb609a 100644 --- a/patches/stable/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch +++ b/patches/stable/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch @@ -1,12 +1,7 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] wifi: mt76: mt7996: Initialize hdr before passing to - skb_put_data() +From 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 15 Jul 2025 15:33:25 -0700 -Message-Id: <20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit +Subject: wifi: mt76: mt7996: Initialize hdr before passing to skb_put_data() A new warning in clang [1] points out a couple of places where a hdr variable is not initialized then passed along to skb_put_data(). @@ -25,14 +20,15 @@ Cc: stable@vger.kernel.org Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] Closes: https://github.com/ClangBuiltLinux/linux/issues/2104 -Link: https://lore.kernel.org/r/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org Signed-off-by: Nathan Chancellor +Link: https://patch.msgid.link/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org +Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -index 994526c65bfc..640abb4dce7f 100644 +index 3593fd40c51b6c..fe1b34386de232 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -1879,8 +1879,8 @@ mt7996_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) @@ -45,7 +41,7 @@ index 994526c65bfc..640abb4dce7f 100644 struct sk_buff *skb; struct tlv *tlv; int len; -@@ -3373,7 +3373,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) +@@ -3372,7 +3372,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) { struct { u8 __rsv[4]; @@ -54,12 +50,6 @@ index 994526c65bfc..640abb4dce7f 100644 struct hdr_trans_blacklist *req_blacklist; struct hdr_trans_en *req_en; struct sk_buff *skb; - ---- -base-commit: eb8352ee2d1e70f916fac02094dca2b435076fa4 -change-id: 20250715-mt7996-fix-uninit-const-pointer-01e1dd03d444 - -Best regards, --- -Nathan Chancellor +-- +cgit 1.2.3-korg diff --git a/patches/stable/series b/patches/stable/series index bba095fc..4d306881 100644 --- a/patches/stable/series +++ b/patches/stable/series @@ -1,3 +1,3 @@ +87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch 20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch 20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch -20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch diff --git a/patches/tip/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch b/patches/tip/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch similarity index 74% rename from patches/tip/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch rename to patches/tip/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch index 6d5ea24e..98bb609a 100644 --- a/patches/tip/20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch +++ b/patches/tip/87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch @@ -1,12 +1,7 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] wifi: mt76: mt7996: Initialize hdr before passing to - skb_put_data() +From 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Tue, 15 Jul 2025 15:33:25 -0700 -Message-Id: <20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit +Subject: wifi: mt76: mt7996: Initialize hdr before passing to skb_put_data() A new warning in clang [1] points out a couple of places where a hdr variable is not initialized then passed along to skb_put_data(). @@ -25,14 +20,15 @@ Cc: stable@vger.kernel.org Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] Closes: https://github.com/ClangBuiltLinux/linux/issues/2104 -Link: https://lore.kernel.org/r/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org Signed-off-by: Nathan Chancellor +Link: https://patch.msgid.link/20250715-mt7996-fix-uninit-const-pointer-v1-1-b5d8d11d7b78@kernel.org +Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -index 994526c65bfc..640abb4dce7f 100644 +index 3593fd40c51b6c..fe1b34386de232 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -1879,8 +1879,8 @@ mt7996_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) @@ -45,7 +41,7 @@ index 994526c65bfc..640abb4dce7f 100644 struct sk_buff *skb; struct tlv *tlv; int len; -@@ -3373,7 +3373,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) +@@ -3372,7 +3372,7 @@ int mt7996_mcu_set_hdr_trans(struct mt7996_dev *dev, bool hdr_trans) { struct { u8 __rsv[4]; @@ -54,12 +50,6 @@ index 994526c65bfc..640abb4dce7f 100644 struct hdr_trans_blacklist *req_blacklist; struct hdr_trans_en *req_en; struct sk_buff *skb; - ---- -base-commit: eb8352ee2d1e70f916fac02094dca2b435076fa4 -change-id: 20250715-mt7996-fix-uninit-const-pointer-01e1dd03d444 - -Best regards, --- -Nathan Chancellor +-- +cgit 1.2.3-korg diff --git a/patches/tip/series b/patches/tip/series index 160c8c9b..bc3e1116 100644 --- a/patches/tip/series +++ b/patches/tip/series @@ -1,2 +1,2 @@ +87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch 20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch -20250715_nathan_wifi_mt76_mt7996_initialize_hdr_before_passing_to_skb_put_data.patch From e5cabc25a93bc9bdd90b9037c8fff3cf25619ab9 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 4 Sep 2025 12:17:29 -0700 Subject: [PATCH 3/4] patches: Drop drm/msm DPU change This was merged in 6.17-rc4. Link: https://git.kernel.org/linus/daab47925c06a04792ca720d8438abd37775e357 Signed-off-by: Nathan Chancellor --- ...ll_in_dpu_plane_virtual_atomic_check.patch | 65 ------------------- patches/android-mainline/series | 1 - ...ll_in_dpu_plane_virtual_atomic_check.patch | 65 ------------------- patches/stable/series | 1 - 4 files changed, 132 deletions(-) delete mode 100644 patches/android-mainline/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch delete mode 100644 patches/stable/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch diff --git a/patches/android-mainline/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch b/patches/android-mainline/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch deleted file mode 100644 index a4d3c3a0..00000000 --- a/patches/android-mainline/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch +++ /dev/null @@ -1,65 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] drm/msm/dpu: Initialize crtc_state to NULL in - dpu_plane_virtual_atomic_check() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 16:27:35 -0700 -Message-Id: <20250715-drm-msm-fix-const-uninit-warning-v1-1-d6a366fd9a32@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -After a recent change in clang to expose uninitialized warnings from -const variables and pointers [1], there is a warning around crtc_state -in dpu_plane_virtual_atomic_check(): - - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1145:6: error: variable 'crtc_state' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] - 1145 | if (plane_state->crtc) - | ^~~~~~~~~~~~~~~~~ - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1149:58: note: uninitialized use occurs here - 1149 | ret = dpu_plane_atomic_check_nosspp(plane, plane_state, crtc_state); - | ^~~~~~~~~~ - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1145:2: note: remove the 'if' if its condition is always true - 1145 | if (plane_state->crtc) - | ^~~~~~~~~~~~~~~~~~~~~~ - 1146 | crtc_state = drm_atomic_get_new_crtc_state(state, - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1139:35: note: initialize the variable 'crtc_state' to silence this warning - 1139 | struct drm_crtc_state *crtc_state; - | ^ - | = NULL - -Initialize crtc_state to NULL like other places in the driver do, so -that it is consistently initialized. - -Cc: stable@vger.kernel.org -Closes: https://github.com/ClangBuiltLinux/linux/issues/2106 -Fixes: 774bcfb73176 ("drm/msm/dpu: add support for virtual planes") -Link: https://github.com/llvm/llvm-project/commit/2464313eef01c5b1edf0eccf57a32cdee01472c7 [1] -Reviewed-by: Jessica Zhang -Link: https://lore.kernel.org/r/20250715-drm-msm-fix-const-uninit-warning-v1-1-d6a366fd9a32@kernel.org -Signed-off-by: Nathan Chancellor ---- - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c -index 421138bc3cb7..30ff21c01a36 100644 ---- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c -+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c -@@ -1136,7 +1136,7 @@ static int dpu_plane_virtual_atomic_check(struct drm_plane *plane, - struct drm_plane_state *old_plane_state = - drm_atomic_get_old_plane_state(state, plane); - struct dpu_plane_state *pstate = to_dpu_plane_state(plane_state); -- struct drm_crtc_state *crtc_state; -+ struct drm_crtc_state *crtc_state = NULL; - int ret; - - if (IS_ERR(plane_state)) - ---- -base-commit: d3deabe4c619875714b9a844b1a3d9752dbae1dd -change-id: 20250715-drm-msm-fix-const-uninit-warning-2b93cef9f1c6 - -Best regards, --- -Nathan Chancellor - diff --git a/patches/android-mainline/series b/patches/android-mainline/series index ab1d6571..e8fde710 100644 --- a/patches/android-mainline/series +++ b/patches/android-mainline/series @@ -1,2 +1 @@ -20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch 20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch diff --git a/patches/stable/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch b/patches/stable/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch deleted file mode 100644 index a4d3c3a0..00000000 --- a/patches/stable/20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch +++ /dev/null @@ -1,65 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] drm/msm/dpu: Initialize crtc_state to NULL in - dpu_plane_virtual_atomic_check() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 16:27:35 -0700 -Message-Id: <20250715-drm-msm-fix-const-uninit-warning-v1-1-d6a366fd9a32@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -After a recent change in clang to expose uninitialized warnings from -const variables and pointers [1], there is a warning around crtc_state -in dpu_plane_virtual_atomic_check(): - - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1145:6: error: variable 'crtc_state' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] - 1145 | if (plane_state->crtc) - | ^~~~~~~~~~~~~~~~~ - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1149:58: note: uninitialized use occurs here - 1149 | ret = dpu_plane_atomic_check_nosspp(plane, plane_state, crtc_state); - | ^~~~~~~~~~ - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1145:2: note: remove the 'if' if its condition is always true - 1145 | if (plane_state->crtc) - | ^~~~~~~~~~~~~~~~~~~~~~ - 1146 | crtc_state = drm_atomic_get_new_crtc_state(state, - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1139:35: note: initialize the variable 'crtc_state' to silence this warning - 1139 | struct drm_crtc_state *crtc_state; - | ^ - | = NULL - -Initialize crtc_state to NULL like other places in the driver do, so -that it is consistently initialized. - -Cc: stable@vger.kernel.org -Closes: https://github.com/ClangBuiltLinux/linux/issues/2106 -Fixes: 774bcfb73176 ("drm/msm/dpu: add support for virtual planes") -Link: https://github.com/llvm/llvm-project/commit/2464313eef01c5b1edf0eccf57a32cdee01472c7 [1] -Reviewed-by: Jessica Zhang -Link: https://lore.kernel.org/r/20250715-drm-msm-fix-const-uninit-warning-v1-1-d6a366fd9a32@kernel.org -Signed-off-by: Nathan Chancellor ---- - drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c -index 421138bc3cb7..30ff21c01a36 100644 ---- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c -+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c -@@ -1136,7 +1136,7 @@ static int dpu_plane_virtual_atomic_check(struct drm_plane *plane, - struct drm_plane_state *old_plane_state = - drm_atomic_get_old_plane_state(state, plane); - struct dpu_plane_state *pstate = to_dpu_plane_state(plane_state); -- struct drm_crtc_state *crtc_state; -+ struct drm_crtc_state *crtc_state = NULL; - int ret; - - if (IS_ERR(plane_state)) - ---- -base-commit: d3deabe4c619875714b9a844b1a3d9752dbae1dd -change-id: 20250715-drm-msm-fix-const-uninit-warning-2b93cef9f1c6 - -Best regards, --- -Nathan Chancellor - diff --git a/patches/stable/series b/patches/stable/series index 4d306881..bc3e1116 100644 --- a/patches/stable/series +++ b/patches/stable/series @@ -1,3 +1,2 @@ 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch -20250715_nathan_drm_msm_dpu_initialize_crtc_state_to_null_in_dpu_plane_virtual_atomic_check.patch 20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch From 52976e9a27fbc6cf2474dab3ac03d4d19f934a43 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 4 Sep 2025 12:44:33 -0700 Subject: [PATCH 4/4] patches: Use Arnd's version of s5p-mfc fix This is the one that has been accepted in the media tree. While this hash is not upstream yet, I do not believe the media tree rebases, so it should be the same hash that ends up upstream. If not, we'll adjust later. Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Signed-off-by: Nathan Chancellor --- ...ass_null_to_s5p_mfc_cmd_host2risc_v6.patch | 129 ----------------- ...7ba25a1dfc084e24ea9acc14bf1fad8af14c.patch | 132 ++++++++++++++++++ patches/6.12/series | 2 +- ...ass_null_to_s5p_mfc_cmd_host2risc_v6.patch | 129 ----------------- ...7ba25a1dfc084e24ea9acc14bf1fad8af14c.patch | 132 ++++++++++++++++++ patches/android-mainline/series | 2 +- ...ass_null_to_s5p_mfc_cmd_host2risc_v6.patch | 129 ----------------- ...7ba25a1dfc084e24ea9acc14bf1fad8af14c.patch | 132 ++++++++++++++++++ patches/mainline/series | 2 +- ...ass_null_to_s5p_mfc_cmd_host2risc_v6.patch | 129 ----------------- ...7ba25a1dfc084e24ea9acc14bf1fad8af14c.patch | 132 ++++++++++++++++++ patches/stable/series | 2 +- ...ass_null_to_s5p_mfc_cmd_host2risc_v6.patch | 129 ----------------- ...7ba25a1dfc084e24ea9acc14bf1fad8af14c.patch | 132 ++++++++++++++++++ patches/tip/series | 2 +- 15 files changed, 665 insertions(+), 650 deletions(-) delete mode 100644 patches/6.12/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch create mode 100644 patches/6.12/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch delete mode 100644 patches/android-mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch create mode 100644 patches/android-mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch delete mode 100644 patches/mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch create mode 100644 patches/mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch delete mode 100644 patches/stable/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch create mode 100644 patches/stable/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch delete mode 100644 patches/tip/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch create mode 100644 patches/tip/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch diff --git a/patches/6.12/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch b/patches/6.12/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch deleted file mode 100644 index 1ae4b11a..00000000 --- a/patches/6.12/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +++ /dev/null @@ -1,129 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] media: s5p-mfc: Always pass NULL to - s5p_mfc_cmd_host2risc_v6() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 15:13:07 -0700 -Message-Id: <20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A new warning in clang [1] points out a few places in s5p_mfc_cmd_v6.c -where an uninitialized variable is passed as a const pointer: - - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 45 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:133:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 133 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:148:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 148 | &h2r_args); - | ^~~~~~~~ - -The args parameter in s5p_mfc_cmd_host2risc_v6() is never actually used, -so just pass NULL to it in the places where h2r_args is currently -passed, clearing up the warning and not changing the functionality of -the code. - -Cc: stable@vger.kernel.org -Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") -Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] -Closes: https://github.com/ClangBuiltLinux/linux/issues/2103 -Acked-by: Marek Szyprowski -Reviewed-by: Nicolas Dufresne -Link: https://lore.kernel.org/r/20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org -Signed-off-by: Nathan Chancellor ---- ->From what I can tell, it seems like ->cmd_host2risc() is only ever -called from v6 code, which always passes NULL? It seems like it should -be possible to just drop .cmd_host2risc on the v5 side, then update -.cmd_host2risc to only take two parameters? If so, I can send a follow -up as a clean up, so that this can go back relatively conflict free. ---- - .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 22 +++++----------------- - 1 file changed, 5 insertions(+), 17 deletions(-) - -diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -index 47bc3014b5d8..735471c50dbb 100644 ---- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -@@ -31,7 +31,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, - - static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; - const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; - int ret; - -@@ -41,33 +40,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - - mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); - mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, NULL); - } - - static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, NULL); - } - - static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, NULL); - } - - /* Open a new instance and get its number */ - static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int codec_type; - - mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); -@@ -130,14 +119,13 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ - - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, -- &h2r_args); -+ NULL); - } - - /* Close instance */ - static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int ret = 0; - - dev->curr_ctx = ctx->num; -@@ -145,7 +133,7 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); - ret = s5p_mfc_cmd_host2risc_v6(dev, - S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, -- &h2r_args); -+ NULL); - } else { - ret = -EINVAL; - } - ---- -base-commit: 347e9f5043c89695b01e66b3ed111755afcf1911 -change-id: 20250715-media-s5p-mfc-fix-uninit-const-pointer-cbf944ae4b4b - -Best regards, --- -Nathan Chancellor - diff --git a/patches/6.12/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch b/patches/6.12/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch new file mode 100644 index 00000000..c52db985 --- /dev/null +++ b/patches/6.12/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch @@ -0,0 +1,132 @@ +From 7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 7 Aug 2025 22:54:15 +0200 +Subject: media: s5p-mfc: remove an unused/uninitialized variable + +The s5p_mfc_cmd_args structure in the v6 driver is never used, not +initialized to anything other than zero, but as of clang-21 this +causes a warning: + +drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] + 45 | &h2r_args); + | ^~~~~~~~ + +Just remove this for simplicity. Since the function is also called +through a callback, this does require adding a trivial wrapper with +the correct prototype. + +Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") +Cc: stable@vger.kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Hans Verkuil +--- +Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c +--- + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 35 ++++++++-------------- + 1 file changed, 13 insertions(+), 22 deletions(-) + +diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +index 47bc3014b5d8..f7c682fca645 100644 +--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c ++++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +@@ -14,8 +14,7 @@ + #include "s5p_mfc_opr.h" + #include "s5p_mfc_cmd_v6.h" + +-static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, +- const struct s5p_mfc_cmd_args *args) ++static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) + { + mfc_debug(2, "Issue the command: %d\n", cmd); + +@@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, + + static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + int ret; + +@@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + + mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); + mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); + } + + static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); + } + + static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); + } + + /* Open a new instance and get its number */ + static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int codec_type; + + mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); +@@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); + mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ + +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); + } + + /* Close instance */ + static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int ret = 0; + + dev->curr_ctx = ctx->num; + if (ctx->state != MFCINST_FREE) { + mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); + ret = s5p_mfc_cmd_host2risc_v6(dev, +- S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, +- &h2r_args); ++ S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); + } else { + ret = -EINVAL; + } +@@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + return ret; + } + ++static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, ++ const struct s5p_mfc_cmd_args *ignored) ++{ ++ return s5p_mfc_cmd_host2risc_v6(dev, cmd); ++} ++ + /* Initialize cmd function pointers for MFC v6 */ + static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { +- .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, ++ .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, + .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, + .sleep_cmd = s5p_mfc_sleep_cmd_v6, + .wakeup_cmd = s5p_mfc_wakeup_cmd_v6, +-- +cgit v1.2.3 + diff --git a/patches/6.12/series b/patches/6.12/series index bb0b70dd..22989589 100644 --- a/patches/6.12/series +++ b/patches/6.12/series @@ -1,3 +1,3 @@ 0001-HACK-rtl8712-Zero-initialize-val-in-read_rfreg_hdl.patch +7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch -20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch diff --git a/patches/android-mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch b/patches/android-mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch deleted file mode 100644 index 1ae4b11a..00000000 --- a/patches/android-mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +++ /dev/null @@ -1,129 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] media: s5p-mfc: Always pass NULL to - s5p_mfc_cmd_host2risc_v6() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 15:13:07 -0700 -Message-Id: <20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A new warning in clang [1] points out a few places in s5p_mfc_cmd_v6.c -where an uninitialized variable is passed as a const pointer: - - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 45 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:133:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 133 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:148:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 148 | &h2r_args); - | ^~~~~~~~ - -The args parameter in s5p_mfc_cmd_host2risc_v6() is never actually used, -so just pass NULL to it in the places where h2r_args is currently -passed, clearing up the warning and not changing the functionality of -the code. - -Cc: stable@vger.kernel.org -Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") -Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] -Closes: https://github.com/ClangBuiltLinux/linux/issues/2103 -Acked-by: Marek Szyprowski -Reviewed-by: Nicolas Dufresne -Link: https://lore.kernel.org/r/20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org -Signed-off-by: Nathan Chancellor ---- ->From what I can tell, it seems like ->cmd_host2risc() is only ever -called from v6 code, which always passes NULL? It seems like it should -be possible to just drop .cmd_host2risc on the v5 side, then update -.cmd_host2risc to only take two parameters? If so, I can send a follow -up as a clean up, so that this can go back relatively conflict free. ---- - .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 22 +++++----------------- - 1 file changed, 5 insertions(+), 17 deletions(-) - -diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -index 47bc3014b5d8..735471c50dbb 100644 ---- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -@@ -31,7 +31,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, - - static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; - const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; - int ret; - -@@ -41,33 +40,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - - mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); - mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, NULL); - } - - static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, NULL); - } - - static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, NULL); - } - - /* Open a new instance and get its number */ - static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int codec_type; - - mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); -@@ -130,14 +119,13 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ - - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, -- &h2r_args); -+ NULL); - } - - /* Close instance */ - static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int ret = 0; - - dev->curr_ctx = ctx->num; -@@ -145,7 +133,7 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); - ret = s5p_mfc_cmd_host2risc_v6(dev, - S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, -- &h2r_args); -+ NULL); - } else { - ret = -EINVAL; - } - ---- -base-commit: 347e9f5043c89695b01e66b3ed111755afcf1911 -change-id: 20250715-media-s5p-mfc-fix-uninit-const-pointer-cbf944ae4b4b - -Best regards, --- -Nathan Chancellor - diff --git a/patches/android-mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch b/patches/android-mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch new file mode 100644 index 00000000..c52db985 --- /dev/null +++ b/patches/android-mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch @@ -0,0 +1,132 @@ +From 7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 7 Aug 2025 22:54:15 +0200 +Subject: media: s5p-mfc: remove an unused/uninitialized variable + +The s5p_mfc_cmd_args structure in the v6 driver is never used, not +initialized to anything other than zero, but as of clang-21 this +causes a warning: + +drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] + 45 | &h2r_args); + | ^~~~~~~~ + +Just remove this for simplicity. Since the function is also called +through a callback, this does require adding a trivial wrapper with +the correct prototype. + +Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") +Cc: stable@vger.kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Hans Verkuil +--- +Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c +--- + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 35 ++++++++-------------- + 1 file changed, 13 insertions(+), 22 deletions(-) + +diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +index 47bc3014b5d8..f7c682fca645 100644 +--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c ++++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +@@ -14,8 +14,7 @@ + #include "s5p_mfc_opr.h" + #include "s5p_mfc_cmd_v6.h" + +-static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, +- const struct s5p_mfc_cmd_args *args) ++static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) + { + mfc_debug(2, "Issue the command: %d\n", cmd); + +@@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, + + static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + int ret; + +@@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + + mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); + mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); + } + + static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); + } + + static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); + } + + /* Open a new instance and get its number */ + static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int codec_type; + + mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); +@@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); + mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ + +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); + } + + /* Close instance */ + static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int ret = 0; + + dev->curr_ctx = ctx->num; + if (ctx->state != MFCINST_FREE) { + mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); + ret = s5p_mfc_cmd_host2risc_v6(dev, +- S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, +- &h2r_args); ++ S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); + } else { + ret = -EINVAL; + } +@@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + return ret; + } + ++static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, ++ const struct s5p_mfc_cmd_args *ignored) ++{ ++ return s5p_mfc_cmd_host2risc_v6(dev, cmd); ++} ++ + /* Initialize cmd function pointers for MFC v6 */ + static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { +- .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, ++ .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, + .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, + .sleep_cmd = s5p_mfc_sleep_cmd_v6, + .wakeup_cmd = s5p_mfc_wakeup_cmd_v6, +-- +cgit v1.2.3 + diff --git a/patches/android-mainline/series b/patches/android-mainline/series index e8fde710..250c20f7 100644 --- a/patches/android-mainline/series +++ b/patches/android-mainline/series @@ -1 +1 @@ -20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch diff --git a/patches/mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch b/patches/mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch deleted file mode 100644 index 1ae4b11a..00000000 --- a/patches/mainline/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +++ /dev/null @@ -1,129 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] media: s5p-mfc: Always pass NULL to - s5p_mfc_cmd_host2risc_v6() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 15:13:07 -0700 -Message-Id: <20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A new warning in clang [1] points out a few places in s5p_mfc_cmd_v6.c -where an uninitialized variable is passed as a const pointer: - - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 45 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:133:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 133 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:148:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 148 | &h2r_args); - | ^~~~~~~~ - -The args parameter in s5p_mfc_cmd_host2risc_v6() is never actually used, -so just pass NULL to it in the places where h2r_args is currently -passed, clearing up the warning and not changing the functionality of -the code. - -Cc: stable@vger.kernel.org -Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") -Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] -Closes: https://github.com/ClangBuiltLinux/linux/issues/2103 -Acked-by: Marek Szyprowski -Reviewed-by: Nicolas Dufresne -Link: https://lore.kernel.org/r/20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org -Signed-off-by: Nathan Chancellor ---- ->From what I can tell, it seems like ->cmd_host2risc() is only ever -called from v6 code, which always passes NULL? It seems like it should -be possible to just drop .cmd_host2risc on the v5 side, then update -.cmd_host2risc to only take two parameters? If so, I can send a follow -up as a clean up, so that this can go back relatively conflict free. ---- - .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 22 +++++----------------- - 1 file changed, 5 insertions(+), 17 deletions(-) - -diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -index 47bc3014b5d8..735471c50dbb 100644 ---- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -@@ -31,7 +31,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, - - static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; - const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; - int ret; - -@@ -41,33 +40,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - - mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); - mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, NULL); - } - - static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, NULL); - } - - static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, NULL); - } - - /* Open a new instance and get its number */ - static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int codec_type; - - mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); -@@ -130,14 +119,13 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ - - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, -- &h2r_args); -+ NULL); - } - - /* Close instance */ - static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int ret = 0; - - dev->curr_ctx = ctx->num; -@@ -145,7 +133,7 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); - ret = s5p_mfc_cmd_host2risc_v6(dev, - S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, -- &h2r_args); -+ NULL); - } else { - ret = -EINVAL; - } - ---- -base-commit: 347e9f5043c89695b01e66b3ed111755afcf1911 -change-id: 20250715-media-s5p-mfc-fix-uninit-const-pointer-cbf944ae4b4b - -Best regards, --- -Nathan Chancellor - diff --git a/patches/mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch b/patches/mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch new file mode 100644 index 00000000..c52db985 --- /dev/null +++ b/patches/mainline/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch @@ -0,0 +1,132 @@ +From 7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 7 Aug 2025 22:54:15 +0200 +Subject: media: s5p-mfc: remove an unused/uninitialized variable + +The s5p_mfc_cmd_args structure in the v6 driver is never used, not +initialized to anything other than zero, but as of clang-21 this +causes a warning: + +drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] + 45 | &h2r_args); + | ^~~~~~~~ + +Just remove this for simplicity. Since the function is also called +through a callback, this does require adding a trivial wrapper with +the correct prototype. + +Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") +Cc: stable@vger.kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Hans Verkuil +--- +Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c +--- + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 35 ++++++++-------------- + 1 file changed, 13 insertions(+), 22 deletions(-) + +diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +index 47bc3014b5d8..f7c682fca645 100644 +--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c ++++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +@@ -14,8 +14,7 @@ + #include "s5p_mfc_opr.h" + #include "s5p_mfc_cmd_v6.h" + +-static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, +- const struct s5p_mfc_cmd_args *args) ++static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) + { + mfc_debug(2, "Issue the command: %d\n", cmd); + +@@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, + + static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + int ret; + +@@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + + mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); + mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); + } + + static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); + } + + static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); + } + + /* Open a new instance and get its number */ + static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int codec_type; + + mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); +@@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); + mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ + +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); + } + + /* Close instance */ + static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int ret = 0; + + dev->curr_ctx = ctx->num; + if (ctx->state != MFCINST_FREE) { + mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); + ret = s5p_mfc_cmd_host2risc_v6(dev, +- S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, +- &h2r_args); ++ S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); + } else { + ret = -EINVAL; + } +@@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + return ret; + } + ++static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, ++ const struct s5p_mfc_cmd_args *ignored) ++{ ++ return s5p_mfc_cmd_host2risc_v6(dev, cmd); ++} ++ + /* Initialize cmd function pointers for MFC v6 */ + static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { +- .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, ++ .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, + .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, + .sleep_cmd = s5p_mfc_sleep_cmd_v6, + .wakeup_cmd = s5p_mfc_wakeup_cmd_v6, +-- +cgit v1.2.3 + diff --git a/patches/mainline/series b/patches/mainline/series index e8fde710..250c20f7 100644 --- a/patches/mainline/series +++ b/patches/mainline/series @@ -1 +1 @@ -20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch diff --git a/patches/stable/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch b/patches/stable/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch deleted file mode 100644 index 1ae4b11a..00000000 --- a/patches/stable/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +++ /dev/null @@ -1,129 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] media: s5p-mfc: Always pass NULL to - s5p_mfc_cmd_host2risc_v6() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 15:13:07 -0700 -Message-Id: <20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A new warning in clang [1] points out a few places in s5p_mfc_cmd_v6.c -where an uninitialized variable is passed as a const pointer: - - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 45 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:133:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 133 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:148:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 148 | &h2r_args); - | ^~~~~~~~ - -The args parameter in s5p_mfc_cmd_host2risc_v6() is never actually used, -so just pass NULL to it in the places where h2r_args is currently -passed, clearing up the warning and not changing the functionality of -the code. - -Cc: stable@vger.kernel.org -Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") -Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] -Closes: https://github.com/ClangBuiltLinux/linux/issues/2103 -Acked-by: Marek Szyprowski -Reviewed-by: Nicolas Dufresne -Link: https://lore.kernel.org/r/20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org -Signed-off-by: Nathan Chancellor ---- ->From what I can tell, it seems like ->cmd_host2risc() is only ever -called from v6 code, which always passes NULL? It seems like it should -be possible to just drop .cmd_host2risc on the v5 side, then update -.cmd_host2risc to only take two parameters? If so, I can send a follow -up as a clean up, so that this can go back relatively conflict free. ---- - .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 22 +++++----------------- - 1 file changed, 5 insertions(+), 17 deletions(-) - -diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -index 47bc3014b5d8..735471c50dbb 100644 ---- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -@@ -31,7 +31,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, - - static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; - const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; - int ret; - -@@ -41,33 +40,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - - mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); - mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, NULL); - } - - static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, NULL); - } - - static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, NULL); - } - - /* Open a new instance and get its number */ - static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int codec_type; - - mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); -@@ -130,14 +119,13 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ - - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, -- &h2r_args); -+ NULL); - } - - /* Close instance */ - static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int ret = 0; - - dev->curr_ctx = ctx->num; -@@ -145,7 +133,7 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); - ret = s5p_mfc_cmd_host2risc_v6(dev, - S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, -- &h2r_args); -+ NULL); - } else { - ret = -EINVAL; - } - ---- -base-commit: 347e9f5043c89695b01e66b3ed111755afcf1911 -change-id: 20250715-media-s5p-mfc-fix-uninit-const-pointer-cbf944ae4b4b - -Best regards, --- -Nathan Chancellor - diff --git a/patches/stable/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch b/patches/stable/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch new file mode 100644 index 00000000..c52db985 --- /dev/null +++ b/patches/stable/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch @@ -0,0 +1,132 @@ +From 7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 7 Aug 2025 22:54:15 +0200 +Subject: media: s5p-mfc: remove an unused/uninitialized variable + +The s5p_mfc_cmd_args structure in the v6 driver is never used, not +initialized to anything other than zero, but as of clang-21 this +causes a warning: + +drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] + 45 | &h2r_args); + | ^~~~~~~~ + +Just remove this for simplicity. Since the function is also called +through a callback, this does require adding a trivial wrapper with +the correct prototype. + +Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") +Cc: stable@vger.kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Hans Verkuil +--- +Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c +--- + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 35 ++++++++-------------- + 1 file changed, 13 insertions(+), 22 deletions(-) + +diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +index 47bc3014b5d8..f7c682fca645 100644 +--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c ++++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +@@ -14,8 +14,7 @@ + #include "s5p_mfc_opr.h" + #include "s5p_mfc_cmd_v6.h" + +-static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, +- const struct s5p_mfc_cmd_args *args) ++static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) + { + mfc_debug(2, "Issue the command: %d\n", cmd); + +@@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, + + static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + int ret; + +@@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + + mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); + mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); + } + + static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); + } + + static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); + } + + /* Open a new instance and get its number */ + static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int codec_type; + + mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); +@@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); + mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ + +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); + } + + /* Close instance */ + static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int ret = 0; + + dev->curr_ctx = ctx->num; + if (ctx->state != MFCINST_FREE) { + mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); + ret = s5p_mfc_cmd_host2risc_v6(dev, +- S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, +- &h2r_args); ++ S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); + } else { + ret = -EINVAL; + } +@@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + return ret; + } + ++static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, ++ const struct s5p_mfc_cmd_args *ignored) ++{ ++ return s5p_mfc_cmd_host2risc_v6(dev, cmd); ++} ++ + /* Initialize cmd function pointers for MFC v6 */ + static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { +- .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, ++ .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, + .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, + .sleep_cmd = s5p_mfc_sleep_cmd_v6, + .wakeup_cmd = s5p_mfc_wakeup_cmd_v6, +-- +cgit v1.2.3 + diff --git a/patches/stable/series b/patches/stable/series index bc3e1116..9422882b 100644 --- a/patches/stable/series +++ b/patches/stable/series @@ -1,2 +1,2 @@ +7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch -20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch diff --git a/patches/tip/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch b/patches/tip/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch deleted file mode 100644 index 1ae4b11a..00000000 --- a/patches/tip/20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch +++ /dev/null @@ -1,129 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] media: s5p-mfc: Always pass NULL to - s5p_mfc_cmd_host2risc_v6() -From: Nathan Chancellor -Date: Tue, 15 Jul 2025 15:13:07 -0700 -Message-Id: <20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -A new warning in clang [1] points out a few places in s5p_mfc_cmd_v6.c -where an uninitialized variable is passed as a const pointer: - - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 45 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:133:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 133 | &h2r_args); - | ^~~~~~~~ - drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:148:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] - 148 | &h2r_args); - | ^~~~~~~~ - -The args parameter in s5p_mfc_cmd_host2risc_v6() is never actually used, -so just pass NULL to it in the places where h2r_args is currently -passed, clearing up the warning and not changing the functionality of -the code. - -Cc: stable@vger.kernel.org -Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") -Link: https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e [1] -Closes: https://github.com/ClangBuiltLinux/linux/issues/2103 -Acked-by: Marek Szyprowski -Reviewed-by: Nicolas Dufresne -Link: https://lore.kernel.org/r/20250715-media-s5p-mfc-fix-uninit-const-pointer-v1-1-4d52b58cafe9@kernel.org -Signed-off-by: Nathan Chancellor ---- ->From what I can tell, it seems like ->cmd_host2risc() is only ever -called from v6 code, which always passes NULL? It seems like it should -be possible to just drop .cmd_host2risc on the v5 side, then update -.cmd_host2risc to only take two parameters? If so, I can send a follow -up as a clean up, so that this can go back relatively conflict free. ---- - .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 22 +++++----------------- - 1 file changed, 5 insertions(+), 17 deletions(-) - -diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -index 47bc3014b5d8..735471c50dbb 100644 ---- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c -@@ -31,7 +31,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, - - static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; - const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; - int ret; - -@@ -41,33 +40,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) - - mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); - mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, NULL); - } - - static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, NULL); - } - - static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) - { -- struct s5p_mfc_cmd_args h2r_args; -- -- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); -- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, -- &h2r_args); -+ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, NULL); - } - - /* Open a new instance and get its number */ - static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int codec_type; - - mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); -@@ -130,14 +119,13 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ - - return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, -- &h2r_args); -+ NULL); - } - - /* Close instance */ - static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - { - struct s5p_mfc_dev *dev = ctx->dev; -- struct s5p_mfc_cmd_args h2r_args; - int ret = 0; - - dev->curr_ctx = ctx->num; -@@ -145,7 +133,7 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) - mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); - ret = s5p_mfc_cmd_host2risc_v6(dev, - S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, -- &h2r_args); -+ NULL); - } else { - ret = -EINVAL; - } - ---- -base-commit: 347e9f5043c89695b01e66b3ed111755afcf1911 -change-id: 20250715-media-s5p-mfc-fix-uninit-const-pointer-cbf944ae4b4b - -Best regards, --- -Nathan Chancellor - diff --git a/patches/tip/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch b/patches/tip/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch new file mode 100644 index 00000000..c52db985 --- /dev/null +++ b/patches/tip/7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch @@ -0,0 +1,132 @@ +From 7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Thu, 7 Aug 2025 22:54:15 +0200 +Subject: media: s5p-mfc: remove an unused/uninitialized variable + +The s5p_mfc_cmd_args structure in the v6 driver is never used, not +initialized to anything other than zero, but as of clang-21 this +causes a warning: + +drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] + 45 | &h2r_args); + | ^~~~~~~~ + +Just remove this for simplicity. Since the function is also called +through a callback, this does require adding a trivial wrapper with +the correct prototype. + +Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x") +Cc: stable@vger.kernel.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Hans Verkuil +--- +Link: https://git.linuxtv.org/media.git/commit/?id=7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c +--- + .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c | 35 ++++++++-------------- + 1 file changed, 13 insertions(+), 22 deletions(-) + +diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +index 47bc3014b5d8..f7c682fca645 100644 +--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c ++++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c +@@ -14,8 +14,7 @@ + #include "s5p_mfc_opr.h" + #include "s5p_mfc_cmd_v6.h" + +-static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, +- const struct s5p_mfc_cmd_args *args) ++static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd) + { + mfc_debug(2, "Issue the command: %d\n", cmd); + +@@ -31,7 +30,6 @@ static int s5p_mfc_cmd_host2risc_v6(struct s5p_mfc_dev *dev, int cmd, + + static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; + const struct s5p_mfc_buf_size_v6 *buf_size = dev->variant->buf_size->priv; + int ret; + +@@ -41,33 +39,23 @@ static int s5p_mfc_sys_init_cmd_v6(struct s5p_mfc_dev *dev) + + mfc_write(dev, dev->ctx_buf.dma, S5P_FIMV_CONTEXT_MEM_ADDR_V6); + mfc_write(dev, buf_size->dev_ctx, S5P_FIMV_CONTEXT_MEM_SIZE_V6); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SYS_INIT_V6); + } + + static int s5p_mfc_sleep_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_SLEEP_V6); + } + + static int s5p_mfc_wakeup_cmd_v6(struct s5p_mfc_dev *dev) + { +- struct s5p_mfc_cmd_args h2r_args; +- +- memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_WAKEUP_V6); + } + + /* Open a new instance and get its number */ + static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int codec_type; + + mfc_debug(2, "Requested codec mode: %d\n", ctx->codec_mode); +@@ -129,23 +117,20 @@ static int s5p_mfc_open_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + mfc_write(dev, ctx->ctx.size, S5P_FIMV_CONTEXT_MEM_SIZE_V6); + mfc_write(dev, 0, S5P_FIMV_D_CRC_CTRL_V6); /* no crc */ + +- return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6, +- &h2r_args); ++ return s5p_mfc_cmd_host2risc_v6(dev, S5P_FIMV_H2R_CMD_OPEN_INSTANCE_V6); + } + + /* Close instance */ + static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + { + struct s5p_mfc_dev *dev = ctx->dev; +- struct s5p_mfc_cmd_args h2r_args; + int ret = 0; + + dev->curr_ctx = ctx->num; + if (ctx->state != MFCINST_FREE) { + mfc_write(dev, ctx->inst_no, S5P_FIMV_INSTANCE_ID_V6); + ret = s5p_mfc_cmd_host2risc_v6(dev, +- S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6, +- &h2r_args); ++ S5P_FIMV_H2R_CMD_CLOSE_INSTANCE_V6); + } else { + ret = -EINVAL; + } +@@ -153,9 +138,15 @@ static int s5p_mfc_close_inst_cmd_v6(struct s5p_mfc_ctx *ctx) + return ret; + } + ++static int s5p_mfc_cmd_host2risc_v6_args(struct s5p_mfc_dev *dev, int cmd, ++ const struct s5p_mfc_cmd_args *ignored) ++{ ++ return s5p_mfc_cmd_host2risc_v6(dev, cmd); ++} ++ + /* Initialize cmd function pointers for MFC v6 */ + static const struct s5p_mfc_hw_cmds s5p_mfc_cmds_v6 = { +- .cmd_host2risc = s5p_mfc_cmd_host2risc_v6, ++ .cmd_host2risc = s5p_mfc_cmd_host2risc_v6_args, + .sys_init_cmd = s5p_mfc_sys_init_cmd_v6, + .sleep_cmd = s5p_mfc_sleep_cmd_v6, + .wakeup_cmd = s5p_mfc_wakeup_cmd_v6, +-- +cgit v1.2.3 + diff --git a/patches/tip/series b/patches/tip/series index bc3e1116..9422882b 100644 --- a/patches/tip/series +++ b/patches/tip/series @@ -1,2 +1,2 @@ +7fa37ba25a1dfc084e24ea9acc14bf1fad8af14c.patch 87b07a1fbc6b5c23d3b3584ab4288bc9106d3274.patch -20250715_nathan_media_s5p_mfc_always_pass_null_to_s5p_mfc_cmd_host2risc_v6.patch