public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@kernel.org>
To: Li zeming <zeming@nfschina.com>,
	chuck.lever@oracle.com, jlayton@kernel.org,
	trond.myklebust@hammerspace.com, anna@kernel.org
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sunrpc: svc: Remove unnecessary (void*) conversions
Date: Thu, 03 Nov 2022 08:49:24 -0400	[thread overview]
Message-ID: <229b424a647bfbd18942eefef4cbf6332607ca2b.camel@kernel.org> (raw)
In-Reply-To: <20221103013510.3062-1-zeming@nfschina.com>

On Thu, 2022-11-03 at 09:35 +0800, Li zeming wrote:
> The iov_base pointer does not need to cast the type.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>
> ---
>  include/linux/sunrpc/svc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
> index daecb009c05b..4b0eead91c94 100644
> --- a/include/linux/sunrpc/svc.h
> +++ b/include/linux/sunrpc/svc.h
> @@ -222,7 +222,7 @@ static inline __be32 svc_getu32(struct kvec *iov)
>  
>  static inline void svc_ungetu32(struct kvec *iov)
>  {
> -       __be32 *vp = (__be32 *)iov->iov_base;
> +       __be32 *vp = iov->iov_base;
>         iov->iov_base = (void *)(vp - 1);
>         iov->iov_len += sizeof(*vp);
>  }

If you're going to submit a patch just in order to strip unnecessary
casts, then why are you leaving the equally unnecessary cast in the
next line?

That said, why waste time "fixing" an inlined function that is not
actually called anywhere in the kernel? svc_ungetu32() should just be
removed.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  parent reply	other threads:[~2022-11-03 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  1:35 [PATCH] sunrpc: svc: Remove unnecessary (void*) conversions Li zeming
2022-11-03  9:43 ` Jeff Layton
2022-11-03 12:49 ` Trond Myklebust [this message]
2022-11-03 13:07   ` Chuck Lever III
2022-11-04  1:02     ` Li zeming

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=229b424a647bfbd18942eefef4cbf6332607ca2b.camel@kernel.org \
    --to=trondmy@kernel.org \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    --cc=zeming@nfschina.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