diff options
author | Tejun Heo <tj@kernel.org> | 2013-09-11 22:29:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 18:34:38 -0400 |
commit | cfec0bc835c84d3d3723d4955587f05a94879b26 (patch) | |
tree | 18c1239d9113ebc30ca037b1a0025b95ffb7c405 /fs/sysfs/file.c | |
parent | 388975cccaaf11abd47525f664c76891c440481a (diff) |
sysfs: @name comes before @ns
Some internal sysfs functions which take explicit namespace argument
are weird in that they place the optional @ns in front of @name which
is contrary to the established convention. This is confusing and
error-prone especially as @ns and @name may be interchanged without
causing compilation warning.
Swap the positions of @name and @ns in the following internal
functions.
sysfs_find_dirent()
sysfs_rename()
sysfs_hash_and_remove()
sysfs_name_hash()
sysfs_name_compare()
create_dir()
This patch doesn't introduce any functional changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 0f3214a70985..4697019fafa3 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -466,9 +466,9 @@ void sysfs_notify(struct kobject *k, const char *dir, const char *attr) | |||
466 | mutex_lock(&sysfs_mutex); | 466 | mutex_lock(&sysfs_mutex); |
467 | 467 | ||
468 | if (sd && dir) | 468 | if (sd && dir) |
469 | sd = sysfs_find_dirent(sd, NULL, dir); | 469 | sd = sysfs_find_dirent(sd, dir, NULL); |
470 | if (sd && attr) | 470 | if (sd && attr) |
471 | sd = sysfs_find_dirent(sd, NULL, attr); | 471 | sd = sysfs_find_dirent(sd, attr, NULL); |
472 | if (sd) | 472 | if (sd) |
473 | sysfs_notify_dirent(sd); | 473 | sysfs_notify_dirent(sd); |
474 | 474 | ||
@@ -594,7 +594,7 @@ int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr, | |||
594 | mutex_lock(&sysfs_mutex); | 594 | mutex_lock(&sysfs_mutex); |
595 | 595 | ||
596 | rc = -ENOENT; | 596 | rc = -ENOENT; |
597 | sd = sysfs_find_dirent(kobj->sd, NULL, attr->name); | 597 | sd = sysfs_find_dirent(kobj->sd, attr->name, NULL); |
598 | if (!sd) | 598 | if (!sd) |
599 | goto out; | 599 | goto out; |
600 | 600 | ||
@@ -621,7 +621,7 @@ void sysfs_remove_file_ns(struct kobject *kobj, const struct attribute *attr, | |||
621 | { | 621 | { |
622 | struct sysfs_dirent *dir_sd = kobj->sd; | 622 | struct sysfs_dirent *dir_sd = kobj->sd; |
623 | 623 | ||
624 | sysfs_hash_and_remove(dir_sd, ns, attr->name); | 624 | sysfs_hash_and_remove(dir_sd, attr->name, ns); |
625 | } | 625 | } |
626 | EXPORT_SYMBOL_GPL(sysfs_remove_file_ns); | 626 | EXPORT_SYMBOL_GPL(sysfs_remove_file_ns); |
627 | 627 | ||
@@ -649,7 +649,7 @@ void sysfs_remove_file_from_group(struct kobject *kobj, | |||
649 | else | 649 | else |
650 | dir_sd = sysfs_get(kobj->sd); | 650 | dir_sd = sysfs_get(kobj->sd); |
651 | if (dir_sd) { | 651 | if (dir_sd) { |
652 | sysfs_hash_and_remove(dir_sd, NULL, attr->name); | 652 | sysfs_hash_and_remove(dir_sd, attr->name, NULL); |
653 | sysfs_put(dir_sd); | 653 | sysfs_put(dir_sd); |
654 | } | 654 | } |
655 | } | 655 | } |