dereferencing module-internal pointer in scripts/mod/file2alias.c
Hi,
Is there any feasible way to dereference a pointer inside __mod_*_device_table which points to a string?
e.g.:
include/linux/mod_devicetable.h:
struct pcmcia_device_id {
...
const char * prod_id;
...
}drivers/some/driver.c:
static struct pcmcia_device_id some_ids[] = {
{.prod_id = "some device string", ...},
...
}MODULE_DEVICE_TABLE(some_ids);
scripts/mod/file2alias.c:
do_pcmcia_entry (..., struct pcmcia_device_id *id, ...)
{
const char *tmp = id->prod_id + SOME_MAGIC_VALUE;
}Thanks,
Dominik
Quoted 4 lines · Dominik Brodowski
Hi,
Is there any feasible way to dereference a pointer inside __mod_*_device_table which points to a string?
No, because we would basically need to perform relocations to do so. That is why arrays are used in the current structures.
Rusty.
Signature · 1 line
A bad analogy is like a leaky screwdriver -- Richard Braakman