From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "james.smart@broadcom.com" <james.smart@broadcom.com>,
"herbszt@gmx.de" <herbszt@gmx.de>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] efct: fix compilation warning about atomic_t usage
Date: Wed, 15 Mar 2017 21:58:23 +0000 [thread overview]
Message-ID: <1489615061.2660.11.camel@sandisk.com> (raw)
In-Reply-To: <20170315222743.00004630@gmx.de>
On Wed, 2017-03-15 at 22:27 +0100, Sebastian Herbszt wrote:
> Use kref_read() instead of accessing the counter inside a kref.
Hello Sebastian,
It is a good habit for a patch that fixes a compilation warning to mention
the warning message that has been fixed in the patch description.
> @@ -3821,7 +3821,7 @@ efct_hw_io_free(struct efct_hw_s *hw, struct efct_hw_io_s *io)
> uint8_t
> efct_hw_io_inuse(struct efct_hw_s *hw, struct efct_hw_io_s *io)
> {
> - return (atomic_read(&io->ref.refcount) > 0);
> + return (kref_read(&io->ref) > 0);
> }
A minor style comment: checkpatch should have told you that parentheses are
not necessary in a return statement ("return is not a function, parentheses
are not required").
Otherwise this patch looks fine to me.
Bart.
prev parent reply other threads:[~2017-03-15 21:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 21:27 [PATCH] efct: fix compilation warning about atomic_t usage Sebastian Herbszt
2017-03-15 21:58 ` Bart Van Assche [this message]
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=1489615061.2660.11.camel@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=herbszt@gmx.de \
--cc=james.smart@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.