[PATCH] bus: fsl-mc: make fsl_mc_bus_type const

2024-08-22 Thread Kunwu Chan
From: Kunwu Chan Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the fsl_mc_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be m

[PATCH v2] powerpc/mm: Code cleanup for __hash_page_thp

2024-03-01 Thread Kunwu Chan
was trying to say. Signed-off-by: Kunwu Chan Suggested-by: Michael Ellerman Suggested-by: Aneesh Kumar K.V --- Changes to v2: - Replace dead code with a comment as Michael Ellerman said in https://lore.kernel.org/all/87h6hva4b0.fsf@mail.lhotse/#R - Improve commit msg --- arch/powerpc/m

Re: [PATCH] powerpc/mm: Code cleanup for __hash_page_thp

2024-02-29 Thread Kunwu Chan
Thanks all for the reply. On 2024/2/29 14:18, Michael Ellerman wrote: Aneesh Kumar K.V writes: Michael Ellerman writes: Kunwu Chan writes: On 2024/2/26 18:49, Michael Ellerman wrote: Kunwu Chan writes: This part was commented from commit 6d492ecc6489 ("powerpc/THP: Add code to h

Re: [PATCH] powerpc/mm: Code cleanup for __hash_page_thp

2024-02-27 Thread Kunwu Chan
Thanks for the reply. On 2024/2/27 14:07, Michael Ellerman wrote: Kunwu Chan writes: Thanks for the reply. On 2024/2/26 18:49, Michael Ellerman wrote: Kunwu Chan writes: This part was commented from commit 6d492ecc6489 ("powerpc/THP: Add code to handle HPTE faults for hugepages"

Re: [PATCH] powerpc/mm: Code cleanup for __hash_page_thp

2024-02-26 Thread Kunwu Chan
Thanks for the reply. On 2024/2/26 18:49, Michael Ellerman wrote: Kunwu Chan writes: This part was commented from commit 6d492ecc6489 ("powerpc/THP: Add code to handle HPTE faults for hugepages") in about 11 years before. If there are no plans to enable this part code in the futu

Re: [PATCH v2] powerpc/cell: Code cleanup for spufs_mfc_flush

2024-01-26 Thread Kunwu Chan
On 2024/1/26 14:27, Arnd Bergmann wrote: On Fri, Jan 26, 2024, at 03:12, Kunwu Chan wrote: This part was commented from commit a33a7d7309d7 ("[PATCH] spufs: implement mfc access for PPE-side DMA") in about 18 years before. If there are no plans to enable this part code in the futu

[PATCH] powerpc/pseries/pci: Code cleanup

2024-01-25 Thread Kunwu Chan
This part was commented in about 19 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/pseries/pci.c | 27 --- 1 file changed, 27 deletions(-) diff --git a/arch

[PATCH v2] powerpc/cell: Code cleanup for spufs_mfc_flush

2024-01-25 Thread Kunwu Chan
This part was commented from commit a33a7d7309d7 ("[PATCH] spufs: implement mfc access for PPE-side DMA") in about 18 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan Suggested-by: Christophe Leroy -

Re: [PATCH] powerpc/cell: Code cleanup for spufs_mfc_flush

2024-01-25 Thread Kunwu Chan
On 2024/1/25 18:41, Christophe Leroy wrote: Le 25/01/2024 à 11:08, Kunwu Chan a écrit : This part was commented from commit a33a7d7309d7 ("[PATCH] spufs: implement mfc access for PPE-side DMA") in about 18 years before. If there are no plans to enable this part code in the futu

Re: [PATCH] powerpc/mm/hash: Code cleanup

2024-01-25 Thread Kunwu Chan
On 2024/1/25 21:47, Aneesh Kumar K.V wrote: On 1/25/24 3:16 PM, Kunwu Chan wrote: This part was commented in about 17 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/include/asm/book3s/64

[PATCH] powerpc/mm/hash: Code cleanup

2024-01-25 Thread Kunwu Chan
This part was commented in about 17 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 22 --- 1 file changed, 22 deletions(-) diff --git a/arch

[PATCH] powerpc/mm: Code cleanup for __hash_page_thp

2024-01-25 Thread Kunwu Chan
This part was commented from commit 6d492ecc6489 ("powerpc/THP: Add code to handle HPTE faults for hugepages") in about 11 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/m

[PATCH] powerpc/cell: Code cleanup for spufs_mfc_flush

2024-01-25 Thread Kunwu Chan
This part was commented from commit a33a7d7309d7 ("[PATCH] spufs: implement mfc access for PPE-side DMA") in about 18 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/cell/sp

Re: [PATCH] KVM: PPC: code cleanup for kvmppc_book3s_irqprio_deliver

2024-01-25 Thread Kunwu Chan
On 2024/1/24 21:01, Christophe Leroy wrote: Le 24/01/2024 à 10:36, Kunwu Chan a écrit : This part was commented from commit 2f4cf5e42d13 ("Add book3s.c") in about 14 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off

[PATCH v2] KVM: PPC: code cleanup for kvmppc_book3s_irqprio_deliver

2024-01-25 Thread Kunwu Chan
This part was commented from commit 2f4cf5e42d13 ("Add book3s.c") in about 14 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- Change in v2: - Remove redundant blank line --- arch/powerpc/kvm/bo

[PATCH v2] powerpc/iommu: Code cleanup for cell/iommu.c

2024-01-25 Thread Kunwu Chan
This part was commented from commit 165785e5c0be ("[POWERPC] Cell iommu support") in about 17 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- Change in v2: - Remove the second blank line

Re: [PATCH] powerpc/iommu: Code cleanup for cell/iommu.c

2024-01-25 Thread Kunwu Chan
On 2024/1/25 14:49, Christophe Leroy wrote: Le 25/01/2024 à 03:46, Kunwu Chan a écrit : This part was commented from commit 165785e5c0be ("[POWERPC] Cell iommu support") in about 17 years before. If there are no plans to enable this part code in the future, we can remove this

[PATCH] powerpc/iommu: Code cleanup for cell/iommu.c

2024-01-24 Thread Kunwu Chan
This part was commented from commit 165785e5c0be ("[POWERPC] Cell iommu support") in about 17 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/cell/iommu.c | 16 -

[PATCH] KVM: PPC: code cleanup for kvmppc_book3s_irqprio_deliver

2024-01-24 Thread Kunwu Chan
This part was commented from commit 2f4cf5e42d13 ("Add book3s.c") in about 14 years before. If there are no plans to enable this part code in the future, we can remove this dead code. Signed-off-by: Kunwu Chan --- arch/powerpc/kvm/book3s.c | 3 --- 1 file changed, 3 deletions(-) di

[PATCH] powerpc/pasemi: Add a null pointer check to the pas_setup_mce_regs

2024-01-17 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/pasemi/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch

[PATCH] powerpc/83xx: Add a null pointer check to mcu_gpiochip_add

2024-01-15 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Cc: Kunwu Chan Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 2 ++ 1 file changed, 2 insertions

[PATCH v2] cxl: Fix null pointer dereference in cxl_get_fd

2024-01-11 Thread Kunwu Chan
Signed-off-by: Kunwu Chan Cc: Kunwu Chan Suggested-by: Frederic Barrat --- v2: Deal with error path --- drivers/misc/cxl/api.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c index d85c56530863..b49bc3d29

[PATCH] powerpc/powernv: Add a null pointer check to scom_debug_init_one

2023-12-08 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Add a null pointer check, and release 'ent' to avoid memory leaks. Fixes: bfd2f0d49aef ("powerpc/powernv: Get rid of old scom_controller abstraction") Cc: Kunwu Chan Signe

Re: [PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-05 Thread Kunwu Chan
if (rc) + return ERR_PTR(rc); return NULL; Thanks again, Kunwu On 2023/12/4 18:43, Frederic Barrat wrote: On 04/12/2023 03:07, Kunwu Chan wrote: kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a

[PATCH v3] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-12-03 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Suggested-by: Christophe Leroy Suggested-by: Michael Ellerman Signed-off-by: Kunwu Chan --- v2: Use "panic" instead

Re: [PATCH v2] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-12-03 Thread Kunwu Chan
Sure,i'll follow your suggestion in v3 patch: 1. set new to NULL 2. add a 'if' judgment before 'kmem_cache_create' Thanks, Kunwu On 2023/12/1 18:17, Michael Ellerman wrote: avoid two calls to panic

[PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-03 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan --- drivers/misc/cxl/api.c | 4 1 file changed, 4 insertions(+) diff --git a/dr

[PATCH v2] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-11-30 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Suggested-by: Christophe Leroy Suggested-by: Michael Ellerman Signed-off-by: Kunwu Chan --- v2: Use "panic" instead

Re: [PATCH] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-11-30 Thread Kunwu Chan
Thanks for your reply. Ok, I know what you mean, when name is NULL. The process should be aborted and the specific reason for the error should be printed, not just return. I will update v2 patch with "panic". Thanks again, Kunwu On 2023/11/28 19:32, Michael Ellerman wrote:

Re: [PATCH] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-11-26 Thread Kunwu Chan
inter check is no need here? Thanks, Kunwu On 2023/11/24 23:17, Christophe Leroy wrote: Le 22/11/2023 à 10:00, Kunwu Chan a écrit : [Vous ne recevez pas souvent de courriers de chen...@kylinos.cn. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] kasp

[PATCH] powerpc/powernv: Add a null pointer check in opal_event_init

2023-11-26 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: 2717a33d6074 ("powerpc/opal-irqchip: Use interrupt names if present") Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/powernv/opal-irqchip.c | 2 ++ 1 file changed, 2 insertion

[PATCH] powerpc/powernv: Fix null pointer dereference in opal_powercap_init

2023-11-26 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: b9ef7b4b867f ("powerpc: Convert to using %pOFn instead of device_node.name") Signed-off-by: Kunwu Chan --- arch/powerpc/platforms/powernv/opal-powercap.c | 6 ++ 1 file

[PATCH] powerpc/imc-pmu: Fix null pointer dereference in update_events_in_group

2023-11-26 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: 885dcd709ba9 ("powerpc/perf: Add nest IMC PMU support") Signed-off-by: Kunwu Chan --- arch/powerpc/perf/imc-pmu.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerp

[PATCH] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-11-22 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Signed-off-by: Kunwu Chan --- arch/powerpc/mm/init-common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/mm

[PATCH] powerpc/xics: Check return value of kasprintf in icp_native_map_one_cpu

2023-11-21 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Signed-off-by: Kunwu Chan --- arch/powerpc/sysdev/xics/icp-native.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch

[PATCH v2] treewide: Spelling fix in comment

2023-10-23 Thread Kunwu Chan
reques -> request Signed-off-by: Kunwu Chan --- drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c index dc14a6658

Re: [PATCH] treewide: Spelling fix in comment

2023-10-23 Thread Kunwu Chan
mmary should be something prefixed by "[net-next] ps3_gelic" On Fri, Oct 20, 2023 at 11:32 AM Kunwu Chan wrote: reques -> request Fixes: 09dde54c6a69 ("PS3: gelic: Add wireless support for PS3") No need for a Fixes tag for a spelling fix in a comment. Signed-off-by: Kunw

[PATCH] treewide: Spelling fix in comment

2023-10-21 Thread Kunwu Chan
reques -> request Fixes: 09dde54c6a69 ("PS3: gelic: Add wireless support for PS3") Signed-off-by: Kunwu Chan --- drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c