* Code obfuscation in acpi
@ 2003-01-18 21:31 Pavel Machek
[not found] ` <20030118213134.GA8968-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2003-01-18 21:31 UTC (permalink / raw)
To: kernel list, ACPI mailing list, Andrew Grover
#define acpi_driver_data(d) ((d)->driver_data)
... very nice for obfuscating code ...
Pavel
--
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Code obfuscation in acpi
[not found] ` <20030118213134.GA8968-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
@ 2003-01-18 22:32 ` Jeff Garzik
[not found] ` <20030118223210.GA31860-bB7D8CACdjo@public.gmane.org>
2003-01-20 1:44 ` Rik van Riel
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2003-01-18 22:32 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list, ACPI mailing list, Andrew Grover
On Sat, Jan 18, 2003 at 10:31:34PM +0100, Pavel Machek wrote:
>
> #define acpi_driver_data(d) ((d)->driver_data)
>
> ... very nice for obfuscating code ...
sysfs-based buses use <foo>_{get,set}_drvdata, which looks exactly the
same as this here.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Code obfuscation in acpi
[not found] ` <20030118223210.GA31860-bB7D8CACdjo@public.gmane.org>
@ 2003-01-18 22:39 ` Pavel Machek
0 siblings, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2003-01-18 22:39 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Pavel Machek, kernel list, ACPI mailing list, Andrew Grover
Hi!
> > #define acpi_driver_data(d) ((d)->driver_data)
> >
> > ... very nice for obfuscating code ...
>
> sysfs-based buses use <foo>_{get,set}_drvdata, which looks exactly the
> same as this here.
I think such wrappers are really bad idea, see for example this: I
thought "what kind of cleverness is going on here,", and it was very
simple in fact.
else {
entry->proc_fops = &acpi_thermal_state_fops;
entry->data = acpi_driver_data(device);
}
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Code obfuscation in acpi
[not found] ` <20030118213134.GA8968-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2003-01-18 22:32 ` Jeff Garzik
@ 2003-01-20 1:44 ` Rik van Riel
1 sibling, 0 replies; 4+ messages in thread
From: Rik van Riel @ 2003-01-20 1:44 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list, ACPI mailing list, Andrew Grover
On Sat, 18 Jan 2003, Pavel Machek wrote:
> #define acpi_driver_data(d) ((d)->driver_data)
>
> ... very nice for obfuscating code ...
This is usually called "abstraction" and allows you to change
the data structures (when needed) without breaking all the code.
You can learn from this. If swsusp used abstractions it wouldn't
need to have to stick its nose into the code and data structures
from other subsystems and it might even stop breaking every other
release.
cheers,
Rik
--
Bravely reimplemented by the knights who say "NIH".
http://www.surriel.com/ http://guru.conectiva.com/
Current spamtrap: <a href=mailto:"october-ebMLmSuQjDVBDgjK7y7TUQ@public.gmane.org">october@surriel.com</a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-20 1:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-18 21:31 Code obfuscation in acpi Pavel Machek
[not found] ` <20030118213134.GA8968-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2003-01-18 22:32 ` Jeff Garzik
[not found] ` <20030118223210.GA31860-bB7D8CACdjo@public.gmane.org>
2003-01-18 22:39 ` Pavel Machek
2003-01-20 1:44 ` Rik van Riel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox