All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH v1 5/5] SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer()
Date: Sun, 05 Jun 2022 15:58:50 -0400	[thread overview]
Message-ID: <165445913079.1664.5467024491080755855.stgit@bazille.1015granger.net> (raw)
In-Reply-To: <165445865736.1664.4497130284832282034.stgit@bazille.1015granger.net>

To make the code easier to read, remove visual clutter by changing
the declared type of @p.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xdr.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index 89cb48931a1f..4e4cad7aeec2 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -955,9 +955,9 @@ EXPORT_SYMBOL_GPL(xdr_commit_encode);
 static noinline __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
 						   size_t nbytes)
 {
-	__be32 *p;
 	int space_left;
 	int frag1bytes, frag2bytes;
+	void *p;
 
 	if (nbytes > PAGE_SIZE)
 		goto out_overflow; /* Bigger buffers require special handling */
@@ -986,12 +986,12 @@ static noinline __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
 	 * xdr_commit_encode() has shifted this one back:
 	 */
 	p = page_address(*xdr->page_ptr);
-	xdr->p = (void *)p + frag2bytes;
+	xdr->p = p + frag2bytes;
 	space_left = xdr->buf->buflen - xdr->buf->len;
 	if (space_left - nbytes >= PAGE_SIZE)
-		xdr->end = (void *)p + PAGE_SIZE;
+		xdr->end = p + PAGE_SIZE;
 	else
-		xdr->end = (void *)p + space_left - frag1bytes;
+		xdr->end = p + space_left - frag1bytes;
 
 	xdr->buf->page_len += frag2bytes;
 	xdr->buf->len += nbytes;



  parent reply	other threads:[~2022-06-05 19:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05 19:58 [PATCH v1 0/5] Fix NFSv3 READDIRPLUS failures Chuck Lever
2022-06-05 19:58 ` [PATCH v1 1/5] SUNRPC: Fix the calculation of xdr->end in xdr_get_next_encode_buffer() Chuck Lever
2022-06-06 22:09   ` J. Bruce Fields
2022-06-07  0:59     ` NeilBrown
2022-06-07  2:35       ` Chuck Lever III
2022-06-07  3:12         ` Chuck Lever III
2022-06-07  3:29           ` NeilBrown
2022-06-05 19:58 ` [PATCH v1 2/5] SUNRPC: Optimize xdr_reserve_space() Chuck Lever
2022-06-07  1:03   ` NeilBrown
2022-06-07  2:19     ` Chuck Lever III
2022-06-07  2:35       ` NeilBrown
2022-06-05 19:58 ` [PATCH v1 3/5] SUNRPC: Clean up xdr_commit_encode() Chuck Lever
2022-06-07  1:05   ` NeilBrown
2022-06-07  2:21     ` Chuck Lever III
2022-06-07  2:37       ` NeilBrown
2022-06-05 19:58 ` [PATCH v1 4/5] SUNRPC: Clean up xdr_get_next_encode_buffer() Chuck Lever
2022-06-07  1:07   ` NeilBrown
2022-06-05 19:58 ` Chuck Lever [this message]
2022-06-07  1:08   ` [PATCH v1 5/5] SUNRPC: Remove pointer type casts from xdr_get_next_encode_buffer() NeilBrown
2022-06-07 11:37 ` [PATCH v1 0/5] Fix NFSv3 READDIRPLUS failures NeilBrown
2022-06-07 14:16   ` Chuck Lever III

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=165445913079.1664.5467024491080755855.stgit@bazille.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@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.