Re: [PATCH v2] PM / Sleep: Print name of wakeup source that abortssuspend

From: Alan Stern
Date: Mon Aug 06 2012 - 10:42:53 EST


On Mon, 6 Aug 2012, Rafael J. Wysocki wrote:

> On Monday, August 06, 2012, Alan Stern wrote:
> > On Sun, 5 Aug 2012, Rafael J. Wysocki wrote:
> >
> > > > v2
> > > > use ktime_to_ns() instead of comparisons on .tv64 field
> >
> > What is the reason for this? It apparently adds complexity and code
> > (on non-64-bit systems) to no purpose.
>
> I don't think accessing the internals of ktime_t is appropriate,
> even though avoiding that may result in some computational cost.

I asked this question because I recently added some code that does the
very same thing, using the .tv64 field instead of doing any
conversions.

Thomas, is there any general advice on how to compare two ktime_t
values? Is it acceptable for general code to use the .tv64 field for
this? The comments in ktime.h say that the encoding was chosen partly
for this very reason.

Alan Stern

--
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/