arch/x86: sfi: intel_scu_devices_create() section mismatch warnings

From: Darren Hart
Date: Fri Dec 18 2015 - 16:11:35 EST


I noticed the following in my build logs:

WARNING: vmlinux.o(.text+0xa90d8): Section mismatch in reference from the
function intel_scu_devices_create() to the function
.init.text:i2c_register_board_info()
The function intel_scu_devices_create() references
the function __init i2c_register_board_info().
This is often because intel_scu_devices_create lacks a __init
annotation or the annotation of i2c_register_board_info is wrong.

The relevant code in arch/x86/platform/intel-mid/sfi.c:

> /* Called by IPC driver */
> void intel_scu_devices_create(void)
> {
> int i;
>
> for (i = 0; i < ipc_next_dev; i++)
> platform_device_add(ipc_devs[i]);
>
> for (i = 0; i < spi_next_dev; i++)
> spi_register_board_info(spi_devs[i], 1);
>
> for (i = 0; i < i2c_next_dev; i++) {
> struct i2c_adapter *adapter;
> struct i2c_client *client;
>
> adapter = i2c_get_adapter(i2c_bus[i]);
> if (adapter) {
> client = i2c_new_device(adapter, i2c_devs[i]);
> if (!client)
> pr_err("can't create i2c device %s\n",
> i2c_devs[i]->type);
> } else
> i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1);

i2c_register_board_info is annotated as __init and is intended for static
machine board-files.

The correct usage afaict is i2c_new_device() as used above. I presume what we're
doing here is falling back to the static style configuration if this driver
probes before the i2c adapters do?

What I wasn't able to determine quickly is if this is a safe thing to do and the
section mismatch can be ignored or not.


> }
> intel_scu_notifier_post(SCU_AVAILABLE, NULL);
> }

Thanks,

--
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/