lkml.org 
[lkml]   [2012]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] time: Condense timekeeper.xtime into xtime_sec

* John Stultz <john.stultz@linaro.org> wrote:

> On Tue, 2012-02-28 at 09:06 +0100, Ingo Molnar wrote:
> > * John Stultz <john.stultz@linaro.org> 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


\
 
 \ /
  Last update: 2012-02-28 09:33    [W:0.036 / U:9.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site