No, "Included" in this context means that function1() can exist in the source files , and the linkage should be to the inline "dummy" function instead of the "real" function.
In the pervious link there is an example:
As an example, consider the following code in drivers/usb/hid-core.c:
Code:
static void hid_process_event (struct hid_device *hid,
struct hid_field *field,
struct hid_usage *usage,
__s32 value)
{
hid_dump_input(usage, value);
if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_hid_event(hid, field, usage, value);
#ifdef CONFIG_USB_HIDDEV
if (hid->claimed & HID_CLAIMED_HIDDEV)
hiddev_hid_event(hid, usage->hid, value);
#endif
}
Here the author does not want to call hiddev_hid_event() if a specific configuration option is not enabled. This is because that function will not even be present if the configuration option is not enabled.
To remove this #ifdef, the following change was made to include/linux/hiddev.h:
Code:
#ifdef CONFIG_USB_HIDDEV
extern void hiddev_hid_event (struct hid_device *,
unsigned int usage,
int value);
#else
static inline void
hiddev_hid_event (struct hid_device
*hid,
unsigned int usage,
int value) { }
#endif
Then drivers/usb/hid-core.c was changed to:
Code:
static void hid_process_event
(struct hid_device *hid,
struct hid_field *field,
struct hid_usage *usage,
__s32 value)
{
hid_dump_input(usage, value);
if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_hid_event(hid, field, usage, value);
if (hid->claimed & HID_CLAIMED_HIDDEV)
hiddev_hid_event(hid, usage->hid, value);
}
If CONFIG_USB_HIDDEV is not enabled, the compiler will replace the call to hiddev_hid_event() with a null function call and then optimize away the if statement entirely. This keeps the code readable and easier to maintain over time.