12 Mar, 2019

2 commits

  • There is no need to have non-static local data structures. otherwise
    sparse is not happy:

    CHECK drivers/acpi/acpi_configfs.c
    drivers/acpi/acpi_configfs.c:100:31: warning: symbol 'acpi_table_bin_attrs' was not declared. Should it be static?
    drivers/acpi/acpi_configfs.c:196:27: warning: symbol 'acpi_table_attrs' was not declared. Should it be static?
    drivers/acpi/acpi_configfs.c:236:34: warning: symbol 'acpi_table_group_ops' was not declared. Should it be static?

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     
  • There is no need to have non-static local functions. otherwise
    compiler is not happy:

    CC [M] drivers/acpi/acpi_configfs.o
    drivers/acpi/acpi_configfs.c:105:9: warning: no previous prototype for ‘acpi_table_signature_show’ [-Wmissing-prototypes]
    ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
    ^~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/acpi/acpi_configfs.c:115:9: warning: no previous prototype for ‘acpi_table_length_show’ [-Wmissing-prototypes]
    ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
    ^~~~~~~~~~~~~~~~~~~~~~
    ...

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki

    Andy Shevchenko
     

19 Oct, 2017

1 commit

  • Make these structures const as they are either passed to the functions
    having the argument as const or stored as a reference in the "ci_type"
    const field of a config_item structure.

    Done using Coccienlle.

    Signed-off-by: Bhumika Goyal
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Christoph Hellwig

    Bhumika Goyal
     

22 Jun, 2017

1 commit

  • Call directly into acpica to load a table to obtain its index on return.
    We choose the direct call of acpica internal functions to avoid having
    to modify its API which is used outside of Linux as well.

    Use that index to unload the table again when the corresponding
    directory in configfs gets removed. This allows to change SSDTs without
    rebooting the system. It also allows to destroy devices again that a
    dynamically loaded SSDT created.

    This is widely similar to the DT overlay behavior.

    Signed-off-by: Jan Kiszka
    Signed-off-by: Rafael J. Wysocki

    Jan Kiszka
     

11 Jul, 2016

1 commit

  • If we compile ACPI configfs.c as module it will confuse the linker as it
    hides symbols from the actual configfs:

    Kernel: arch/x86/boot/bzImage is ready (#1236)
    MODPOST 5739 modules
    ERROR: "configfs_unregister_subsystem" [samples/configfs/configfs_sample.ko] undefined!
    ERROR: "configfs_register_subsystem" [samples/configfs/configfs_sample.ko] undefined!
    ERROR: "config_group_init" [samples/configfs/configfs_sample.ko] undefined!
    ERROR: "config_item_init_type_name" [samples/configfs/configfs_sample.ko] undefined!
    ERROR: "config_group_init_type_name" [samples/configfs/configfs_sample.ko] undefined!
    ERROR: "configfs_undepend_item" [fs/ocfs2/cluster/ocfs2_nodemanager.ko] undefined!
    ...

    Prevent these by renaming the file to acpi_configfs.c instead.

    Reported-by: Scott Lawson
    Signed-off-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Mika Westerberg