Commit 6238a402 authored by Xingang Wang's avatar Xingang Wang Committed by Zheng Zengkai
Browse files

arm64/mpam: fix __mpam_device_create() section mismatch error

ascend inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4L735


CVE: NA

---------------------------------------------------

Fix modpost Section mismatch error in __mpam_device_create() and others.
These warnings will occur in high version gcc, for example 10.1.0.

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

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

  WARNING: vmlinux.o(.text.unlikely+0x5a9c): Section mismatch in reference from
  the function resctrl_group_init() to the function .init.text:resctrl_group_setup_root()
  The function resctrl_group_init() references
  the function __init resctrl_group_setup_root().
  This is often because resctrl_group_init lacks a __init
  annotation or the annotation of resctrl_group_setup_root is wrong.
  [...]

Fixes: 682eefba ("arm64/mpam: remove __init macro to support driver probe")
Signed-off-by: default avatarXingang Wang <wangxingang5@huawei.com>
Signed-off-by: default avatarWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: default avatarCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent b2fb86b1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ static void mpam_failed(struct work_struct *work)
	mutex_unlock(&mpam_cpuhp_lock);
}

static struct mpam_device * __init
static struct mpam_device *
mpam_device_alloc(struct mpam_component *comp)
{
	struct mpam_device *dev;
@@ -656,7 +656,7 @@ static void mpam_devices_destroy(struct mpam_component *comp)
	}
}

static struct mpam_component * __init mpam_component_alloc(int id)
static struct mpam_component *mpam_component_alloc(int id)
{
	struct mpam_component *comp;

@@ -694,7 +694,7 @@ struct mpam_component *mpam_component_get(struct mpam_class *class, int id,
	return comp;
}

static struct mpam_class * __init mpam_class_alloc(u8 level_idx,
static struct mpam_class *mpam_class_alloc(u8 level_idx,
			enum mpam_class_types type)
{
	struct mpam_class *class;
@@ -733,7 +733,7 @@ static void mpam_class_destroy(struct mpam_class *class)
	}
}

static struct mpam_class * __init mpam_class_get(u8 level_idx,
static struct mpam_class *mpam_class_get(u8 level_idx,
						enum mpam_class_types type,
						bool alloc)
{
+1 −1
Original line number Diff line number Diff line
@@ -1130,7 +1130,7 @@ void closid_free(int closid)
 * Choose a width for the resource name and resource data based on the
 * resource that has widest name and cbm.
 */
static __init void mpam_init_padding(void)
static void mpam_init_padding(void)
{
	int cl;
	struct mpam_resctrl_res *res;
+1 −1
Original line number Diff line number Diff line
@@ -1116,7 +1116,7 @@ static void resctrl_group_default_init(struct resctrl_group *r)
	r->type = RDTCTRL_GROUP;
}

static int __init resctrl_group_setup_root(void)
static int resctrl_group_setup_root(void)
{
	int ret;