Re: [PATCH] Turn rdmsr, rdtsc into inline functions, clarify names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2006-08-06 at 05:16 +0200, Andi Kleen wrote:
> > 	Please reconsider.  This isn't about being pretty, it's about not
> > having hidden side-effects,
> 
> I wouldn't call it hidden, it's well defined in the architecture.

Sorry Andi, I'm not talking about the asm, which is fine.  I'm talking
about the function-style macro which alters its arguments directly.
It's very bad form.

	int a, b;
	rdtsc(a, b);

> > and having typechecking.
> 
> The existing code will already reject any non integer and I don't
> see a particular need to be more strict than that.

Um?

	u64 c;
	int a,b;

	rdtsc(&a, &b);
	rdtscl(c);

These macros are badly named and don't check for bad usage.  Sure, less
than 1% of uses is wrong at the moment, but I'm volunteering to fix them
because I think it sets a bad example and sets us up for more bugs.

I feel fairly strongly about this, but I'll drop the x86_64 changes.

Rusty.
-- 
Help! Save Australia from the worst of the DMCA: http://linux.org.au/law

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux