From: Shuah Khan <skhan@linuxfoundation.org>
To: Anna.Schumaker@netapp.com, trond.myklebust@hammerspace.com
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
chuck.lever@oracle.com, "David S. Miller" <davem@davemloft.net>,
kuba@kernel.org, linux-nfs@vger.kernel.org,
Networking <netdev@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: rpc_xprt_debugfs_register() - atomic_inc_return() usage
Date: Wed, 20 Jan 2021 16:52:34 -0700 [thread overview]
Message-ID: <06c8f6ff-f821-e909-d40c-9de98657729f@linuxfoundation.org> (raw)
Hi Anna and Trond,
I came across the following while reviewing atomic_inc_return() usages
that cast return value to unsigned
rpc_xprt_debugfs_register()'s atomic_inc_return() usage looks a bit odd.
- cur_id isn't initialized
- id = (unsigned int)atomic_inc_return(&cur_id);
Please note that id is int. Is it expected that cur_id could overflow?
Is there a maximum limit for this value?
thanks,
-- Shuah
next reply other threads:[~2021-01-21 3:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 23:52 Shuah Khan [this message]
2021-01-21 17:56 ` rpc_xprt_debugfs_register() - atomic_inc_return() usage Trond Myklebust
2021-01-21 18:01 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06c8f6ff-f821-e909-d40c-9de98657729f@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=Anna.Schumaker@netapp.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox