All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec: (bugfix) mem_regions_sort()
@ 2016-07-29  8:23 AKASHI Takahiro
  2016-07-29  8:25 ` Pratyush Anand
  0 siblings, 1 reply; 3+ messages in thread
From: AKASHI Takahiro @ 2016-07-29  8:23 UTC (permalink / raw)
  To: horms; +Cc: AKASHI Takahiro, rmk, kexec

The third argument of qsort() must be the size of each array element.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 kexec/mem_regions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c
index e61c074..a8cb510 100644
--- a/kexec/mem_regions.c
+++ b/kexec/mem_regions.c
@@ -24,7 +24,7 @@ static int mem_range_cmp(const void *a1, const void *a2)
  */
 void mem_regions_sort(struct memory_ranges *ranges)
 {
-	qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges),
+	qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges[0]),
 	      mem_range_cmp);
 }
 
-- 
2.9.0


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

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

* Re: [PATCH] kexec: (bugfix) mem_regions_sort()
  2016-07-29  8:23 [PATCH] kexec: (bugfix) mem_regions_sort() AKASHI Takahiro
@ 2016-07-29  8:25 ` Pratyush Anand
  2016-08-01  4:32   ` AKASHI Takahiro
  0 siblings, 1 reply; 3+ messages in thread
From: Pratyush Anand @ 2016-07-29  8:25 UTC (permalink / raw)
  To: AKASHI Takahiro; +Cc: rmk, horms, kexec

On 29/07/2016:05:23:23 PM, AKASHI Takahiro wrote:
> The third argument of qsort() must be the size of each array element.

Yes, I had sent it day before yesterday which has been ACKed by Russell.

> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>  kexec/mem_regions.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c
> index e61c074..a8cb510 100644
> --- a/kexec/mem_regions.c
> +++ b/kexec/mem_regions.c
> @@ -24,7 +24,7 @@ static int mem_range_cmp(const void *a1, const void *a2)
>   */
>  void mem_regions_sort(struct memory_ranges *ranges)
>  {
> -	qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges),
> +	qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges[0]),
>  	      mem_range_cmp);
>  }
>  
> -- 
> 2.9.0
> 
> 
> _______________________________________________
> 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] 3+ messages in thread

* Re: [PATCH] kexec: (bugfix) mem_regions_sort()
  2016-07-29  8:25 ` Pratyush Anand
@ 2016-08-01  4:32   ` AKASHI Takahiro
  0 siblings, 0 replies; 3+ messages in thread
From: AKASHI Takahiro @ 2016-08-01  4:32 UTC (permalink / raw)
  To: Pratyush Anand; +Cc: rmk, horms, kexec

On Fri, Jul 29, 2016 at 01:55:37PM +0530, Pratyush Anand wrote:
> On 29/07/2016:05:23:23 PM, AKASHI Takahiro wrote:
> > The third argument of qsort() must be the size of each array element.
> 
> Yes, I had sent it day before yesterday which has been ACKed by Russell.

Oops, thanks.
You must have found it in trying my kdump patch.

Thanks,
-Takahiro AKASHI

> > 
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> >  kexec/mem_regions.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kexec/mem_regions.c b/kexec/mem_regions.c
> > index e61c074..a8cb510 100644
> > --- a/kexec/mem_regions.c
> > +++ b/kexec/mem_regions.c
> > @@ -24,7 +24,7 @@ static int mem_range_cmp(const void *a1, const void *a2)
> >   */
> >  void mem_regions_sort(struct memory_ranges *ranges)
> >  {
> > -	qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges),
> > +	qsort(ranges->ranges, ranges->size, sizeof(ranges->ranges[0]),
> >  	      mem_range_cmp);
> >  }
> >  
> > -- 
> > 2.9.0
> > 
> > 
> > _______________________________________________
> > 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] 3+ messages in thread

end of thread, other threads:[~2016-08-01  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-29  8:23 [PATCH] kexec: (bugfix) mem_regions_sort() AKASHI Takahiro
2016-07-29  8:25 ` Pratyush Anand
2016-08-01  4:32   ` AKASHI Takahiro

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.