* [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
@ 2025-02-21 13:02 Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page() Zijun Hu
` (21 more replies)
0 siblings, 22 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
This patch series is to remove weird and needless 'return' for
void APIs under include/ with the following pattern:
api_header.h:
void api_func_a(...);
static inline void api_func_b(...)
{
return api_func_a(...);
}
Remove the needless 'return' in api_func_b().
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
Zijun Hu (18):
mm/mmu_gather: Remove needless return in void API tlb_remove_page()
cpu: Remove needless return in void API suspend_enable_secondary_cpus()
crypto: api - Remove needless return in void API crypto_free_tfm()
crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx()
sysfs: Remove needless return in void API sysfs_enable_ns()
skbuff: Remove needless return in void API consume_skb()
wifi: mac80211: Remove needless return in void API _ieee80211_hw_set()
net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns()
ipv4/igmp: Remove needless return in void API ip_mc_dec_group()
IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer()
ratelimit: Remove needless return in void API ratelimit_default_init()
siox: Remove needless return in void API siox_driver_unregister()
gpiolib: Remove needless return in two void APIs
PM: wakeup: Remove needless return in three void APIs
mfd: db8500-prcmu: Remove needless return in three void APIs
rhashtable: Remove needless return in three void APIs
dma-mapping: Remove needless return in five void APIs
mtd: nand: Do not return void function in void function
include/asm-generic/tlb.h | 2 +-
include/crypto/internal/scompress.h | 2 +-
include/linux/cpu.h | 2 +-
include/linux/crypto.h | 2 +-
include/linux/dma-mapping.h | 12 ++++++------
include/linux/gpio.h | 4 ++--
include/linux/igmp.h | 2 +-
include/linux/mfd/dbx500-prcmu.h | 6 +++---
include/linux/mtd/nand.h | 18 ++++++++++++------
include/linux/pm_wakeup.h | 6 +++---
include/linux/ratelimit.h | 4 ++--
include/linux/rhashtable.h | 6 +++---
include/linux/siox.h | 2 +-
include/linux/skbuff.h | 2 +-
include/linux/sysfs.h | 2 +-
include/net/mac80211.h | 2 +-
include/net/pkt_sched.h | 2 +-
include/rdma/rdmavt_qp.h | 2 +-
18 files changed, 42 insertions(+), 36 deletions(-)
---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250221-rmv_return-f1dc82d492f0
Best regards,
--
Zijun Hu <quic_zijuhu@quicinc.com>
^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 20:01 ` Peter Zijlstra
2025-02-21 13:02 ` [PATCH *-next 02/18] cpu: Remove needless return in void API suspend_enable_secondary_cpus() Zijun Hu
` (20 subsequent siblings)
21 siblings, 1 reply; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API tlb_remove_page() since both the
API and tlb_remove_page_size() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/asm-generic/tlb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index e402aef79c93..812110813b84 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -501,7 +501,7 @@ static __always_inline bool __tlb_remove_page(struct mmu_gather *tlb,
*/
static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
{
- return tlb_remove_page_size(tlb, page, PAGE_SIZE);
+ tlb_remove_page_size(tlb, page, PAGE_SIZE);
}
static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 02/18] cpu: Remove needless return in void API suspend_enable_secondary_cpus()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 03/18] crypto: api - Remove needless return in void API crypto_free_tfm() Zijun Hu
` (19 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API suspend_enable_secondary_cpus()
since both the API and thaw_secondary_cpus() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/cpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 6a0a8f1c7c90..e3049543008b 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -148,7 +148,7 @@ static inline int suspend_disable_secondary_cpus(void)
}
static inline void suspend_enable_secondary_cpus(void)
{
- return thaw_secondary_cpus();
+ thaw_secondary_cpus();
}
#else /* !CONFIG_PM_SLEEP_SMP */
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 03/18] crypto: api - Remove needless return in void API crypto_free_tfm()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 02/18] cpu: Remove needless return in void API suspend_enable_secondary_cpus() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 04/18] crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx() Zijun Hu
` (18 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API crypto_free_tfm() since
both the API and crypto_destroy_tfm() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/crypto.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index b164da5e129e..90ac1142b1a2 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -446,7 +446,7 @@ void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);
static inline void crypto_free_tfm(struct crypto_tfm *tfm)
{
- return crypto_destroy_tfm(tfm, tfm);
+ crypto_destroy_tfm(tfm, tfm);
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 04/18] crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (2 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 03/18] crypto: api - Remove needless return in void API crypto_free_tfm() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 05/18] sysfs: Remove needless return in void API sysfs_enable_ns() Zijun Hu
` (17 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API crypto_scomp_free_ctx() since both
the API and crypto_scomp_alg(@tfm)->free_ctx() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/crypto/internal/scompress.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/crypto/internal/scompress.h b/include/crypto/internal/scompress.h
index 07a10fd2d321..44130680dc0a 100644
--- a/include/crypto/internal/scompress.h
+++ b/include/crypto/internal/scompress.h
@@ -79,7 +79,7 @@ static inline void *crypto_scomp_alloc_ctx(struct crypto_scomp *tfm)
static inline void crypto_scomp_free_ctx(struct crypto_scomp *tfm,
void *ctx)
{
- return crypto_scomp_alg(tfm)->free_ctx(tfm, ctx);
+ crypto_scomp_alg(tfm)->free_ctx(tfm, ctx);
}
static inline int crypto_scomp_compress(struct crypto_scomp *tfm,
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 05/18] sysfs: Remove needless return in void API sysfs_enable_ns()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (3 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 04/18] crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 06/18] skbuff: Remove needless return in void API consume_skb() Zijun Hu
` (16 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API sysfs_enable_ns() since
both the API and kernfs_enable_ns() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/sysfs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 18f7e1fd093c..ad5015876c70 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -491,7 +491,7 @@ int __must_check sysfs_init(void);
static inline void sysfs_enable_ns(struct kernfs_node *kn)
{
- return kernfs_enable_ns(kn);
+ kernfs_enable_ns(kn);
}
int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 06/18] skbuff: Remove needless return in void API consume_skb()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (4 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 05/18] sysfs: Remove needless return in void API sysfs_enable_ns() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 07/18] wifi: mac80211: Remove needless return in void API _ieee80211_hw_set() Zijun Hu
` (15 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API consume_skb() since
both the API and kfree_skb() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/skbuff.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bb2b751d274a..33bf30bc16f5 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1296,7 +1296,7 @@ void consume_skb(struct sk_buff *skb);
#else
static inline void consume_skb(struct sk_buff *skb)
{
- return kfree_skb(skb);
+ kfree_skb(skb);
}
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 07/18] wifi: mac80211: Remove needless return in void API _ieee80211_hw_set()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (5 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 06/18] skbuff: Remove needless return in void API consume_skb() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 08/18] net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns() Zijun Hu
` (14 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API _ieee80211_hw_set()
since both the API and __set_bit() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/net/mac80211.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c3ed2fcff8b7..3a654e9f41db 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3091,7 +3091,7 @@ static inline bool _ieee80211_hw_check(struct ieee80211_hw *hw,
static inline void _ieee80211_hw_set(struct ieee80211_hw *hw,
enum ieee80211_hw_flags flg)
{
- return __set_bit(flg, hw->flags);
+ __set_bit(flg, hw->flags);
}
#define ieee80211_hw_set(hw, flg) _ieee80211_hw_set(hw, IEEE80211_HW_##flg)
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 08/18] net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (6 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 07/18] wifi: mac80211: Remove needless return in void API _ieee80211_hw_set() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 09/18] ipv4/igmp: Remove needless return in void API ip_mc_dec_group() Zijun Hu
` (13 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API qdisc_watchdog_schedule_ns() since
both the API and qdisc_watchdog_schedule_range_ns() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/net/pkt_sched.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index d7b7b6cd4aa1..b4d9ea54d947 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -78,7 +78,7 @@ void qdisc_watchdog_schedule_range_ns(struct qdisc_watchdog *wd, u64 expires,
static inline void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd,
u64 expires)
{
- return qdisc_watchdog_schedule_range_ns(wd, expires, 0ULL);
+ qdisc_watchdog_schedule_range_ns(wd, expires, 0ULL);
}
static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 09/18] ipv4/igmp: Remove needless return in void API ip_mc_dec_group()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (7 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 08/18] net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 10/18] IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer() Zijun Hu
` (12 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API ip_mc_dec_group() since
both the API and __ip_mc_dec_group() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/igmp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 073b30a9b850..dddf90c55215 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -135,7 +135,7 @@ extern void ip_mc_remap(struct in_device *);
extern void __ip_mc_dec_group(struct in_device *in_dev, __be32 addr, gfp_t gfp);
static inline void ip_mc_dec_group(struct in_device *in_dev, __be32 addr)
{
- return __ip_mc_dec_group(in_dev, addr, GFP_KERNEL);
+ __ip_mc_dec_group(in_dev, addr, GFP_KERNEL);
}
extern void __ip_mc_inc_group(struct in_device *in_dev, __be32 addr,
gfp_t gfp);
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 10/18] IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (8 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 09/18] ipv4/igmp: Remove needless return in void API ip_mc_dec_group() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 11/18] ratelimit: Remove needless return in void API ratelimit_default_init() Zijun Hu
` (11 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API rvt_mod_retry_timer() since
both the API and rvt_mod_retry_timer_ext() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/rdma/rdmavt_qp.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/rdma/rdmavt_qp.h b/include/rdma/rdmavt_qp.h
index d67892944193..6b9ee610168c 100644
--- a/include/rdma/rdmavt_qp.h
+++ b/include/rdma/rdmavt_qp.h
@@ -735,7 +735,7 @@ static inline void rvt_mod_retry_timer_ext(struct rvt_qp *qp, u8 shift)
static inline void rvt_mod_retry_timer(struct rvt_qp *qp)
{
- return rvt_mod_retry_timer_ext(qp, 0);
+ rvt_mod_retry_timer_ext(qp, 0);
}
/**
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 11/18] ratelimit: Remove needless return in void API ratelimit_default_init()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (9 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 10/18] IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 12/18] siox: Remove needless return in void API siox_driver_unregister() Zijun Hu
` (10 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API ratelimit_default_init()
since both the API and ratelimit_state_init() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/ratelimit.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index b17e0cd0a30c..5308cdf43056 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -18,8 +18,8 @@ static inline void ratelimit_state_init(struct ratelimit_state *rs,
static inline void ratelimit_default_init(struct ratelimit_state *rs)
{
- return ratelimit_state_init(rs, DEFAULT_RATELIMIT_INTERVAL,
- DEFAULT_RATELIMIT_BURST);
+ ratelimit_state_init(rs, DEFAULT_RATELIMIT_INTERVAL,
+ DEFAULT_RATELIMIT_BURST);
}
static inline void ratelimit_state_exit(struct ratelimit_state *rs)
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 12/18] siox: Remove needless return in void API siox_driver_unregister()
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (10 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 11/18] ratelimit: Remove needless return in void API ratelimit_default_init() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs Zijun Hu
` (9 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in void API siox_driver_unregister()
since both the API and driver_unregister() are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/siox.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/siox.h b/include/linux/siox.h
index 6bfbda3f634c..31a20ba03d3a 100644
--- a/include/linux/siox.h
+++ b/include/linux/siox.h
@@ -70,7 +70,7 @@ static inline int siox_driver_register(struct siox_driver *sdriver)
static inline void siox_driver_unregister(struct siox_driver *sdriver)
{
- return driver_unregister(&sdriver->driver);
+ driver_unregister(&sdriver->driver);
}
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (11 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 12/18] siox: Remove needless return in void API siox_driver_unregister() Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:06 ` Bartosz Golaszewski
2025-02-21 13:02 ` [PATCH *-next 14/18] PM: wakeup: Remove needless return in three " Zijun Hu
` (8 subsequent siblings)
21 siblings, 1 reply; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in the following void APIs:
gpio_set_value_cansleep()
gpio_set_value()
Since both the API and callee involved are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/gpio.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 6270150f4e29..c1ec62c11ed3 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -91,7 +91,7 @@ static inline int gpio_get_value_cansleep(unsigned gpio)
}
static inline void gpio_set_value_cansleep(unsigned gpio, int value)
{
- return gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value);
+ gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value);
}
static inline int gpio_get_value(unsigned gpio)
@@ -100,7 +100,7 @@ static inline int gpio_get_value(unsigned gpio)
}
static inline void gpio_set_value(unsigned gpio, int value)
{
- return gpiod_set_raw_value(gpio_to_desc(gpio), value);
+ gpiod_set_raw_value(gpio_to_desc(gpio), value);
}
static inline int gpio_to_irq(unsigned gpio)
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 14/18] PM: wakeup: Remove needless return in three void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (12 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-26 17:06 ` Rafael J. Wysocki
2025-02-21 13:02 ` [PATCH *-next 15/18] mfd: db8500-prcmu: " Zijun Hu
` (7 subsequent siblings)
21 siblings, 1 reply; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in the following void APIs:
__pm_wakeup_event()
pm_wakeup_event()
pm_wakeup_hard_event()
Since both the API and callee involved are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/pm_wakeup.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index d501c09c60cd..51e0e8dd5f9e 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -205,17 +205,17 @@ static inline void device_set_awake_path(struct device *dev)
static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
{
- return pm_wakeup_ws_event(ws, msec, false);
+ pm_wakeup_ws_event(ws, msec, false);
}
static inline void pm_wakeup_event(struct device *dev, unsigned int msec)
{
- return pm_wakeup_dev_event(dev, msec, false);
+ pm_wakeup_dev_event(dev, msec, false);
}
static inline void pm_wakeup_hard_event(struct device *dev)
{
- return pm_wakeup_dev_event(dev, 0, true);
+ pm_wakeup_dev_event(dev, 0, true);
}
/**
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 15/18] mfd: db8500-prcmu: Remove needless return in three void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (13 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 14/18] PM: wakeup: Remove needless return in three " Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-27 23:12 ` Linus Walleij
2025-03-13 13:03 ` (subset) " Lee Jones
2025-02-21 13:02 ` [PATCH *-next 16/18] rhashtable: " Zijun Hu
` (6 subsequent siblings)
21 siblings, 2 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in the following void APIs:
prcmu_early_init()
prcmu_system_reset()
prcmu_modem_reset()
Since both the API and callee involved are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/mfd/dbx500-prcmu.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index dd0fc891b228..98567623c9df 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -215,7 +215,7 @@ struct prcmu_fw_version {
static inline void prcmu_early_init(void)
{
- return db8500_prcmu_early_init();
+ db8500_prcmu_early_init();
}
static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
@@ -302,7 +302,7 @@ static inline int prcmu_request_ape_opp_100_voltage(bool enable)
static inline void prcmu_system_reset(u16 reset_code)
{
- return db8500_prcmu_system_reset(reset_code);
+ db8500_prcmu_system_reset(reset_code);
}
static inline u16 prcmu_get_reset_code(void)
@@ -314,7 +314,7 @@ int prcmu_ac_wake_req(void);
void prcmu_ac_sleep_req(void);
static inline void prcmu_modem_reset(void)
{
- return db8500_prcmu_modem_reset();
+ db8500_prcmu_modem_reset();
}
static inline bool prcmu_is_ac_wake_requested(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 16/18] rhashtable: Remove needless return in three void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (14 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 15/18] mfd: db8500-prcmu: " Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 17/18] dma-mapping: Remove needless return in five " Zijun Hu
` (5 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in the following void APIs:
rhltable_walk_enter()
rhltable_free_and_destroy()
rhltable_destroy()
Since both the API and callee involved are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/rhashtable.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index 8463a128e2f4..6c85b28ea30b 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -1259,7 +1259,7 @@ static inline int rhashtable_replace_fast(
static inline void rhltable_walk_enter(struct rhltable *hlt,
struct rhashtable_iter *iter)
{
- return rhashtable_walk_enter(&hlt->ht, iter);
+ rhashtable_walk_enter(&hlt->ht, iter);
}
/**
@@ -1275,12 +1275,12 @@ static inline void rhltable_free_and_destroy(struct rhltable *hlt,
void *arg),
void *arg)
{
- return rhashtable_free_and_destroy(&hlt->ht, free_fn, arg);
+ rhashtable_free_and_destroy(&hlt->ht, free_fn, arg);
}
static inline void rhltable_destroy(struct rhltable *hlt)
{
- return rhltable_free_and_destroy(hlt, NULL, NULL);
+ rhltable_free_and_destroy(hlt, NULL, NULL);
}
#endif /* _LINUX_RHASHTABLE_H */
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 17/18] dma-mapping: Remove needless return in five void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (15 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 16/18] rhashtable: " Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 18/18] mtd: nand: Do not return void function in void function Zijun Hu
` (4 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
Remove needless 'return' in the following void APIs:
dma_unmap_single_attrs()
dma_sync_single_range_for_cpu()
dma_sync_single_range_for_device()
dma_free_coherent()
dma_free_wc()
Since both the API and callee involved are void functions.
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/dma-mapping.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index b79925b1c433..a5de6ecaace3 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -388,21 +388,21 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr,
size_t size, enum dma_data_direction dir, unsigned long attrs)
{
- return dma_unmap_page_attrs(dev, addr, size, dir, attrs);
+ dma_unmap_page_attrs(dev, addr, size, dir, attrs);
}
static inline void dma_sync_single_range_for_cpu(struct device *dev,
dma_addr_t addr, unsigned long offset, size_t size,
enum dma_data_direction dir)
{
- return dma_sync_single_for_cpu(dev, addr + offset, size, dir);
+ dma_sync_single_for_cpu(dev, addr + offset, size, dir);
}
static inline void dma_sync_single_range_for_device(struct device *dev,
dma_addr_t addr, unsigned long offset, size_t size,
enum dma_data_direction dir)
{
- return dma_sync_single_for_device(dev, addr + offset, size, dir);
+ dma_sync_single_for_device(dev, addr + offset, size, dir);
}
/**
@@ -478,7 +478,7 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,
static inline void dma_free_coherent(struct device *dev, size_t size,
void *cpu_addr, dma_addr_t dma_handle)
{
- return dma_free_attrs(dev, size, cpu_addr, dma_handle, 0);
+ dma_free_attrs(dev, size, cpu_addr, dma_handle, 0);
}
@@ -606,8 +606,8 @@ static inline void *dma_alloc_wc(struct device *dev, size_t size,
static inline void dma_free_wc(struct device *dev, size_t size,
void *cpu_addr, dma_addr_t dma_addr)
{
- return dma_free_attrs(dev, size, cpu_addr, dma_addr,
- DMA_ATTR_WRITE_COMBINE);
+ dma_free_attrs(dev, size, cpu_addr, dma_addr,
+ DMA_ATTR_WRITE_COMBINE);
}
static inline int dma_mmap_wc(struct device *dev,
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* [PATCH *-next 18/18] mtd: nand: Do not return void function in void function
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (16 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 17/18] dma-mapping: Remove needless return in five " Zijun Hu
@ 2025-02-21 13:02 ` Zijun Hu
2025-02-21 13:12 ` [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Greg Kroah-Hartman
` (3 subsequent siblings)
21 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:02 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd, Zijun Hu
In the following three void APIs:
nanddev_pos_next_lun()
nanddev_pos_next_eraseblock()
nanddev_pos_next_page()
For void function void func(...), convert weird statement:
return func(...);
"to":
func(...);
return;
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
include/linux/mtd/nand.h | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 0e2f228e8b4a..8e3f6cca0b24 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -863,8 +863,10 @@ static inline void nanddev_pos_next_target(struct nand_device *nand,
static inline void nanddev_pos_next_lun(struct nand_device *nand,
struct nand_pos *pos)
{
- if (pos->lun >= nand->memorg.luns_per_target - 1)
- return nanddev_pos_next_target(nand, pos);
+ if (pos->lun >= nand->memorg.luns_per_target - 1) {
+ nanddev_pos_next_target(nand, pos);
+ return;
+ }
pos->lun++;
pos->page = 0;
@@ -883,8 +885,10 @@ static inline void nanddev_pos_next_lun(struct nand_device *nand,
static inline void nanddev_pos_next_eraseblock(struct nand_device *nand,
struct nand_pos *pos)
{
- if (pos->eraseblock >= nand->memorg.eraseblocks_per_lun - 1)
- return nanddev_pos_next_lun(nand, pos);
+ if (pos->eraseblock >= nand->memorg.eraseblocks_per_lun - 1) {
+ nanddev_pos_next_lun(nand, pos);
+ return;
+ }
pos->eraseblock++;
pos->page = 0;
@@ -902,8 +906,10 @@ static inline void nanddev_pos_next_eraseblock(struct nand_device *nand,
static inline void nanddev_pos_next_page(struct nand_device *nand,
struct nand_pos *pos)
{
- if (pos->page >= nand->memorg.pages_per_eraseblock - 1)
- return nanddev_pos_next_eraseblock(nand, pos);
+ if (pos->page >= nand->memorg.pages_per_eraseblock - 1) {
+ nanddev_pos_next_eraseblock(nand, pos);
+ return;
+ }
pos->page++;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs
2025-02-21 13:02 ` [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs Zijun Hu
@ 2025-02-21 13:06 ` Bartosz Golaszewski
2025-02-21 13:12 ` Zijun Hu
0 siblings, 1 reply; 42+ messages in thread
From: Bartosz Golaszewski @ 2025-02-21 13:06 UTC (permalink / raw)
To: Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij, Lee Jones,
Thomas Graf, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Zijun Hu,
linux-arch, linux-mm, linux-kernel, linux-crypto, netdev,
linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On Fri, Feb 21, 2025 at 2:02 PM Zijun Hu <quic_zijuhu@quicinc.com> wrote:
>
> Remove needless 'return' in the following void APIs:
>
> gpio_set_value_cansleep()
> gpio_set_value()
>
> Since both the API and callee involved are void functions.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
That would normally make sense but we're getting that reworked[1] in
this very cycle so please drop this patch from your series.
Bart
[1] https://lore.kernel.org/linux-gpio/20250220-gpio-set-retval-v2-0-bc4cfd38dae3@linaro.org/
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs
2025-02-21 13:06 ` Bartosz Golaszewski
@ 2025-02-21 13:12 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:12 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij, Lee Jones,
Thomas Graf, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Zijun Hu,
linux-arch, linux-mm, linux-kernel, linux-crypto, netdev,
linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On 2/21/2025 9:06 PM, Bartosz Golaszewski wrote:
> On Fri, Feb 21, 2025 at 2:02 PM Zijun Hu <quic_zijuhu@quicinc.com> wrote:
>>
>> Remove needless 'return' in the following void APIs:
>>
>> gpio_set_value_cansleep()
>> gpio_set_value()
>>
>> Since both the API and callee involved are void functions.
>>
>> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
>> ---
>
> That would normally make sense but we're getting that reworked[1] in
> this very cycle so please drop this patch from your series.
>
sure, will drop it in next revision.
> Bart
>
> [1] https://lore.kernel.org/linux-gpio/20250220-gpio-set-retval-v2-0-bc4cfd38dae3@linaro.org/
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (17 preceding siblings ...)
2025-02-21 13:02 ` [PATCH *-next 18/18] mtd: nand: Do not return void function in void function Zijun Hu
@ 2025-02-21 13:12 ` Greg Kroah-Hartman
2025-02-21 13:15 ` Zijun Hu
2025-02-21 15:40 ` Arnd Bergmann
` (2 subsequent siblings)
21 siblings, 1 reply; 42+ messages in thread
From: Greg Kroah-Hartman @ 2025-02-21 13:12 UTC (permalink / raw)
To: Zijun Hu
Cc: Will Deacon, Aneesh Kumar K.V, Andrew Morton, Nick Piggin,
Peter Zijlstra, Arnd Bergmann, Thomas Gleixner, Herbert Xu,
David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Zijun Hu, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On Fri, Feb 21, 2025 at 05:02:05AM -0800, Zijun Hu wrote:
> This patch series is to remove weird and needless 'return' for
> void APIs under include/ with the following pattern:
>
> api_header.h:
>
> void api_func_a(...);
>
> static inline void api_func_b(...)
> {
> return api_func_a(...);
> }
>
> Remove the needless 'return' in api_func_b().
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> Zijun Hu (18):
> mm/mmu_gather: Remove needless return in void API tlb_remove_page()
> cpu: Remove needless return in void API suspend_enable_secondary_cpus()
> crypto: api - Remove needless return in void API crypto_free_tfm()
> crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx()
> sysfs: Remove needless return in void API sysfs_enable_ns()
> skbuff: Remove needless return in void API consume_skb()
> wifi: mac80211: Remove needless return in void API _ieee80211_hw_set()
> net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns()
> ipv4/igmp: Remove needless return in void API ip_mc_dec_group()
> IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer()
> ratelimit: Remove needless return in void API ratelimit_default_init()
> siox: Remove needless return in void API siox_driver_unregister()
> gpiolib: Remove needless return in two void APIs
> PM: wakeup: Remove needless return in three void APIs
> mfd: db8500-prcmu: Remove needless return in three void APIs
> rhashtable: Remove needless return in three void APIs
> dma-mapping: Remove needless return in five void APIs
> mtd: nand: Do not return void function in void function
These span loads of different subsystems, please just submit them all to
the different subsystems directly, not as one big patch series which
none of us could take individually.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 13:12 ` [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Greg Kroah-Hartman
@ 2025-02-21 13:15 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-21 13:15 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Will Deacon, Aneesh Kumar K.V, Andrew Morton, Nick Piggin,
Peter Zijlstra, Arnd Bergmann, Thomas Gleixner, Herbert Xu,
David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Zijun Hu, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2/21/2025 9:12 PM, Greg Kroah-Hartman wrote:
> These span loads of different subsystems, please just submit them all to
> the different subsystems directly, not as one big patch series which
> none of us could take individually.
>
sure. will do it as you suggest.
thank you.
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (18 preceding siblings ...)
2025-02-21 13:12 ` [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Greg Kroah-Hartman
@ 2025-02-21 15:40 ` Arnd Bergmann
2025-02-22 10:38 ` Zijun Hu
2025-02-21 19:00 ` Stephen Hemminger
2025-02-27 12:48 ` Zijun Hu
21 siblings, 1 reply; 42+ messages in thread
From: Arnd Bergmann @ 2025-02-21 15:40 UTC (permalink / raw)
To: Zijun Hu, Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V,
Andrew Morton, Nicholas Piggin, Peter Zijlstra, Thomas Gleixner,
Herbert Xu, David S . Miller, Rafael J . Wysocki,
Danilo Krummrich, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Johannes Berg, Jamal Hadi Salim, Cong Wang,
Jiri Pirko, Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Zijun Hu, Linux-Arch, linux-mm, linux-kernel, linux-crypto,
Netdev, linux-wireless, linux-rdma, open list:GPIO SUBSYSTEM,
linux-pm, iommu, linux-mtd
On Fri, Feb 21, 2025, at 14:02, Zijun Hu wrote:
> This patch series is to remove weird and needless 'return' for
> void APIs under include/ with the following pattern:
>
> api_header.h:
>
> void api_func_a(...);
>
> static inline void api_func_b(...)
> {
> return api_func_a(...);
> }
>
> Remove the needless 'return' in api_func_b().
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
I have no objection to the changes, but I think you should
describe the motivation for them beyond them being 'weird'.
Do these 'return' statements get in the way of some other
work you are doing? Is there a compiler warning you want
to enable to ensure they don't come back? Is this all of
the instances in the kernel or just the ones you found by
inspection?
Arnd
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (19 preceding siblings ...)
2025-02-21 15:40 ` Arnd Bergmann
@ 2025-02-21 19:00 ` Stephen Hemminger
2025-02-21 19:36 ` Johannes Berg
2025-02-27 12:48 ` Zijun Hu
21 siblings, 1 reply; 42+ messages in thread
From: Stephen Hemminger @ 2025-02-21 19:00 UTC (permalink / raw)
To: Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Zijun Hu, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On Fri, 21 Feb 2025 05:02:05 -0800
Zijun Hu <quic_zijuhu@quicinc.com> wrote:
> This patch series is to remove weird and needless 'return' for
> void APIs under include/ with the following pattern:
>
> api_header.h:
>
> void api_func_a(...);
>
> static inline void api_func_b(...)
> {
> return api_func_a(...);
> }
>
> Remove the needless 'return' in api_func_b().
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> Zijun Hu (18):
> mm/mmu_gather: Remove needless return in void API tlb_remove_page()
> cpu: Remove needless return in void API suspend_enable_secondary_cpus()
> crypto: api - Remove needless return in void API crypto_free_tfm()
> crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx()
> sysfs: Remove needless return in void API sysfs_enable_ns()
> skbuff: Remove needless return in void API consume_skb()
> wifi: mac80211: Remove needless return in void API _ieee80211_hw_set()
> net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns()
> ipv4/igmp: Remove needless return in void API ip_mc_dec_group()
> IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer()
> ratelimit: Remove needless return in void API ratelimit_default_init()
> siox: Remove needless return in void API siox_driver_unregister()
> gpiolib: Remove needless return in two void APIs
> PM: wakeup: Remove needless return in three void APIs
> mfd: db8500-prcmu: Remove needless return in three void APIs
> rhashtable: Remove needless return in three void APIs
> dma-mapping: Remove needless return in five void APIs
> mtd: nand: Do not return void function in void function
>
> include/asm-generic/tlb.h | 2 +-
> include/crypto/internal/scompress.h | 2 +-
> include/linux/cpu.h | 2 +-
> include/linux/crypto.h | 2 +-
> include/linux/dma-mapping.h | 12 ++++++------
> include/linux/gpio.h | 4 ++--
> include/linux/igmp.h | 2 +-
> include/linux/mfd/dbx500-prcmu.h | 6 +++---
> include/linux/mtd/nand.h | 18 ++++++++++++------
> include/linux/pm_wakeup.h | 6 +++---
> include/linux/ratelimit.h | 4 ++--
> include/linux/rhashtable.h | 6 +++---
> include/linux/siox.h | 2 +-
> include/linux/skbuff.h | 2 +-
> include/linux/sysfs.h | 2 +-
> include/net/mac80211.h | 2 +-
> include/net/pkt_sched.h | 2 +-
> include/rdma/rdmavt_qp.h | 2 +-
> 18 files changed, 42 insertions(+), 36 deletions(-)
> ---
> base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> change-id: 20250221-rmv_return-f1dc82d492f0
>
> Best regards,
Is this something that could be done with a coccinelle script?
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 19:00 ` Stephen Hemminger
@ 2025-02-21 19:36 ` Johannes Berg
2025-02-22 10:51 ` Zijun Hu
0 siblings, 1 reply; 42+ messages in thread
From: Johannes Berg @ 2025-02-21 19:36 UTC (permalink / raw)
To: Stephen Hemminger, Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Jamal Hadi Salim, Cong Wang, Jiri Pirko, Jason Gunthorpe,
Leon Romanovsky, Linus Walleij, Bartosz Golaszewski, Lee Jones,
Thomas Graf, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Zijun Hu,
linux-arch, linux-mm, linux-kernel, linux-crypto, netdev,
linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On Fri, 2025-02-21 at 11:00 -0800, Stephen Hemminger wrote:
>
> Is this something that could be done with a coccinelle script?
>
Almost enough to do this:
@@
identifier fn;
expression E;
@@
void fn(...)
{
...
-return
E;
}
It takes a long time to run though, and does some wrong things as well:
if the return is in the middle of the function, it still matches and
removes it erroneously.
johannes
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-21 13:02 ` [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page() Zijun Hu
@ 2025-02-21 20:01 ` Peter Zijlstra
2025-02-22 11:00 ` Zijun Hu
2025-02-25 15:16 ` David Howells
0 siblings, 2 replies; 42+ messages in thread
From: Peter Zijlstra @ 2025-02-21 20:01 UTC (permalink / raw)
To: Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Arnd Bergmann, Thomas Gleixner, Herbert Xu,
David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Zijun Hu, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On Fri, Feb 21, 2025 at 05:02:06AM -0800, Zijun Hu wrote:
> Remove needless 'return' in void API tlb_remove_page() since both the
> API and tlb_remove_page_size() are void functions.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> include/asm-generic/tlb.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
> index e402aef79c93..812110813b84 100644
> --- a/include/asm-generic/tlb.h
> +++ b/include/asm-generic/tlb.h
> @@ -501,7 +501,7 @@ static __always_inline bool __tlb_remove_page(struct mmu_gather *tlb,
> */
> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
> {
> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
> }
So I don't mind removing it, but note that that return enforces
tlb_remove_page_size() has void return type.
It might not be your preferred coding style, but it is not completely
pointless.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 15:40 ` Arnd Bergmann
@ 2025-02-22 10:38 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-22 10:38 UTC (permalink / raw)
To: Arnd Bergmann, Zijun Hu, Greg Kroah-Hartman, Will Deacon,
Aneesh Kumar K.V, Andrew Morton, Nicholas Piggin, Peter Zijlstra,
Thomas Gleixner, Herbert Xu, David S . Miller, Rafael J . Wysocki,
Danilo Krummrich, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Johannes Berg, Jamal Hadi Salim, Cong Wang,
Jiri Pirko, Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: Linux-Arch, linux-mm, linux-kernel, linux-crypto, Netdev,
linux-wireless, linux-rdma, open list:GPIO SUBSYSTEM, linux-pm,
iommu, linux-mtd
On 2025/2/21 23:40, Arnd Bergmann wrote:
>> This patch series is to remove weird and needless 'return' for
>> void APIs under include/ with the following pattern:
>>
>> api_header.h:
>>
>> void api_func_a(...);
>>
>> static inline void api_func_b(...)
>> {
>> return api_func_a(...);
>> }
>>
>> Remove the needless 'return' in api_func_b().
>>
>> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> I have no objection to the changes, but I think you should
> describe the motivation for them beyond them being 'weird'.
>
yes. C spec such as C17 have this description about return
statement:
6.8.6.4:
A return statement with an expression shall not appear in a function
whose return type is void. A return statement without an expression
shall only appear in a function whose return type is void.
do we need to treat below return statement as bad code style ?
void api_func_a(...);
void api_func_b(...) {
...
return api_func_a(...); // return void function in void func
...
}
> Do these 'return' statements get in the way of some other
> work you are doing? Is there a compiler warning you want
> to enable to ensure they don't come back? Is this all of
> the instances in the kernel or just the ones you found by
> inspection?
actually, i find this weird return usage by reading code by accident
in driver core firstly:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-testing&id=a44073c28bc6d4118891d61e31c9fa9dc4333dc0
then i check folder include/ and work out this patch series.
not sure if there are still such instances in current kernel tree.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 19:36 ` Johannes Berg
@ 2025-02-22 10:51 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-22 10:51 UTC (permalink / raw)
To: Johannes Berg, Stephen Hemminger, Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Jamal Hadi Salim, Cong Wang, Jiri Pirko, Jason Gunthorpe,
Leon Romanovsky, Linus Walleij, Bartosz Golaszewski, Lee Jones,
Thomas Graf, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
linux-arch, linux-mm, linux-kernel, linux-crypto, netdev,
linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On 2025/2/22 03:36, Johannes Berg wrote:
> On Fri, 2025-02-21 at 11:00 -0800, Stephen Hemminger wrote:
>> Is this something that could be done with a coccinelle script?
>>
> Almost enough to do this:
>
> @@
> identifier fn;
> expression E;
> @@
> void fn(...)
> {
> ...
> -return
> E;
> }
>
>
> It takes a long time to run though, and does some wrong things as well:
> if the return is in the middle of the function, it still matches and
> removes it erroneously.
if return is in the middle, we may need to convert the return statement
in to two statement as [PATCH 18/18] does:
https://lore.kernel.org/all/20250221-rmv_return-v1-18-cc8dff275827@quicinc.com/
namely, Convert "return func(...);" to "func(...); return;"
C spec such as C17 have this description about return
statement:
6.8.6.4:
A return statement with an expression shall not appear in a function
whose return type is void. A return statement without an expression
shall only appear in a function whose return type is void.
so, do we need to treat "return void function in void function" as
bad code style and make coccinelle script check this bad usage?
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-21 20:01 ` Peter Zijlstra
@ 2025-02-22 11:00 ` Zijun Hu
2025-02-24 13:23 ` Peter Zijlstra
2025-02-25 15:16 ` David Howells
1 sibling, 1 reply; 42+ messages in thread
From: Zijun Hu @ 2025-02-22 11:00 UTC (permalink / raw)
To: Peter Zijlstra, Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Arnd Bergmann, Thomas Gleixner, Herbert Xu,
David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2025/2/22 04:01, Peter Zijlstra wrote:
>> */
>> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
>> {
>> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
>> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
>> }
> So I don't mind removing it, but note that that return enforces
> tlb_remove_page_size() has void return type.
>
tlb_remove_page_size() is void function already. (^^)
> It might not be your preferred coding style, but it is not completely
> pointless.
based on below C spec such as C17 description. i guess language C does
not like this usage "return void function in void function";
C spec such as C17 have this description about return
statement:
6.8.6.4:
A return statement with an expression shall not appear in a function
whose return type is void. A return statement without an expression
shall only appear in a function whose return type is void.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-22 11:00 ` Zijun Hu
@ 2025-02-24 13:23 ` Peter Zijlstra
2025-02-24 14:45 ` Zijun Hu
0 siblings, 1 reply; 42+ messages in thread
From: Peter Zijlstra @ 2025-02-24 13:23 UTC (permalink / raw)
To: Zijun Hu
Cc: Zijun Hu, Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V,
Andrew Morton, Nick Piggin, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On Sat, Feb 22, 2025 at 07:00:28PM +0800, Zijun Hu wrote:
> On 2025/2/22 04:01, Peter Zijlstra wrote:
> >> */
> >> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
> >> {
> >> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
> >> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
> >> }
> > So I don't mind removing it, but note that that return enforces
> > tlb_remove_page_size() has void return type.
> >
>
> tlb_remove_page_size() is void function already. (^^)
Yes, but if you were to change that, the above return would complain.
> > It might not be your preferred coding style, but it is not completely
> > pointless.
>
> based on below C spec such as C17 description. i guess language C does
> not like this usage "return void function in void function";
This is GNU extension IIRC. Note kernel uses GNU11, not C11
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-24 13:23 ` Peter Zijlstra
@ 2025-02-24 14:45 ` Zijun Hu
2025-02-25 17:27 ` Przemek Kitszel
0 siblings, 1 reply; 42+ messages in thread
From: Zijun Hu @ 2025-02-24 14:45 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Zijun Hu, Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V,
Andrew Morton, Nick Piggin, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2025/2/24 21:23, Peter Zijlstra wrote:
> On Sat, Feb 22, 2025 at 07:00:28PM +0800, Zijun Hu wrote:
>> On 2025/2/22 04:01, Peter Zijlstra wrote:
>>>> */
>>>> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
>>>> {
>>>> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
>>>> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
>>>> }
>>> So I don't mind removing it, but note that that return enforces
>>> tlb_remove_page_size() has void return type.
>>>
>>
>> tlb_remove_page_size() is void function already. (^^)
>
> Yes, but if you were to change that, the above return would complain.
>
>>> It might not be your preferred coding style, but it is not completely
>>> pointless.
>>
>> based on below C spec such as C17 description. i guess language C does
>> not like this usage "return void function in void function";
>
> This is GNU extension IIRC. Note kernel uses GNU11, not C11
any link to share about GNU11's description for this aspect ? (^^)
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-21 20:01 ` Peter Zijlstra
2025-02-22 11:00 ` Zijun Hu
@ 2025-02-25 15:16 ` David Howells
2025-02-26 11:45 ` Zijun Hu
1 sibling, 1 reply; 42+ messages in thread
From: David Howells @ 2025-02-25 15:16 UTC (permalink / raw)
To: Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Arnd Bergmann, Thomas Gleixner, Herbert Xu,
David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
Zijun Hu <zijun_hu@icloud.com> wrote:
> >> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
> >> {
> >> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
> >> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
> >> }
> > So I don't mind removing it, but note that that return enforces
> > tlb_remove_page_size() has void return type.
> >
>
> tlb_remove_page_size() is void function already. (^^)
That may be true... for now. But if that is changed in the future, then you
will get an error indicating something you need to go and look at... so in
that regard, it's *better* to do this ;-)
David
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-24 14:45 ` Zijun Hu
@ 2025-02-25 17:27 ` Przemek Kitszel
2025-02-26 11:30 ` Zijun Hu
0 siblings, 1 reply; 42+ messages in thread
From: Przemek Kitszel @ 2025-02-25 17:27 UTC (permalink / raw)
To: Zijun Hu
Cc: Zijun Hu, Peter Zijlstra, Greg Kroah-Hartman, Will Deacon,
Aneesh Kumar K.V, Andrew Morton, Nick Piggin, Arnd Bergmann,
Thomas Gleixner, Herbert Xu, David S. Miller, Rafael J. Wysocki,
Danilo Krummrich, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Johannes Berg, Jamal Hadi Salim, Cong Wang,
Jiri Pirko, Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2/24/25 15:45, Zijun Hu wrote:
> On 2025/2/24 21:23, Peter Zijlstra wrote:
>> On Sat, Feb 22, 2025 at 07:00:28PM +0800, Zijun Hu wrote:
>>> On 2025/2/22 04:01, Peter Zijlstra wrote:
>>>>> */
>>>>> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
>>>>> {
>>>>> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
>>>>> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
>>>>> }
>>>> So I don't mind removing it, but note that that return enforces
>>>> tlb_remove_page_size() has void return type.
>>>>
>>>
>>> tlb_remove_page_size() is void function already. (^^)
>>
>> Yes, but if you were to change that, the above return would complain.
>>
>>>> It might not be your preferred coding style, but it is not completely
>>>> pointless.
>>>
>>> based on below C spec such as C17 description. i guess language C does
>>> not like this usage "return void function in void function";
>>
>> This is GNU extension IIRC. Note kernel uses GNU11, not C11
>
> any link to share about GNU11's description for this aspect ? (^^)
this is new for C17 or was there for long time?
even if this is an extension, it is very nice for generating locked
wrappers, so you don't have to handle void case specially
void foo_bar(...)
{
lockdep_assert_held(&a_lock);
/// ...
}
// generated
void foo_bar_lock(...)
{
scoped_guard(mutex, &a_lock)
return foo_bar(...);
}
etc
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-25 17:27 ` Przemek Kitszel
@ 2025-02-26 11:30 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-26 11:30 UTC (permalink / raw)
To: Przemek Kitszel
Cc: Zijun Hu, Peter Zijlstra, Greg Kroah-Hartman, Will Deacon,
Aneesh Kumar K.V, Andrew Morton, Nick Piggin, Arnd Bergmann,
Thomas Gleixner, Herbert Xu, David S. Miller, Rafael J. Wysocki,
Danilo Krummrich, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Johannes Berg, Jamal Hadi Salim, Cong Wang,
Jiri Pirko, Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2025/2/26 01:27, Przemek Kitszel wrote:
>>>>> It might not be your preferred coding style, but it is not completely
>>>>> pointless.
>>>>
>>>> based on below C spec such as C17 description. i guess language C does
>>>> not like this usage "return void function in void function";
>>>
>>> This is GNU extension IIRC. Note kernel uses GNU11, not C11
>>
>> any link to share about GNU11's description for this aspect ? (^^)
> this is new for C17 or was there for long time?
>
Standard C spec has that description for long time.
Standard C11 spec also has that description.
> even if this is an extension, it is very nice for generating locked
> wrappers, so you don't have to handle void case specially
>
> void foo_bar(...)
> {
> lockdep_assert_held(&a_lock);
> /// ...
> }
>
> // generated
> void foo_bar_lock(...)
> {
> scoped_guard(mutex, &a_lock)
> return foo_bar(...);
above is able to be written as below:
scoped_guard(mutex, &a_lock) {
foo_bar(...);
return;
}
> }
i will list my reasons why this usage "return void function in void
function" is not good in cover letter [00/18] of this series.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page()
2025-02-25 15:16 ` David Howells
@ 2025-02-26 11:45 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-02-26 11:45 UTC (permalink / raw)
To: David Howells
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Arnd Bergmann, Thomas Gleixner, Herbert Xu,
David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2025/2/25 23:16, David Howells wrote:
> Zijun Hu <zijun_hu@icloud.com> wrote:
>
>>>> static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
>>>> {
>>>> - return tlb_remove_page_size(tlb, page, PAGE_SIZE);
>>>> + tlb_remove_page_size(tlb, page, PAGE_SIZE);
>>>> }
>>> So I don't mind removing it, but note that that return enforces
>>> tlb_remove_page_size() has void return type.
>>>
>>
>> tlb_remove_page_size() is void function already. (^^)
>
> That may be true... for now. But if that is changed in the future, then you
> will get an error indicating something you need to go and look at... so in
> that regard, it's *better* to do this ;-)
>
i understand your point.
if the callee tlb_remove_page_size() is in the same module with the
caller tlb_remove_page. it is meaningless to watch the callee's return type.
otherwise, provided the callee is a API which is provided by other
module author. once the author changes the API's return type, he/she
must take effort to cleanup this weird and lots of usages, that is not
nice for API provider.
this is a common issue. i will list my reasons why this usage is not
good in cover letter of this series
> David
>
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 14/18] PM: wakeup: Remove needless return in three void APIs
2025-02-21 13:02 ` [PATCH *-next 14/18] PM: wakeup: Remove needless return in three " Zijun Hu
@ 2025-02-26 17:06 ` Rafael J. Wysocki
0 siblings, 0 replies; 42+ messages in thread
From: Rafael J. Wysocki @ 2025-02-26 17:06 UTC (permalink / raw)
To: Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Zijun Hu, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On Fri, Feb 21, 2025 at 2:03 PM Zijun Hu <quic_zijuhu@quicinc.com> wrote:
>
> Remove needless 'return' in the following void APIs:
>
> __pm_wakeup_event()
> pm_wakeup_event()
> pm_wakeup_hard_event()
>
> Since both the API and callee involved are void functions.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
> include/linux/pm_wakeup.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
> index d501c09c60cd..51e0e8dd5f9e 100644
> --- a/include/linux/pm_wakeup.h
> +++ b/include/linux/pm_wakeup.h
> @@ -205,17 +205,17 @@ static inline void device_set_awake_path(struct device *dev)
>
> static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
> {
> - return pm_wakeup_ws_event(ws, msec, false);
> + pm_wakeup_ws_event(ws, msec, false);
> }
>
> static inline void pm_wakeup_event(struct device *dev, unsigned int msec)
> {
> - return pm_wakeup_dev_event(dev, msec, false);
> + pm_wakeup_dev_event(dev, msec, false);
> }
>
> static inline void pm_wakeup_hard_event(struct device *dev)
> {
> - return pm_wakeup_dev_event(dev, 0, true);
> + pm_wakeup_dev_event(dev, 0, true);
> }
>
> /**
>
> --
Applied as 6.15 material, thanks!
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
` (20 preceding siblings ...)
2025-02-21 19:00 ` Stephen Hemminger
@ 2025-02-27 12:48 ` Zijun Hu
2025-02-27 13:03 ` Peter Zijlstra
21 siblings, 1 reply; 42+ messages in thread
From: Zijun Hu @ 2025-02-27 12:48 UTC (permalink / raw)
To: Zijun Hu, Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V,
Andrew Morton, Nick Piggin, Peter Zijlstra, Arnd Bergmann,
Thomas Gleixner, Herbert Xu, David S. Miller, Rafael J. Wysocki,
Danilo Krummrich, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, Johannes Berg, Jamal Hadi Salim, Cong Wang,
Jiri Pirko, Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra
Cc: linux-arch, linux-mm, linux-kernel, linux-crypto, netdev,
linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On 2025/2/21 21:02, Zijun Hu wrote:
> void api_func_a(...);
>
> static inline void api_func_b(...)
> {
> return api_func_a(...);
> }
The Usage : Return void function in void function
IMO, perhaps, the usage is not good since:
A) STD C does not like the usage, and i find GCC has no description
about the usage.
C11/C17: 6.8.6.4 The return statement
"A return statement with an expression shall not appear in a
function whose return type is void"
B) According to discussion, the usage have function that return type
of the callee api_func_a() is monitored. but this function has below
shortcoming as well:
the monitor is not needed if the caller api_func_b() is in the same
module with the callee api_func_a(), otherwise, provided the callee is
a API and provided by author of other module. the author needs to clean
up lot of usages of the API if he/she changes the API's return type from
void to any other type, so it is not nice to API provider.
C) perhaps, most ordinary developers don't known the function mentioned
by B), and also feel strange for the usage
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-27 12:48 ` Zijun Hu
@ 2025-02-27 13:03 ` Peter Zijlstra
2025-03-03 11:30 ` Zijun Hu
0 siblings, 1 reply; 42+ messages in thread
From: Peter Zijlstra @ 2025-02-27 13:03 UTC (permalink / raw)
To: Zijun Hu
Cc: Zijun Hu, Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V,
Andrew Morton, Nick Piggin, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On Thu, Feb 27, 2025 at 08:48:19PM +0800, Zijun Hu wrote:
> On 2025/2/21 21:02, Zijun Hu wrote:
> > void api_func_a(...);
> >
> > static inline void api_func_b(...)
> > {
> > return api_func_a(...);
> > }
>
> The Usage : Return void function in void function
>
> IMO, perhaps, the usage is not good since:
>
> A) STD C does not like the usage, and i find GCC has no description
> about the usage.
> C11/C17: 6.8.6.4 The return statement
> "A return statement with an expression shall not appear in a
> function whose return type is void"
We really don't use STD C, the kernel is littered with extensions.
> B) According to discussion, the usage have function that return type
> of the callee api_func_a() is monitored. but this function has below
> shortcoming as well:
>
> the monitor is not needed if the caller api_func_b() is in the same
> module with the callee api_func_a(), otherwise, provided the callee is
> a API and provided by author of other module. the author needs to clean
> up lot of usages of the API if he/she changes the API's return type from
> void to any other type, so it is not nice to API provider.
>
> C) perhaps, most ordinary developers don't known the function mentioned
> by B), and also feel strange for the usage
It is quite common to do kernel wide updates using scripts / cocinelle.
If you have a specialization that wraps a function to fill out a default
value, then you want the return types to keep matching.
Ex.
return_type foo(type1 a1, type2 a2);
return_type my_foo(type1 a1)
{
return foo(a1, value);
}
is a normal thing to do. The whole STD C cannot return void bollocks
breaks that when return_type := void, so in that regards I would call
this a STD C defect.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 15/18] mfd: db8500-prcmu: Remove needless return in three void APIs
2025-02-21 13:02 ` [PATCH *-next 15/18] mfd: db8500-prcmu: " Zijun Hu
@ 2025-02-27 23:12 ` Linus Walleij
2025-03-13 13:03 ` (subset) " Lee Jones
1 sibling, 0 replies; 42+ messages in thread
From: Linus Walleij @ 2025-02-27 23:12 UTC (permalink / raw)
To: Zijun Hu
Cc: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Bartosz Golaszewski, Lee Jones,
Thomas Graf, Christoph Hellwig, Marek Szyprowski, Robin Murphy,
Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Zijun Hu,
linux-arch, linux-mm, linux-kernel, linux-crypto, netdev,
linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On Fri, Feb 21, 2025 at 2:03 PM Zijun Hu <quic_zijuhu@quicinc.com> wrote:
> Remove needless 'return' in the following void APIs:
>
> prcmu_early_init()
> prcmu_system_reset()
> prcmu_modem_reset()
>
> Since both the API and callee involved are void functions.
>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs
2025-02-27 13:03 ` Peter Zijlstra
@ 2025-03-03 11:30 ` Zijun Hu
0 siblings, 0 replies; 42+ messages in thread
From: Zijun Hu @ 2025-03-03 11:30 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Zijun Hu, Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V,
Andrew Morton, Nick Piggin, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Rafael J. Wysocki, Danilo Krummrich,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Johannes Berg, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
Jason Gunthorpe, Leon Romanovsky, Linus Walleij,
Bartosz Golaszewski, Lee Jones, Thomas Graf, Christoph Hellwig,
Marek Szyprowski, Robin Murphy, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, linux-arch, linux-mm, linux-kernel,
linux-crypto, netdev, linux-wireless, linux-rdma, linux-gpio,
linux-pm, iommu, linux-mtd
On 2025/2/27 21:03, Peter Zijlstra wrote:
>> C) perhaps, most ordinary developers don't known the function mentioned
>> by B), and also feel strange for the usage
> It is quite common to do kernel wide updates using scripts / cocinelle.
>
> If you have a specialization that wraps a function to fill out a default
> value, then you want the return types to keep matching.
>
> Ex.
>
> return_type foo(type1 a1, type2 a2);
>
> return_type my_foo(type1 a1)
> {
> return foo(a1, value);
> }
>
> is a normal thing to do. The whole STD C cannot return void bollocks
> breaks that when return_type := void, so in that regards I would call
> this a STD C defect.
The usage is a GCC extension.
but the usage is prone to be used within *inappropriate* context, take
this patch series for an example:
1) both foo() and my_foo() are in the same module
2) or it seems return type void is the best type for foo(). so no good
reason to track its type.
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: (subset) [PATCH *-next 15/18] mfd: db8500-prcmu: Remove needless return in three void APIs
2025-02-21 13:02 ` [PATCH *-next 15/18] mfd: db8500-prcmu: " Zijun Hu
2025-02-27 23:12 ` Linus Walleij
@ 2025-03-13 13:03 ` Lee Jones
1 sibling, 0 replies; 42+ messages in thread
From: Lee Jones @ 2025-03-13 13:03 UTC (permalink / raw)
To: Greg Kroah-Hartman, Will Deacon, Aneesh Kumar K.V, Andrew Morton,
Nick Piggin, Peter Zijlstra, Arnd Bergmann, Thomas Gleixner,
Herbert Xu, David S. Miller, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Johannes Berg, Jamal Hadi Salim,
Cong Wang, Jiri Pirko, Jason Gunthorpe, Leon Romanovsky,
Linus Walleij, Bartosz Golaszewski, Lee Jones, Thomas Graf,
Christoph Hellwig, Marek Szyprowski, Robin Murphy, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Zijun Hu
Cc: Zijun Hu, linux-arch, linux-mm, linux-kernel, linux-crypto,
netdev, linux-wireless, linux-rdma, linux-gpio, linux-pm, iommu,
linux-mtd
On Fri, 21 Feb 2025 05:02:20 -0800, Zijun Hu wrote:
> Remove needless 'return' in the following void APIs:
>
> prcmu_early_init()
> prcmu_system_reset()
> prcmu_modem_reset()
>
> Since both the API and callee involved are void functions.
>
> [...]
Applied, thanks!
[15/18] mfd: db8500-prcmu: Remove needless return in three void APIs
commit: ccf5c7a8e5b9fe7c36d8c384f8f7c495f45c63a0
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2025-03-13 13:03 UTC | newest]
Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21 13:02 [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 01/18] mm/mmu_gather: Remove needless return in void API tlb_remove_page() Zijun Hu
2025-02-21 20:01 ` Peter Zijlstra
2025-02-22 11:00 ` Zijun Hu
2025-02-24 13:23 ` Peter Zijlstra
2025-02-24 14:45 ` Zijun Hu
2025-02-25 17:27 ` Przemek Kitszel
2025-02-26 11:30 ` Zijun Hu
2025-02-25 15:16 ` David Howells
2025-02-26 11:45 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 02/18] cpu: Remove needless return in void API suspend_enable_secondary_cpus() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 03/18] crypto: api - Remove needless return in void API crypto_free_tfm() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 04/18] crypto: scomp - Remove needless return in void API crypto_scomp_free_ctx() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 05/18] sysfs: Remove needless return in void API sysfs_enable_ns() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 06/18] skbuff: Remove needless return in void API consume_skb() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 07/18] wifi: mac80211: Remove needless return in void API _ieee80211_hw_set() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 08/18] net: sched: Remove needless return in void API qdisc_watchdog_schedule_ns() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 09/18] ipv4/igmp: Remove needless return in void API ip_mc_dec_group() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 10/18] IB/rdmavt: Remove needless return in void API rvt_mod_retry_timer() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 11/18] ratelimit: Remove needless return in void API ratelimit_default_init() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 12/18] siox: Remove needless return in void API siox_driver_unregister() Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 13/18] gpiolib: Remove needless return in two void APIs Zijun Hu
2025-02-21 13:06 ` Bartosz Golaszewski
2025-02-21 13:12 ` Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 14/18] PM: wakeup: Remove needless return in three " Zijun Hu
2025-02-26 17:06 ` Rafael J. Wysocki
2025-02-21 13:02 ` [PATCH *-next 15/18] mfd: db8500-prcmu: " Zijun Hu
2025-02-27 23:12 ` Linus Walleij
2025-03-13 13:03 ` (subset) " Lee Jones
2025-02-21 13:02 ` [PATCH *-next 16/18] rhashtable: " Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 17/18] dma-mapping: Remove needless return in five " Zijun Hu
2025-02-21 13:02 ` [PATCH *-next 18/18] mtd: nand: Do not return void function in void function Zijun Hu
2025-02-21 13:12 ` [PATCH *-next 00/18] Remove weird and needless 'return' for void APIs Greg Kroah-Hartman
2025-02-21 13:15 ` Zijun Hu
2025-02-21 15:40 ` Arnd Bergmann
2025-02-22 10:38 ` Zijun Hu
2025-02-21 19:00 ` Stephen Hemminger
2025-02-21 19:36 ` Johannes Berg
2025-02-22 10:51 ` Zijun Hu
2025-02-27 12:48 ` Zijun Hu
2025-02-27 13:03 ` Peter Zijlstra
2025-03-03 11:30 ` Zijun Hu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).