linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init:Remove unnecessary (void*) conversions
@ 2022-09-28  1:45 Zhou jie
  2022-09-30 13:11 ` Andrew Halaney
  0 siblings, 1 reply; 3+ messages in thread
From: Zhou jie @ 2022-09-28  1:45 UTC (permalink / raw)
  To: akpm, vbabka, mhiramat, rostedt, edumazet, zhoujie, ahalaney,
	rdunlap, christophe.leroy, rppt, mark-pk.tsai
  Cc: linux-kernel

The void pointer object can be directly assigned to different structure
objects, it does not need to be cast.

Signed-off-by: Zhou jie <zhoujie@nfschina.com>
---
 init/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init/main.c b/init/main.c
index 98182c3c2c4b..5494caa24738 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1239,7 +1239,7 @@ __setup("initcall_blacklist=", initcall_blacklist);
 static __init_or_module void
 trace_initcall_start_cb(void *data, initcall_t fn)
 {
-	ktime_t *calltime = (ktime_t *)data;
+	ktime_t *calltime = data;
 
 	printk(KERN_DEBUG "calling  %pS @ %i\n", fn, task_pid_nr(current));
 	*calltime = ktime_get();
@@ -1248,7 +1248,7 @@ trace_initcall_start_cb(void *data, initcall_t fn)
 static __init_or_module void
 trace_initcall_finish_cb(void *data, initcall_t fn, int ret)
 {
-	ktime_t rettime, *calltime = (ktime_t *)data;
+	ktime_t rettime, *calltime = data;
 
 	rettime = ktime_get();
 	printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n",
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] init:Remove unnecessary (void*) conversions
  2022-09-28  1:45 [PATCH] init:Remove unnecessary (void*) conversions Zhou jie
@ 2022-09-30 13:11 ` Andrew Halaney
  2022-10-03 16:12   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Halaney @ 2022-09-30 13:11 UTC (permalink / raw)
  To: Zhou jie
  Cc: akpm, vbabka, mhiramat, rostedt, edumazet, rdunlap,
	christophe.leroy, rppt, mark-pk.tsai, linux-kernel

Hi,

nit: $subject should have a space after init:, i.e "init: Remove".

On Wed, Sep 28, 2022 at 09:45:39AM +0800, Zhou jie wrote:
> The void pointer object can be directly assigned to different structure
> objects, it does not need to be cast.
> 
> Signed-off-by: Zhou jie <zhoujie@nfschina.com>

With the subject fixed up you can add:

    Reviewed-by: Andrew Halaney <ahalaney@redhat.com>

> ---
>  init/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/init/main.c b/init/main.c
> index 98182c3c2c4b..5494caa24738 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -1239,7 +1239,7 @@ __setup("initcall_blacklist=", initcall_blacklist);
>  static __init_or_module void
>  trace_initcall_start_cb(void *data, initcall_t fn)
>  {
> -	ktime_t *calltime = (ktime_t *)data;
> +	ktime_t *calltime = data;
>  
>  	printk(KERN_DEBUG "calling  %pS @ %i\n", fn, task_pid_nr(current));
>  	*calltime = ktime_get();
> @@ -1248,7 +1248,7 @@ trace_initcall_start_cb(void *data, initcall_t fn)
>  static __init_or_module void
>  trace_initcall_finish_cb(void *data, initcall_t fn, int ret)
>  {
> -	ktime_t rettime, *calltime = (ktime_t *)data;
> +	ktime_t rettime, *calltime = data;
>  
>  	rettime = ktime_get();
>  	printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n",
> -- 
> 2.18.2
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] init:Remove unnecessary (void*) conversions
  2022-09-30 13:11 ` Andrew Halaney
@ 2022-10-03 16:12   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2022-10-03 16:12 UTC (permalink / raw)
  To: akpm
  Cc: Andrew Halaney, Zhou jie, vbabka, mhiramat, edumazet, rdunlap,
	christophe.leroy, rppt, mark-pk.tsai, linux-kernel

On Fri, 30 Sep 2022 08:11:42 -0500
Andrew Halaney <ahalaney@redhat.com> wrote:

> Hi,
> 
> nit: $subject should have a space after init:, i.e "init: Remove".
> 
> On Wed, Sep 28, 2022 at 09:45:39AM +0800, Zhou jie wrote:
> > The void pointer object can be directly assigned to different structure
> > objects, it does not need to be cast.
> > 
> > Signed-off-by: Zhou jie <zhoujie@nfschina.com>  
> 
> With the subject fixed up you can add:
> 
>     Reviewed-by: Andrew Halaney <ahalaney@redhat.com>

Looks fine to me too.

Andrew Morton, care to take this?

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

> 
> > ---
> >  init/main.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/init/main.c b/init/main.c
> > index 98182c3c2c4b..5494caa24738 100644
> > --- a/init/main.c
> > +++ b/init/main.c
> > @@ -1239,7 +1239,7 @@ __setup("initcall_blacklist=", initcall_blacklist);
> >  static __init_or_module void
> >  trace_initcall_start_cb(void *data, initcall_t fn)
> >  {
> > -	ktime_t *calltime = (ktime_t *)data;
> > +	ktime_t *calltime = data;
> >  
> >  	printk(KERN_DEBUG "calling  %pS @ %i\n", fn, task_pid_nr(current));
> >  	*calltime = ktime_get();
> > @@ -1248,7 +1248,7 @@ trace_initcall_start_cb(void *data, initcall_t fn)
> >  static __init_or_module void
> >  trace_initcall_finish_cb(void *data, initcall_t fn, int ret)
> >  {
> > -	ktime_t rettime, *calltime = (ktime_t *)data;
> > +	ktime_t rettime, *calltime = data;
> >  
> >  	rettime = ktime_get();
> >  	printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n",
> > -- 
> > 2.18.2
> >   


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-03 16:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  1:45 [PATCH] init:Remove unnecessary (void*) conversions Zhou jie
2022-09-30 13:11 ` Andrew Halaney
2022-10-03 16:12   ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).