Re: [PATCH 1/7] time: Condense timekeeper.xtime into xtime_sec

From: Ingo Molnar
Date: Tue Feb 28 2012 - 03:30:25 EST



* John Stultz <john.stultz@xxxxxxxxxx> wrote:

> On Tue, 2012-02-28 at 09:06 +0100, Ingo Molnar wrote:
> > * John Stultz <john.stultz@xxxxxxxxxx> wrote:
> > > +
> > > +static void timekeeper_set_xtime(struct timekeeper *tk,
> > > + const struct timespec *ts)
> >
> > Pointless (because ugly) line break.
> >
> > > +{
> > > + tk->xtime_sec = ts->tv_sec;
> > > + tk->xtime_nsec = ts->tv_nsec << tk->shift;
> > > +}
> > > +
> > > +
> > > +static void timekeeper_xtime_add(struct timekeeper *tk,
> > > + const struct timespec *ts)
> >
> > Pointless (because ugly) line break.
>
> Ack on your other comments, but I'm not sure I'm following you here.
> What would you rather see in this case?

Well, either not break the line really (it's just trivially
above col80: it's 83 cols), or do a *sensible* line break - one
of:

static void timekeeper_xtime_add(struct timekeeper *tk,
const struct timespec *ts)

(here the arguments align vertically)

Or:

static void
timekeeper_xtime_add(struct timekeeper *tk, const struct timespec *ts)

(here he return type is on a separate line)

Or, my favorite, just make the name shorter, because it's too
long:

static void tk_xtime_add(struct timekeeper *tk, const struct timespec *ts)

Obviously this applies to other functions as well - the tk_*()
method pattern should be applied consistently. Anyone reading
time code will know that 'tk' is about the global timekeeper
structure - no need to use the verbose name in methods.

Thanks,

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