Skip to content

Commit 0f2a55d

Browse files
Tetsuo Handaxjamesmorris
authored andcommitted
TOMOYO: Update kernel-doc.
Update comments for scripts/kernel-doc and fix some of errors reported by scripts/checkpatch.pl . Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
1 parent c920669 commit 0f2a55d

13 files changed

Lines changed: 269 additions & 62 deletions

File tree

‎security/tomoyo/audit.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/audit.c
33
*
4-
* Pathname restriction functions.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include "common.h"

‎security/tomoyo/common.c‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/common.c
33
*
4-
* Common functions for TOMOYO.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include <linux/uaccess.h>
@@ -775,6 +773,14 @@ static void tomoyo_read_profile(struct tomoyo_io_buffer *head)
775773
goto next;
776774
}
777775

776+
/**
777+
* tomoyo_same_manager - Check for duplicated "struct tomoyo_manager" entry.
778+
*
779+
* @a: Pointer to "struct tomoyo_acl_head".
780+
* @b: Pointer to "struct tomoyo_acl_head".
781+
*
782+
* Returns true if @a == @b, false otherwise.
783+
*/
778784
static bool tomoyo_same_manager(const struct tomoyo_acl_head *a,
779785
const struct tomoyo_acl_head *b)
780786
{
@@ -1516,6 +1522,7 @@ static void tomoyo_read_pid(struct tomoyo_io_buffer *head)
15161522
tomoyo_set_string(head, domain->domainname->name);
15171523
}
15181524

1525+
/* String table for domain transition control keywords. */
15191526
static const char *tomoyo_transition_type[TOMOYO_MAX_TRANSITION_TYPE] = {
15201527
[TOMOYO_TRANSITION_CONTROL_NO_RESET] = "no_reset_domain ",
15211528
[TOMOYO_TRANSITION_CONTROL_RESET] = "reset_domain ",
@@ -1525,6 +1532,7 @@ static const char *tomoyo_transition_type[TOMOYO_MAX_TRANSITION_TYPE] = {
15251532
[TOMOYO_TRANSITION_CONTROL_KEEP] = "keep_domain ",
15261533
};
15271534

1535+
/* String table for grouping keywords. */
15281536
static const char *tomoyo_group_name[TOMOYO_MAX_GROUP] = {
15291537
[TOMOYO_PATH_GROUP] = "path_group ",
15301538
[TOMOYO_NUMBER_GROUP] = "number_group ",

‎security/tomoyo/domain.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/domain.c
33
*
4-
* Domain transition functions for TOMOYO.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include "common.h"
@@ -182,10 +180,10 @@ LIST_HEAD(tomoyo_domain_list);
182180
*/
183181
static const char *tomoyo_last_word(const char *name)
184182
{
185-
const char *cp = strrchr(name, ' ');
186-
if (cp)
187-
return cp + 1;
188-
return name;
183+
const char *cp = strrchr(name, ' ');
184+
if (cp)
185+
return cp + 1;
186+
return name;
189187
}
190188

191189
/**

‎security/tomoyo/file.c‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/file.c
33
*
4-
* Pathname restriction functions.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include "common.h"
@@ -154,7 +152,7 @@ static bool tomoyo_get_realpath(struct tomoyo_path_info *buf, struct path *path)
154152
tomoyo_fill_path_info(buf);
155153
return true;
156154
}
157-
return false;
155+
return false;
158156
}
159157

160158
/**
@@ -883,16 +881,16 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1,
883881
switch (operation) {
884882
struct dentry *dentry;
885883
case TOMOYO_TYPE_RENAME:
886-
case TOMOYO_TYPE_LINK:
884+
case TOMOYO_TYPE_LINK:
887885
dentry = path1->dentry;
888-
if (!dentry->d_inode || !S_ISDIR(dentry->d_inode->i_mode))
889-
break;
890-
/* fall through */
891-
case TOMOYO_TYPE_PIVOT_ROOT:
892-
tomoyo_add_slash(&buf1);
893-
tomoyo_add_slash(&buf2);
886+
if (!dentry->d_inode || !S_ISDIR(dentry->d_inode->i_mode))
887+
break;
888+
/* fall through */
889+
case TOMOYO_TYPE_PIVOT_ROOT:
890+
tomoyo_add_slash(&buf1);
891+
tomoyo_add_slash(&buf2);
894892
break;
895-
}
893+
}
896894
r.obj = &obj;
897895
r.param_type = TOMOYO_TYPE_PATH2_ACL;
898896
r.param.path2.operation = operation;

‎security/tomoyo/gc.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/*
22
* security/tomoyo/gc.c
33
*
4-
* Implementation of the Domain-Based Mandatory Access Control.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
7-
*
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
85
*/
96

107
#include "common.h"
@@ -455,7 +452,7 @@ static bool tomoyo_collect_member(const enum tomoyo_policy_id id,
455452
if (!tomoyo_add_to_gc(id, &member->list))
456453
return false;
457454
}
458-
return true;
455+
return true;
459456
}
460457

461458
/**

‎security/tomoyo/group.c‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
/*
22
* security/tomoyo/group.c
33
*
4-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
55
*/
66

77
#include <linux/slab.h>
88
#include "common.h"
99

10+
/**
11+
* tomoyo_same_path_group - Check for duplicated "struct tomoyo_path_group" entry.
12+
*
13+
* @a: Pointer to "struct tomoyo_acl_head".
14+
* @b: Pointer to "struct tomoyo_acl_head".
15+
*
16+
* Returns true if @a == @b, false otherwise.
17+
*/
1018
static bool tomoyo_same_path_group(const struct tomoyo_acl_head *a,
11-
const struct tomoyo_acl_head *b)
19+
const struct tomoyo_acl_head *b)
1220
{
1321
return container_of(a, struct tomoyo_path_group, head)->member_name ==
1422
container_of(b, struct tomoyo_path_group, head)->member_name;
1523
}
1624

25+
/**
26+
* tomoyo_same_number_group - Check for duplicated "struct tomoyo_number_group" entry.
27+
*
28+
* @a: Pointer to "struct tomoyo_acl_head".
29+
* @b: Pointer to "struct tomoyo_acl_head".
30+
*
31+
* Returns true if @a == @b, false otherwise.
32+
*/
1733
static bool tomoyo_same_number_group(const struct tomoyo_acl_head *a,
18-
const struct tomoyo_acl_head *b)
34+
const struct tomoyo_acl_head *b)
1935
{
2036
return !memcmp(&container_of(a, struct tomoyo_number_group, head)
2137
->number,
@@ -29,7 +45,7 @@ static bool tomoyo_same_number_group(const struct tomoyo_acl_head *a,
2945
* tomoyo_write_group - Write "struct tomoyo_path_group"/"struct tomoyo_number_group" list.
3046
*
3147
* @param: Pointer to "struct tomoyo_acl_param".
32-
* @type: Type of this group.
48+
* @type: Type of this group.
3349
*
3450
* Returns 0 on success, negative value otherwise.
3551
*/
@@ -70,8 +86,8 @@ int tomoyo_write_group(struct tomoyo_acl_param *param, const u8 type)
7086
/**
7187
* tomoyo_path_matches_group - Check whether the given pathname matches members of the given pathname group.
7288
*
73-
* @pathname: The name of pathname.
74-
* @group: Pointer to "struct tomoyo_path_group".
89+
* @pathname: The name of pathname.
90+
* @group: Pointer to "struct tomoyo_path_group".
7591
*
7692
* Returns matched member's pathname if @pathname matches pathnames in @group,
7793
* NULL otherwise.

‎security/tomoyo/load_policy.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/load_policy.c
33
*
4-
* Policy loader launcher for TOMOYO.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include "common.h"

‎security/tomoyo/memory.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/memory.c
33
*
4-
* Memory management functions for TOMOYO.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include <linux/hash.h>

‎security/tomoyo/mount.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* security/tomoyo/mount.c
33
*
4-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
55
*/
66

77
#include <linux/slab.h>
@@ -62,7 +62,7 @@ static bool tomoyo_check_mount_acl(struct tomoyo_request_info *r,
6262
* tomoyo_mount_acl - Check permission for mount() operation.
6363
*
6464
* @r: Pointer to "struct tomoyo_request_info".
65-
* @dev_name: Name of device file.
65+
* @dev_name: Name of device file. Maybe NULL.
6666
* @dir: Pointer to "struct path".
6767
* @type: Name of filesystem type.
6868
* @flags: Mount options.
@@ -175,11 +175,11 @@ static int tomoyo_mount_acl(struct tomoyo_request_info *r, char *dev_name,
175175
/**
176176
* tomoyo_mount_permission - Check permission for mount() operation.
177177
*
178-
* @dev_name: Name of device file.
178+
* @dev_name: Name of device file. Maybe NULL.
179179
* @path: Pointer to "struct path".
180-
* @type: Name of filesystem type. May be NULL.
180+
* @type: Name of filesystem type. Maybe NULL.
181181
* @flags: Mount options.
182-
* @data_page: Optional data. May be NULL.
182+
* @data_page: Optional data. Maybe NULL.
183183
*
184184
* Returns 0 on success, negative value otherwise.
185185
*/

‎security/tomoyo/realpath.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/*
22
* security/tomoyo/realpath.c
33
*
4-
* Pathname calculation functions for TOMOYO.
5-
*
6-
* Copyright (C) 2005-2010 NTT DATA CORPORATION
4+
* Copyright (C) 2005-2011 NTT DATA CORPORATION
75
*/
86

97
#include <linux/types.h>

0 commit comments

Comments
 (0)