* [PATCH] sunrpc: svc: Remove unnecessary (void*) conversions
@ 2022-11-03 1:35 Li zeming
2022-11-03 9:43 ` Jeff Layton
2022-11-03 12:49 ` Trond Myklebust
0 siblings, 2 replies; 5+ messages in thread
From: Li zeming @ 2022-11-03 1:35 UTC (permalink / raw)
To: chuck.lever, jlayton, trond.myklebust, anna
Cc: linux-nfs, linux-kernel, Li zeming
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);
}
--
2.18.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] sunrpc: svc: Remove unnecessary (void*) conversions
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
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Layton @ 2022-11-03 9:43 UTC (permalink / raw)
To: Li zeming, chuck.lever, trond.myklebust, anna; +Cc: linux-nfs, linux-kernel
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);
> }
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] sunrpc: svc: Remove unnecessary (void*) conversions
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
2022-11-03 13:07 ` Chuck Lever III
1 sibling, 1 reply; 5+ messages in thread
From: Trond Myklebust @ 2022-11-03 12:49 UTC (permalink / raw)
To: Li zeming, chuck.lever, jlayton, trond.myklebust, anna
Cc: linux-nfs, linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] sunrpc: svc: Remove unnecessary (void*) conversions
2022-11-03 12:49 ` Trond Myklebust
@ 2022-11-03 13:07 ` Chuck Lever III
2022-11-04 1:02 ` Li zeming
0 siblings, 1 reply; 5+ messages in thread
From: Chuck Lever III @ 2022-11-03 13:07 UTC (permalink / raw)
To: Li zeming
Cc: Jeff Layton, Trond Myklebust, Anna Schumaker,
Linux NFS Mailing List, LKML
> On Nov 3, 2022, at 8:49 AM, Trond Myklebust <trondmy@kernel.org> wrote:
>
> 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.
Sorry for the delay, I was expecting an electrical service outage
here at home yesterday, so the lab was powered off.
So, Li, can you drop this one, and instead send a patch that removes
the definition of svc_ungetu32 ?
--
Chuck Lever
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-04 1:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-11-03 13:07 ` Chuck Lever III
2022-11-04 1:02 ` Li zeming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox