Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\label.c Create Date:2022-07-28 19:54:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:assumes vec is sorted* Assumes @vec has null terminator at vec[n], and will null terminate* vec[n - dups]

Proto:static inline int unique(struct aa_profile **vec, int n)

Type:int

Parameter:

TypeParameterName
struct aa_profile **vec
intn
226  dups = 0
228  AA_BUG(n < 1)
229  AA_BUG(!vec)
231  pos = 0
232  When i < n cycle
233  res = profile_cmp - profile comparison for set ordering*@a: profile to compare (NOT NULL)*@b: profile to compare (NOT NULL)* Returns: <0 if a < b* ==0 if a == b* >0 if a > b
235  AA_BUG(res > 0, "vec not sorted")
236  If res == 0 Then
239  dups++
240  Continue
242  pos++
243  If dups Then vec[pos] = vec[i]
247  AA_BUG(dups < 0)
249  Return dups
Caller
NameDescribe
aa_vec_uniqueaa_vec_unique - canonical sort and unique a list of profiles*@n: number of refcounted profiles in the list (@n > 0)*@vec: list of profiles to sort and merge* Returns: the number of duplicates eliminated == references put* If @flags & VEC_FLAG_TERMINATE