Hi,
On Thu, Oct 08, 2015 at 05:14:24PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev wrote:
> > If we failed to allocate a file descriptor, do not try to do it again on
> > the next iteration. There are few chances that we will hav
Hi David,
On Thu, Oct 08, 2015 at 05:06:57PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev wrote:
> > If idr_alloc() fails, we shouldn't call idr_remove() as latter produces
> > warning when called on non-allocated ids. Split cl
Hi,
On Thu, Oct 08, 2015 at 04:50:31PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev wrote:
> > - Move `r' and `ret' to scopes where they are used. Drop redundant
> >initialization of `ret'.
> >
> >
Hi,
On Thu, Oct 08, 2015 at 04:40:33PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > - Reduce scope of `owner' var to the block where it is actually used.
> >Use conditional operator to set its value.
> >
Hi,
On Thu, Oct 08, 2015 at 04:38:11PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > - Move `entry' and `owner' to the scope where they are used. Drop
> >redundand initialization of `entry'. Use condit
On Thu, Oct 08, 2015 at 04:34:27PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Do not initialize `name' and `ret' as values are assigned to them at
> > the first use by kdbus_pin_dst(). Simplify handling of
> &
On Thu, Oct 08, 2015 at 04:32:47PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Do not initialize `wait' and `name' as values are assigned to them at
> > first use: `wait' gets its value from kdbus_reply_
Hi,
On Thu, Oct 08, 2015 at 03:50:46PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Add comment on why we remove the same slice from free slices tree and
> > then add it back again when merging the slice to be relea
On Thu, Oct 08, 2015 at 04:30:59PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Rearrange tests a little to make them look cleaner.
>
> What's wrong with 'else if'?
Less verbose constructions are easier for our brain
Hi,
On Thu, Oct 08, 2015 at 04:28:29PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Assign zero to `ret' in the beginning of function instead of doing it
> > in the end.
> >
> > Signed-off-by: Sergei Zv
Hi David,
On Thu, Oct 08, 2015 at 04:24:30PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Replace the expression with more concise and readable equivalent. It can
> > be proven by opening parentheses:
> >
>
Hi,
On Fri, Oct 09, 2015 at 11:43:22AM +0800, Hillf Danton wrote:
> > @@ -730,15 +730,21 @@ static void kdbus_meta_export_caps(struct
> > kdbus_meta_caps *out,
> >
> > /*
> > * This translates the effective capabilities of 'cred' into the given
> > -* user-namespace. If the given
Hi David,
On Thu, Oct 08, 2015 at 05:20:34PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev wrote:
> > Hi all,
> >
> > This is a set of various kdbus code cleanups. Patches are ordered by
> > increasing complexity, star
Hi,
On Fri, Oct 09, 2015 at 11:43:22AM +0800, Hillf Danton wrote:
> > @@ -730,15 +730,21 @@ static void kdbus_meta_export_caps(struct
> > kdbus_meta_caps *out,
> >
> > /*
> > * This translates the effective capabilities of 'cred' into the given
> > -* user-namespace. If the given
Hi David,
On Thu, Oct 08, 2015 at 05:20:34PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Hi all,
> >
> > This is a set of various kdbus code cleanups. Patches are ordered by
> > in
Hi David,
On Thu, Oct 08, 2015 at 04:24:30PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Replace the expression with more concise and readable equivalent. It can
> > be proven by opening parent
Hi,
On Thu, Oct 08, 2015 at 04:28:29PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Assign zero to `ret' in the beginning of function instead of doing it
> > in the end.
> >
> >
On Thu, Oct 08, 2015 at 04:34:27PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Do not initialize `name' and `ret' as values are assigned to them at
> > the first use by kdbus_p
Hi,
On Thu, Oct 08, 2015 at 04:38:11PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > - Move `entry' and `owner' to the scope where they are used. Drop
> >redundand initialization of `entry
Hi,
On Thu, Oct 08, 2015 at 04:50:31PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > - Move `r' and `ret' to scopes where they are used. Drop redundant
> >initialization of `ret'.
On Thu, Oct 08, 2015 at 04:30:59PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Rearrange tests a little to make them look cleaner.
>
> What's wrong with 'else if'?
Less verbose constructio
Hi,
On Thu, Oct 08, 2015 at 03:50:46PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Add comment on why we remove the same slice from free slices tree and
> > then add it back again when mergi
On Thu, Oct 08, 2015 at 04:32:47PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > Do not initialize `wait' and `name' as values are assigned to them at
> > first use: `wait' gets its value fro
Hi,
On Thu, Oct 08, 2015 at 04:40:33PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:31 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > - Reduce scope of `owner' var to the block where it is actually used.
> >Use conditional operator to set
Hi David,
On Thu, Oct 08, 2015 at 05:06:57PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > If idr_alloc() fails, we shouldn't call idr_remove() as latter produces
> > warning when called on non-a
Hi,
On Thu, Oct 08, 2015 at 05:14:24PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Oct 8, 2015 at 1:32 PM, Sergei Zviagintsev <ser...@s15v.net> wrote:
> > If we failed to allocate a file descriptor, do not try to do it again on
> > the next iteration. There are fe
nd iovec as
they relate to the old code.
- struct kdbus_queue_entry: Fix typo: "messages" -> "message".
- kdbus_pool_slice_publish(): Remove obsolete line from the
description.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 6 +++---
ipc/kdbus/conne
if the process is a member of the given userns.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/metadata.c | 24 +++-
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/ipc/kdbus/metadata.c b/ipc/kdbus/metadata.c
index 71ca475a80d5..4ff4b99a40e0 100644
--- a/ipc
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.h | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ipc/kdbus/message.h b/ipc/kdbus/message.h
index 298f9c99dfcf..405a5668f9d5 100644
--- a/ipc/kdbus/message.h
+++ b/ipc/kdbus/message.h
@@ -27,11 +27,12 @@ struct
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/limits.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/ipc/kdbus/limits.h b/ipc/kdbus/limits.h
index bd47119cdf1b..5e4d2b5b0a9d 100644
--- a/ipc/kdbus/limits.h
+++ b/ipc/kdbus/limits.h
@@ -16,9 +16,6 @@
#include
-/* maximum size
Initialize `dot' during declaration but not in the for-loop, as it is
not used as a loop cursor.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/names.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index 6b31b38ac2ad..4dea83defc8e
Replace the expression with more concise and readable equivalent. It can
be proven by opening parentheses:
r & ~((p | i) & r) == r & (~(p | i) | ~r) ==
(r & ~(p | i)) | (r & ~r) == r & ~(p | i) == r & ~p & ~i
Signed-off-by: Sergei Zviagintsev
---
ipc
`name' is assigned the value at first use by kdbus_pin_dst(). Do not
initialize it during declaration.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index
Assign zero to `ret' in the beginning of function instead of doing it
in the end.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 4f3cd370ecd9..185ed3ba1bce
Do not initialize `c' as it is assigned a return value of
kdbus_conn_new() at the first use.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 4b5ed4bb59c7
Rearrange tests a little to make them look cleaner.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 93da7f539f74..a4d7414ecaea 100644
--- a/ipc/kdbus
kdbus_conn_entry_insert() returns 0 on success.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index a4d7414ecaea..db49f282a1bf 100644
--- a/ipc/kdbus/connection.c
+++ b
.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 16 +++-
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index b3c5f20a57d8..6a73ac3f444d 100644
--- a/ipc/kdbus/connection.c
+++ b/ipc/kdbus/connection.c
- Reduce scope of `owner' var to the block where it is actually used.
Use conditional operator to set its value.
- Drop initialization of `dst' as it gets value later.
- Drop separate exit point as we have only one use case of it.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus
Remove separate exit point as the only error case in the function is
when kdbus_staging_emit() fails. Assign a slice to temporary var first
to not clear it explicitly on error and to return an error code without
`ret' variable.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/queue.c | 16
- Move `r' and `ret' to scopes where they are used. Drop redundant
initialization of `ret'.
- Initialize `bus' on declaration.
- Replace list_for_each_entry_safe() with list_for_each_entry() when
iterating over list of replies.
- Drop redundant `continue'.
Signed-off-by: Sergei
Use goto to handle error paths in conventional way. Use conditional
operator instead of `remote_ret' var. Update the comment on waking up
remote peer.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 52 --
1 file changed, 21
roc < KDBUS_META_PROC_NORMAL' case we firstly do
'wanted &= ~flags' and then 'wanted & flags' in the return statement,
which is the same as 'wanted & 0'. Return 0 instead.
- Cosmetic cleanup of the return statement.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdb
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.h | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/ipc/kdbus/connection.h b/ipc/kdbus/connection.h
index 679f393d3e68..3b382b604348 100644
--- a/ipc/kdbus/connection.h
+++ b/ipc/kdbus/connection.h
Use goto to handle error paths in conventional way.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/names.c | 21 +
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index a1c3442f8e53..8e53681d1b7b 100644
--- a/ipc/kdbus
tor for memfd.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index f2176796390d..0653a085c104 100644
--- a/ipc/kdbus/message.c
+++ b/ipc/kdbus/message.c
@@ -181,6 +181,7 @@ int kdbus_gaps_inst
If we failed to allocate a file descriptor, do not try to do it again on
the next iteration. There are few chances that we will have success, and
we can simplify the algorithm assuming that valid fd numbers are not
mixed with -1 values.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.c
If idr_alloc() fails, we shouldn't call idr_remove() as latter produces
warning when called on non-allocated ids. Split cleanup code into three
parts for differrent cleanup scenarios before and after idr_alloc().
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/domain.c | 20
which is equivalent but more concise and readable (as we used
same vars in the code above).
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/domain.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/ipc/kdbus/domain.c b/ipc/kdbus/domain.c
.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/item.c | 26 ++
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/ipc/kdbus/item.c b/ipc/kdbus/item.c
index ce78dba03426..e6b6e2ca7e05 100644
--- a/ipc/kdbus/item.c
+++ b/ipc/kdbus/item.c
@@ -37,32 +37,26
- Assign `false' to *out_incomplete directly on no-op cases.
- Initialize `ret' with zero during declaration instead of doing it in
the end of the function.
- Initialize `fd' and `memfd' vars during declaration to be more
concise.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus
Current code checks return value of task_cgroup_path(), which can be
NULL if provided buffer isn't long enough to store path there, but
alters mp->valid in case of error, producing inconsistency. Return
-ENAMETOOLONG if task_cgroup_path() fails.
Signed-off-by: Sergei Zviagintsev
---
ipc/kd
Use conventional if-else logic instead of goto, which makes the function
easier to read.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/queue.c | 32
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/ipc/kdbus/queue.c b/ipc/kdbus/queue.c
index
Elements of `fds' array were set to -1 in case if we couldn't allocate
a fd. Verify that element contains a valid fd number before submitting
it to put_unused_fd().
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
Use list_next_entry() instead of list_first_entry().
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/queue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ipc/kdbus/queue.c b/ipc/kdbus/queue.c
index f9c44d7bae6d..90e8d16f5967 100644
--- a/ipc/kdbus/queue.c
+++ b/ipc
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/names.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index bf44ca3f12b6..6b31b38ac2ad 100644
--- a/ipc/kdbus/names.c
+++ b/ipc/kdbus/names.c
@@ -438,10 +438,7 @@ static void
'(s & m) != m' means that mask 'm' contains some bits which are not set
in 's', and this is literally equal to '~s & m'.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message
Do not initialize `name' and `ret' as values are assigned to them at
the first use by kdbus_pin_dst(). Simplify handling of
kdbus_conn_entry_insert() return value and drop useless goto.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 10 --
1 file changed, 4 insertions
Allow to reserve N elements in row. This eliminates duplicated code.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.c | 22 --
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index e337b1b1024a..f2176796390d
Check the value of `ret' instead of keeping separate exit point.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/pool.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index cb692a35755b..75a7366baa34 100644
--- a/ipc/kdbus/pool.c
Replace duplicated cleanup code with jump to exit point.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/message.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index c7ef23d40471..e337b1b1024a 100644
--- a/ipc/kdbus/message.c
' var, as it can be read "cred is a member of user_ns or
one of its parents" and "cred is the owner of ...".
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/metadata.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ipc/kdbus/metadata.c b/ipc/kd
We already reached the end of function at this point, so remove useless
goto.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/names.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index 4dea83defc8e..a1c3442f8e53 100644
--- a/ipc/kdbus/names.c
+++ b
gt;fds + fds' to be safe in the second
expression (as fds is size_t, quota->fds is converted to bigger
type).
Rewrite it in more obvious way. KDBUS_CONN_MAX_FDS_PER_USER is
checked at compile time to fill in quota->fds type (there is
BUILD_BUG_ON), so no further checks for quo
!name == (is_activator || is_policy_holder)
- Drop `privileged' var which is used only once to set value of
conn->privileged.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/ipc/kdbus/connection.c b/i
Use list_next_entry() and list_prev_entry().
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/pool.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index c26ef963d8d1..cb692a35755b 100644
--- a/ipc/kdbus/pool.c
+++ b/ipc/kdbus/pool.c
layout of this, split/join, etc if necessary.
Thanks, Sergei
Sergei Zviagintsev (44):
Documentation/kdbus: Document new name registry flags
uapi: kdbus.h: Kernel-doc fixes
kdbus: Kernel-docs and comments trivial fixes
kdbus: Update kernel-doc for struct kdbus_pool
kdbus: Add comment
Add words on how free and busy slices trees are sorted.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/pool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index 0433e26b777e..84afe96fbc22 100644
--- a/ipc/kdbus/pool.c
+++ b/ipc
- Fix typos and spelling errors, use proper case.
- struct kdbus_pids: Add PPID to description.
- struct kdbus_item: Add missing @pids, @fsd and
KDBUS_ITEM_PAYLOAD_OFF.
Signed-off-by: Sergei Zviagintsev
---
include/uapi/linux/kdbus.h | 43 +++
1
Add description of KDBUS_NAME_PRIMARY and KDBUS_NAME_ACQUIRED flags
which were added in commit 0486b859f05a ("kdbus: inform caller about
exact updates on NAME_ACQUIRE").
Signed-off-by: Sergei Zviagintsev
---
Documentation/kdbus/kdbus.name.xml | 42 +++-
Add comment on why we remove the same slice from free slices tree and
then add it back again when merging the slice to be released with
previous free slice.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/pool.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/ipc/kdbus/pool.c b/ipc
`name' is assigned the value at first use by kdbus_pin_dst(). Do not
initialize it during declaration.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/connection.c b/ipc
Assign zero to `ret' in the beginning of function instead of doing it
in the end.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
Do not initialize `c' as it is assigned a return value of
kdbus_conn_new() at the first use.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
Replace the expression with more concise and readable equivalent. It can
be proven by opening parentheses:
r & ~((p | i) & r) == r & (~(p | i) | ~r) ==
(r & ~(p | i)) | (r & ~r) == r & ~(p | i) == r & ~p & ~i
Signed-off-by: Sergei Zviagintsev
Allow to reserve N elements in row. This eliminates duplicated code.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/message.c | 22 --
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
Check the value of `ret' instead of keeping separate exit point.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/pool.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index cb692a35755b..75a7366baa34 100644
---
Replace duplicated cleanup code with jump to exit point.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/message.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ipc/kdbus/message.c b/ipc/kdbus/message.c
index c7ef23d40471..e337b1b1024a 100644
---
Use list_next_entry() instead of list_first_entry().
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/queue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ipc/kdbus/queue.c b/ipc/kdbus/queue.c
index f9c44d7bae6d..90e8d16f5967 100644
--- a/ipc
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/names.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index bf44ca3f12b6..6b31b38ac2ad 100644
--- a/ipc/kdbus/names.c
+++ b/ipc/kdbus/names.c
@@ -438,10
' var, as it can be read "cred is a member of user_ns or
one of its parents" and "cred is the owner of ...".
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/metadata.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ipc/kd
'(s & m) != m' means that mask 'm' contains some bits which are not set
in 's', and this is literally equal to '~s & m'.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/message.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/message
Do not initialize `name' and `ret' as values are assigned to them at
the first use by kdbus_pin_dst(). Simplify handling of
kdbus_conn_entry_insert() return value and drop useless goto.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 10 --
1 file c
We already reached the end of function at this point, so remove useless
goto.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/names.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index 4dea83defc8e..a1c3442f8e53 100644
---
gt;fds + fds' to be safe in the second
expression (as fds is size_t, quota->fds is converted to bigger
type).
Rewrite it in more obvious way. KDBUS_CONN_MAX_FDS_PER_USER is
checked at compile time to fill in quota->fds type (there is
BUILD_BUG_ON), so no further checks for quota-&g
!name == (is_activator || is_policy_holder)
- Drop `privileged' var which is used only once to set value of
conn->privileged.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/i
Use list_next_entry() and list_prev_entry().
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/pool.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index c26ef963d8d1..cb692a35755b 100644
--- a/ipc/kdbus/pool.c
Use goto to handle error paths in conventional way. Use conditional
operator instead of `remote_ret' var. Update the comment on waking up
remote peer.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 52 --
- Reduce scope of `owner' var to the block where it is actually used.
Use conditional operator to set its value.
- Drop initialization of `dst' as it gets value later.
- Drop separate exit point as we have only one use case of it.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.
Remove separate exit point as the only error case in the function is
when kdbus_staging_emit() fails. Assign a slice to temporary var first
to not clear it explicitly on error and to return an error code without
`ret' variable.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc
- Move `r' and `ret' to scopes where they are used. Drop redundant
initialization of `ret'.
- Initialize `bus' on declaration.
- Replace list_for_each_entry_safe() with list_for_each_entry() when
iterating over list of replies.
- Drop redundant `continue'.
Signed-off-by: Sergei
layout of this, split/join, etc if necessary.
Thanks, Sergei
Sergei Zviagintsev (44):
Documentation/kdbus: Document new name registry flags
uapi: kdbus.h: Kernel-doc fixes
kdbus: Kernel-docs and comments trivial fixes
kdbus: Update kernel-doc for struct kdbus_pool
kdbus: Add comment
Add words on how free and busy slices trees are sorted.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/pool.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/pool.c b/ipc/kdbus/pool.c
index 0433e26b777e..84afe96fbc22 100644
--- a/ipc
Add description of KDBUS_NAME_PRIMARY and KDBUS_NAME_ACQUIRED flags
which were added in commit 0486b859f05a ("kdbus: inform caller about
exact updates on NAME_ACQUIRE").
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
Documentation/kdbus/kdb
Add comment on why we remove the same slice from free slices tree and
then add it back again when merging the slice to be released with
previous free slice.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/pool.c | 6 ++
1 file changed, 6 insertions(+)
diff --git
- Fix typos and spelling errors, use proper case.
- struct kdbus_pids: Add PPID to description.
- struct kdbus_item: Add missing @pids, @fsd and
KDBUS_ITEM_PAYLOAD_OFF.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
include/uapi/linux/kdbus.
.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 16 +++-
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index b3c5f20a57d8..6a73ac3f444d 100644
--- a/ipc/kdbus/connection.c
+++ b/ipc
kdbus_conn_entry_insert() returns 0 on success.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index a4d7414ecaea..db49f282a1bf 100644
--- a/ipc
Rearrange tests a little to make them look cleaner.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 93da7f539f74..a4d7414ecaea
nd iovec as
they relate to the old code.
- struct kdbus_queue_entry: Fix typo: "messages" -> "message".
- kdbus_pool_slice_publish(): Remove obsolete line from the
description.
Signed-off-by: Sergei Zviagintsev <ser...@s15v.net>
---
ipc/kdbus/connection.c | 6
1 - 100 of 256 matches
Mail list logo