LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Johannes Weiner <hannes-kernel@saeurebad.de>
To: Wink Saville <wink@saville.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] Initial implementation of the trec driver and include files
Date: Wed, 21 Mar 2007 09:37:36 +0100	[thread overview]
Message-ID: <20070321083736.GB16768@leiferikson> (raw)
In-Reply-To: <20070321082238.GA16768@leiferikson>

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

  reply	other threads:[~2007-03-21  8:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-21  6:47 Wink Saville
2007-03-21  8:22 ` Johannes Weiner
2007-03-21  8:37   ` Johannes Weiner [this message]
2007-03-21 16:49   ` Wink Saville
2007-03-21 18:17     ` Johannes Weiner
2007-03-22  4:59       ` Wink Saville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070321083736.GB16768@leiferikson \
    --to=hannes-kernel@saeurebad.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wink@saville.com \
    --subject='Re: [PATCH 2/7] Initial implementation of the trec driver and include files' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).