public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@zip.com.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Wessel <jason.wessel@windriver.com>
Subject: Re: [patch] kgdb light, v6
Date: Sun, 10 Feb 2008 22:09:00 +0100	[thread overview]
Message-ID: <20080210210900.GA27162@elte.hu> (raw)
In-Reply-To: <200802102155.46505.bzolnier@gmail.com>


* Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:

> > +} breakinfo[4] = {
> > +	{ .enabled = 0 },
> > +	{ .enabled = 0 },
> > +	{ .enabled = 0 },
> > +	{ .enabled = 0 },
> > +};
> 
> is this initialization really needed?  the whole thing is static 
> anyway

good point! It's not needed at all: fixed.

> > +			case 3:
> > +				set_debugreg(breakinfo[3].addr, 3);
> > +				break;
> 
> 			if (breakno >= 0 && breakno <= 3)
> 				set_debugreg(breakinfo[breakno].addr, breakno);

nice! I've added your simplification.

> > + */
> > +int kgdb_arch_init(void)
> > +{
> > +	register_die_notifier(&kgdb_notifier);
> > +	return 0;
> 
> return register_die_notifier();

agreed - done. (btw., for kicks i checked kernel/notifier.c - 
register_die_notifier() never fails and always returns 0!)

> [...]
> 
> > +MODULE_DESCRIPTION("KGDB Console TTY Driver");
> > +MODULE_LICENSE("GPL");
> 
> should be at the bottom of the file

agreed - i moved it.

> > +static int kgdboc_option_setup(char *opt)
> 
> __init

done.

> > +__setup("kgdboc=", kgdboc_option_setup);
> 
> no need for obsolete __setup, we have module_param_call() below

it's needed for bzImage kernels. I just tested it and without __setup() 
no init sequence is run and KGDB is not activated.

> > +static int configure_kgdboc(void)
> 
> __init

ok, done.

> > +static int init_kgdboc(void)
> 
> __init

done.

> > +#ifdef CONFIG_CONSOLE_POLL
> > +
> 
> unnecessary new line

(that is a personal taste/style thing - to me it simply looks more 
readable if there's an empty line before function declarations.)

> > +/* The maximum number of KGDB I/O modules that can be loaded */
> > +#define KGDB_MAX_IO_HANDLERS	3
> 
> unused

good - zapped it.

> > +#ifndef KGDB_MAX_BREAKPOINTS
> > +# define KGDB_MAX_BREAKPOINTS	1000
> > +#endif
> > +
> > +#define KGDB_HW_BREAKPOINT	1
> 
> unused

hm, both KGDB_MAX_BREAKPOINTS and KGDB_HW_BREAKPOINT are used.

> > + * @late_init: Pointer to a function that will do any setup that has
> 
> there is no late_init in the structure

zapped it.

> identical cache flushing code is present in
> kgdb_deactivate_sw_breakpoints() below
> 
> maybe it would make sense to have some common helper

agreed. Incidentally, while looking at uaccess patterns i noticed this 
and i've already written one: kgdb_flush_swbreak_addr().

> if kgdb_isremovedbreak() helper is moved before kgdb_set_sw_break() 
> and converted to return 'i' on success and '-1' on failure then it can 
> be used instead the above for () loop

dunno - that would complicate arch/x86/kernel/kgdb.c's use of 
kgdb_isremovedbreak() and looks a bit complex. If you feel strongly 
about it, could you send a patch?

in any case, thanks Bartlomiej for the many very useful comments, i 
fixed all of the the things you noticed in my current tree.

	Ingo

  reply	other threads:[~2008-02-10 21:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10  7:13 [3/6] kgdb: core Ingo Molnar
2008-02-10  7:31 ` Sam Ravnborg
2008-02-10  7:59   ` Ingo Molnar
2008-02-10  7:35 ` Christoph Hellwig
2008-02-10  7:43   ` Ingo Molnar
2008-02-10  7:57     ` Christoph Hellwig
2008-02-10  8:02       ` Ingo Molnar
2008-02-10  8:21         ` Ingo Molnar
2008-02-10  8:26           ` Christoph Hellwig
2008-02-10  9:08             ` Ingo Molnar
2008-02-10  9:17               ` Ingo Molnar
2008-02-10  9:20                 ` Ingo Molnar
2008-02-10  9:34                   ` Ingo Molnar
2008-02-10  9:31                 ` Christoph Hellwig
2008-02-10 17:17                   ` [patch] kgdb light, v6 Ingo Molnar
2008-02-10 19:43                     ` Bartlomiej Zolnierkiewicz
2008-02-10 21:31                       ` Ingo Molnar
2008-02-10 20:55                     ` Bartlomiej Zolnierkiewicz
2008-02-10 21:09                       ` Ingo Molnar [this message]
2008-02-10 21:45                         ` Jan Kiszka
2008-02-10 22:14                           ` Bartlomiej Zolnierkiewicz
2008-02-10 22:32                             ` Jan Kiszka
2008-02-10 22:40                               ` Ingo Molnar
2008-02-11  2:35                                 ` Yinghai Lu
2008-02-10 22:31                           ` Ingo Molnar
2008-02-10 22:24                         ` Bartlomiej Zolnierkiewicz
2008-02-10  8:24         ` [3/6] kgdb: core Christoph Hellwig
2008-02-10  8:57           ` Ingo Molnar
2008-02-10  9:11             ` Christoph Hellwig
2008-02-10  9:27               ` Ingo Molnar
2008-02-10  9:34                 ` Christoph Hellwig
2008-02-10 17:02                   ` Ingo Molnar
2008-02-10 12:46 ` Marcin Slusarz
2008-02-10 13:19   ` Jesper Juhl
2008-02-10 14:00     ` Marcin Slusarz
2008-02-10 13:36   ` Jan Kiszka
2008-02-10 16:43   ` Ingo Molnar
2008-02-10 19:20     ` Bartlomiej Zolnierkiewicz
2008-02-10 16:46   ` Ingo Molnar

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=20080210210900.GA27162@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@zip.com.au \
    --cc=bzolnier@gmail.com \
    --cc=hch@infradead.org \
    --cc=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox