* [PATCH net-next] net/smc: shorten lgr_cnt initialization
@ 2019-12-12 21:35 Karsten Graul
2019-12-15 19:08 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Karsten Graul @ 2019-12-12 21:35 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun
From: Ursula Braun <ubraun@linux.ibm.com>
Save a line of code by making use of ATOMIC_INIT() for lgr_cnt.
Suggested-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
net/smc/smc_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index bb92c7c6214c..c16b8d3e200b 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -41,7 +41,7 @@ static struct smc_lgr_list smc_lgr_list = { /* established link groups */
.num = 0,
};
-static atomic_t lgr_cnt; /* number of existing link groups */
+static atomic_t lgr_cnt = ATOMIC_INIT(0); /* number of existing link groups */
static DECLARE_WAIT_QUEUE_HEAD(lgrs_deleted);
static void smc_buf_free(struct smc_link_group *lgr, bool is_rmb,
@@ -1297,7 +1297,6 @@ static struct notifier_block smc_reboot_notifier = {
int __init smc_core_init(void)
{
- atomic_set(&lgr_cnt, 0);
return register_reboot_notifier(&smc_reboot_notifier);
}
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net/smc: shorten lgr_cnt initialization
2019-12-12 21:35 [PATCH net-next] net/smc: shorten lgr_cnt initialization Karsten Graul
@ 2019-12-15 19:08 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2019-12-15 19:08 UTC (permalink / raw)
To: Karsten Graul; +Cc: davem, netdev, linux-s390, heiko.carstens, raspl, ubraun
On Thu, 12 Dec 2019 22:35:41 +0100, Karsten Graul wrote:
> From: Ursula Braun <ubraun@linux.ibm.com>
>
> Save a line of code by making use of ATOMIC_INIT() for lgr_cnt.
>
> Suggested-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
> Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Applied, thank you!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-15 19:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12 21:35 [PATCH net-next] net/smc: shorten lgr_cnt initialization Karsten Graul
2019-12-15 19:08 ` Jakub Kicinski
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).