Skip to contentSkip to conversation

sysfs: remove exports of sysfs_*change_owner()

PATCH In review Greg Kroah-Hartman 4 participants 7 messages Feb 5 Driver core

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/2 sysfs: remove exports of sysfs_*change_owner()

Both sysfs_change_owner() and sysfs_file_change_owner() are exported to modules, but there are no in-kernel module users, so remove the exports so that crazy out-of-tree drivers don't get the impression that it is safe to call these functions at all.

---
 fs/sysfs/file.c | 2 --
 1 file changed, 2 deletions(-)
fs/sysfs/file.c +0 -2
index 3825e780cc58..a8176c875f55 100644
@@ -689,7 +689,6 @@ int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
 
 	return error;
 }
-EXPORT_SYMBOL_GPL(sysfs_file_change_owner);
 
 /**
  *	sysfs_change_owner - change owner of the given object.
@@ -736,7 +735,6 @@ int sysfs_change_owner(struct kobject *kobj, kuid_t kuid, kgid_t kgid)
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(sysfs_change_owner);
 
 /**
  *	sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 2/2 driver core: remove device_change_owner() export

The function, device_change_owner() is exported for modules to use, but there are no in-kernel users of it, so remove the export to prevent out-of-tree code from thinking this is a safe function to call.

---
 drivers/base/core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/base/core.c +0 -1
index 40de2f51a1b1..f599a1384eec 100644
@@ -4781,7 +4781,6 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
 	put_device(dev);
 	return error;
 }
-EXPORT_SYMBOL_GPL(device_change_owner);
 
 /**
  * device_shutdown - call ->shutdown() on each device to shutdown.
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] driver core: remove device_change_owner() export

In reply to Greg Kroah-Hartman
Quoted 6 lines · Greg Kroah-Hartman

The function, device_change_owner() is exported for modules to use, but there are no in-kernel users of it, so remove the export to prevent out-of-tree code from thinking this is a safe function to call.

Quoted 19 lines
---
 drivers/base/core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/base/core.c +0 -2
index 40de2f51a1b1..f599a1384eec 100644
@@ -4781,7 +4781,6 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid)
        put_device(dev);
        return error;
 }
-EXPORT_SYMBOL_GPL(device_change_owner);
 
 /**
  * device_shutdown - call ->shutdown() on each device to shutdown.
--

2.53.0

maintainer Reviewed-by on v1 1/2
#4 lore raw
In reply to Greg Kroah-Hartman
Quoted 6 lines · Greg Kroah-Hartman

Both sysfs_change_owner() and sysfs_file_change_owner() are exported to modules, but there are no in-kernel module users, so remove the exports so that crazy out-of-tree drivers don't get the impression that it is safe to call these functions at all.

maintainer Reviewed-by on v1 1/2
#5 lore raw
In reply to Greg Kroah-Hartman
Quoted 7 lines · Greg Kroah-Hartman

Both sysfs_change_owner() and sysfs_file_change_owner() are exported to modules, but there are no in-kernel module users, so remove the exports so that crazy out-of-tree drivers don't get the impression that it is safe to call these functions at all.

Quoted 27 lines
---
 fs/sysfs/file.c | 2 --
 1 file changed, 2 deletions(-)
fs/sysfs/file.c +0 -3
index 3825e780cc58..a8176c875f55 100644
@@ -689,7 +689,6 @@ int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
 
        return error;
 }
-EXPORT_SYMBOL_GPL(sysfs_file_change_owner);
 
 /**
  *     sysfs_change_owner - change owner of the given object.
@@ -736,7 +735,6 @@ int sysfs_change_owner(struct kobject *kobj, kuid_t kuid, kgid_t kgid)
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(sysfs_change_owner);
 
 /**
  *     sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
--

2.53.0

Reviewed-by on v1 1/2
#6 lore raw
In reply to Greg Kroah-Hartman
Quoted 6 lines · Greg Kroah-Hartman

Both sysfs_change_owner() and sysfs_file_change_owner() are exported to modules, but there are no in-kernel module users, so remove the exports so that crazy out-of-tree drivers don't get the impression that it is safe to call these functions at all.

:)

Quoted 27 lines
---
 fs/sysfs/file.c | 2 --
 1 file changed, 2 deletions(-)
fs/sysfs/file.c +0 -2
index 3825e780cc58..a8176c875f55 100644
@@ -689,7 +689,6 @@ int sysfs_file_change_owner(struct kobject *kobj, const char *name, kuid_t kuid,
 
 	return error;
 }
-EXPORT_SYMBOL_GPL(sysfs_file_change_owner);
 
 /**
  *	sysfs_change_owner - change owner of the given object.
@@ -736,7 +735,6 @@ int sysfs_change_owner(struct kobject *kobj, kuid_t kuid, kgid_t kgid)
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(sysfs_change_owner);
 
 /**
  *	sysfs_emit - scnprintf equivalent, aware of PAGE_SIZE buffer.
Signature · 1 line
2.53.0
Signature · 1 line
Lee Jones [李琼斯]