Skip to content

Commit

Permalink
net/smc: shorten lgr_cnt initialization
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
  • Loading branch information
Ursula Braun authored and Jakub Kicinski committed Dec 15, 2019
1 parent f5058a2 commit 29115ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/smc/smc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 29115ce

Please sign in to comment.