lkml.org 
[lkml]   [2012]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 2/7] parse-events: Fix printk_cmp()
    From
    Date
    On Mon, 2012-04-09 at 11:54 +0900, Namhyung Kim wrote:
    > The printk_cmp function should use printk_map instead of func_map.
    > Also rename the variables for consistency.
    >
    > Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
    > ---
    > parse-events.c | 8 ++++----
    > 1 files changed, 4 insertions(+), 4 deletions(-)
    >
    > diff --git a/parse-events.c b/parse-events.c
    > index 5214771..f90af1a 100644
    > --- a/parse-events.c
    > +++ b/parse-events.c
    > @@ -507,12 +507,12 @@ struct printk_list {
    >
    > static int printk_cmp(const void *a, const void *b)
    > {
    > - const struct func_map *fa = a;
    > - const struct func_map *fb = b;
    > + const struct printk_map *pa = a;
    > + const struct printk_map *pb = b;
    >
    > - if (fa->addr < fb->addr)
    > + if (pa->addr < pb->addr)
    > return -1;
    > - if (fa->addr > fb->addr)
    > + if (pa->addr > pb->addr)

    Ouch! This worked only because the first item in both func_map and
    printk_map happened to be addr (of the same size).

    -- Steve

    > return 1;
    >
    > return 0;




    \
     
     \ /
      Last update: 2012-04-10 19:39    [W:0.022 / U:90.868 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site