Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32
@ 2014-01-06 17:37 WANG Chao
  2014-01-06 19:14 ` Vivek Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: WANG Chao @ 2014-01-06 17:37 UTC (permalink / raw)
  To: kexec

It seems gcc doesn't check return type from inline function.
struct_val_u64() should return u64 otherwise upper 32bit is lost.

Signed-off-by: WANG Chao <chaowang@redhat.com>
---
 vmcore-dmesg/vmcore-dmesg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c
index 0f477c0..df14c89 100644
--- a/vmcore-dmesg/vmcore-dmesg.c
+++ b/vmcore-dmesg/vmcore-dmesg.c
@@ -529,7 +529,7 @@ static inline uint32_t struct_val_u32(char *ptr, unsigned int offset)
 	return(file32_to_cpu(*(uint32_t *)(ptr + offset)));
 }
 
-static inline uint32_t struct_val_u64(char *ptr, unsigned int offset)
+static inline uint64_t struct_val_u64(char *ptr, unsigned int offset)
 {
 	return(file64_to_cpu(*(uint64_t *)(ptr + offset)));
 }
-- 
1.8.4.2


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32
  2014-01-06 17:37 [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32 WANG Chao
@ 2014-01-06 19:14 ` Vivek Goyal
  2014-01-13  5:29   ` WANG Chao
  0 siblings, 1 reply; 4+ messages in thread
From: Vivek Goyal @ 2014-01-06 19:14 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec

On Tue, Jan 07, 2014 at 01:37:34AM +0800, WANG Chao wrote:
> It seems gcc doesn't check return type from inline function.
> struct_val_u64() should return u64 otherwise upper 32bit is lost.
> 
> Signed-off-by: WANG Chao <chaowang@redhat.com>

Acked-by: Vivek Goyal <vgoyal@redhat.com>

Vivek

> ---
>  vmcore-dmesg/vmcore-dmesg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c
> index 0f477c0..df14c89 100644
> --- a/vmcore-dmesg/vmcore-dmesg.c
> +++ b/vmcore-dmesg/vmcore-dmesg.c
> @@ -529,7 +529,7 @@ static inline uint32_t struct_val_u32(char *ptr, unsigned int offset)
>  	return(file32_to_cpu(*(uint32_t *)(ptr + offset)));
>  }
>  
> -static inline uint32_t struct_val_u64(char *ptr, unsigned int offset)
> +static inline uint64_t struct_val_u64(char *ptr, unsigned int offset)
>  {
>  	return(file64_to_cpu(*(uint64_t *)(ptr + offset)));
>  }
> -- 
> 1.8.4.2
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32
  2014-01-06 19:14 ` Vivek Goyal
@ 2014-01-13  5:29   ` WANG Chao
  2014-01-13  8:43     ` Simon Horman
  0 siblings, 1 reply; 4+ messages in thread
From: WANG Chao @ 2014-01-13  5:29 UTC (permalink / raw)
  To: Simon Horman; +Cc: kexec, Vivek Goyal

On 01/06/14 at 02:14pm, Vivek Goyal wrote:
> On Tue, Jan 07, 2014 at 01:37:34AM +0800, WANG Chao wrote:
> > It seems gcc doesn't check return type from inline function.
> > struct_val_u64() should return u64 otherwise upper 32bit is lost.
> > 
> > Signed-off-by: WANG Chao <chaowang@redhat.com>
> 
> Acked-by: Vivek Goyal <vgoyal@redhat.com>
> 
> Vivek

Hi, Simon

Could you please pick up this one?

Thanks
WANG Chao

> 
> > ---
> >  vmcore-dmesg/vmcore-dmesg.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/vmcore-dmesg/vmcore-dmesg.c b/vmcore-dmesg/vmcore-dmesg.c
> > index 0f477c0..df14c89 100644
> > --- a/vmcore-dmesg/vmcore-dmesg.c
> > +++ b/vmcore-dmesg/vmcore-dmesg.c
> > @@ -529,7 +529,7 @@ static inline uint32_t struct_val_u32(char *ptr, unsigned int offset)
> >  	return(file32_to_cpu(*(uint32_t *)(ptr + offset)));
> >  }
> >  
> > -static inline uint32_t struct_val_u64(char *ptr, unsigned int offset)
> > +static inline uint64_t struct_val_u64(char *ptr, unsigned int offset)
> >  {
> >  	return(file64_to_cpu(*(uint64_t *)(ptr + offset)));
> >  }
> > -- 
> > 1.8.4.2
> > 
> > 
> > _______________________________________________
> > kexec mailing list
> > kexec@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/kexec
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32
  2014-01-13  5:29   ` WANG Chao
@ 2014-01-13  8:43     ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2014-01-13  8:43 UTC (permalink / raw)
  To: WANG Chao; +Cc: kexec, Vivek Goyal

On Mon, Jan 13, 2014 at 01:29:44PM +0800, WANG Chao wrote:
> On 01/06/14 at 02:14pm, Vivek Goyal wrote:
> > On Tue, Jan 07, 2014 at 01:37:34AM +0800, WANG Chao wrote:
> > > It seems gcc doesn't check return type from inline function.
> > > struct_val_u64() should return u64 otherwise upper 32bit is lost.
> > > 
> > > Signed-off-by: WANG Chao <chaowang@redhat.com>
> > 
> > Acked-by: Vivek Goyal <vgoyal@redhat.com>
> > 
> > Vivek
> 
> Hi, Simon
> 
> Could you please pick up this one?

Done, thanks.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

end of thread, other threads:[~2014-01-13  8:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 17:37 [PATCH] vmcore-dmesg: struct_val_u64() not casting u64 to u32 WANG Chao
2014-01-06 19:14 ` Vivek Goyal
2014-01-13  5:29   ` WANG Chao
2014-01-13  8:43     ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox