Code obfuscation in acpi

Code obfuscation in acpi

Post by Pavel Mache » Mon, 20 Jan 2003 00:30:10



#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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Code obfuscation in acpi

Post by Jeff Garzi » Mon, 20 Jan 2003 00:40:10



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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Code obfuscation in acpi

Post by Pavel Mache » Mon, 20 Jan 2003 00:50:07


Hi!

Quote:> > #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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Code obfuscation in acpi

Post by Rik van Rie » Tue, 21 Jan 2003 03:50:07



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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. ACPI IRQ routing (was [ACPI] ACPI source release updated (200 11205))

Hi Kai,

I also got ACPI IRQ routing working on a system over the weekend. Sounds
like yours is better, so great we'll adopt yours. Thanks for stepping up on
this.

<shrug>. Once we get it working, we can get it working right, and save the
1K.

Like I said above, I think it's too early to be optimizing this code. My
main concern was more about integrating ACPI into pci-irq.c in a readable
manner. It is pretty $PIR-specific (no surprise there). Anyways let me work
with your new code and I will be able to comment more.

At this point, I'd think one to *enable* it would be better until the code
is tested more.

Regards -- Andy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Mandrake 8.2?

3. Code fragments/plug-ins for solaris?

4. An answer to no power off problem

5. Coding style in acpi/scan.c

6. Include math.h problem

7. ACPI/S3: simplify assembly code a bit

8. Partial Install Failure of CD 1-2

9. ACPI in 2.5 kills kbd on Via-ACPI systems [Re: kernel 2.5.10 problems]

10. Abit KV7 ACPI: Unable to set IRQ for PCI Interrupt Link [ALKD] (likely buggy ACPI BIOS)

11. BUG: 2.5.40: Accessing various ACPI state info fails to acquire ACPI mutex

12. acpi problem (/proc/acpi/event: No such file or directory)

13. New: ACPI interrupt storm when ACPI operates in IO-APIC-level mode