lkml.org 
[lkml]   [2007]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/7] Initial implementation of the trec driver and include files
    Hi,

    On Wed, Mar 21, 2007 at 09:22:39AM +0100, Johannes Weiner wrote:
    > Your patch has broken lines where there shouldn't be any.

    I mean, the attached patch. This is probably not an error in the patch
    but in the way of posting it.

    > > +static int snprint_address(char *b, int bsize, unsigned long address)
    > > +{
    > > +#ifdef CONFIG_KALLSYMS
    > > + unsigned long offset = 0, symsize;
    > > + const char *symname;
    > > + char *modname;
    > > + char *delim = ":";
    > > + int n;
    > > + char namebuf[128];
    > > +
    > > + symname = kallsyms_lookup(address, &symsize, &offset, &modname,
    > > namebuf);
    > > + if (!symname) {
    > > + n = 0;
    > > + } else {
    > > + if (!modname)
    > > + modname = delim = "";
    > > + n = snprintf(b, bsize, "0x%016lx %s%s%s%s+0x%lx/0x%lx",
    > > + address, delim, modname, delim, symname, offset,
    > > symsize);
    > > + }
    > > + return n;
    > > +#else
    > > + return snprintf(b, bsize, "0x%016lx", address);
    > > + return 0;
    > > +#endif
    > > +}
    >
    > Would it make sense to #ifdef the whole function?
    > Make it static int (*)(...) if CONFIG_KALLSYMS and otherwise just a
    > static inline int (*)(...) { return 0; }

    Sorry, I meant:

    [...]
    #else /* !CONFIG_KALLSYMS */
    static inline int snprint_address(char *b, int bsize, unsigned long addr)
    {
    return snprintf(b, bsize, "%#16x", addr);
    }
    #endif

    =Hannes
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-03-21 09:41    [W:0.022 / U:7.464 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site