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. Spl
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.
> &g
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 co
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
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 kdbu
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
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: Serg
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 us
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
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
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 of
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..4dea83d
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
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..185ed3b
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 4b5ed4b
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
to zero is unnecessary because
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
---
- Remove redundant goto.
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
+++
- 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
---
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
- 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'
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 change
inary operation
In 'proc < 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 r
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
ee file descriptor 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
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
ain' in error
path, 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
se and readable.
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
@
- 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 Zviagin
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
---
i
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(-)
di
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
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
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/p
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
#x27; name is more consistent
with the `owner' 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 deleti
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
in `quota->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 fu
!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.
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 on
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
Hi,
On Wed, Jul 08, 2015 at 02:12:03PM +0200, Paul Osmialowski wrote:
[...]
>
> + ret = security_kdbus_bus_alloc(b);
> + if (ret) {
> + goto exit_unref;
> + }
checkpatch.pl will complain about this
--
To unsubscribe from this list: send the line "unsubscribe linux-kerne
Hi,
On Wed, Jul 08, 2015 at 12:25:06PM +0200, Paul Osmialowski wrote:
> This adds implementation of three smack callbacks sitting behind kdbus
> security hooks as proposed by Karol Lewandowski.
>
> Originates from:
>
> git://git.infradead.org/users/pcmoore/selinux (branch: working-kdbus)
> commi
Hi David,
On Mon, Jul 06, 2015 at 08:48:26PM +0200, David Herrmann wrote:
> Hi
>
> On Sun, Jun 28, 2015 at 3:17 PM, Sergei Zviagintsev wrote:
> > Hi,
> >
> > Main points here are to use conventional types, rewrite tests in obvious
> > way, add couple of new W
Hi,
On Sat, Jul 04, 2015 at 01:42:31PM +0200, David Herrmann wrote:
> Hi
>
> On Thu, Jul 2, 2015 at 3:45 PM, Sergei Zviagintsev wrote:
> > Hi David,
> >
> > Thank you for reviewing and providing comments on these all! I answered
> > below.
> >
>
Hi,
On Thu, Jul 02, 2015 at 10:28:33AM +0200, David Herrmann wrote:
> Whenever we send messages to a target connection, all we know about the
> target is the 'struct file' associated with the kdbus connection. Hence,
> we cannot know which namespaces a receiving process will be in when it
> calls
Hi,
On Thu, Jul 02, 2015 at 10:28:30AM +0200, David Herrmann wrote:
> We already limit the size of the message object, there's no reason to add
> an arbitrary additional limit on the number of items. We don't do this for
> other item-arrays, so lets stop restricting the messages in this way.
>
>
Hi Djalal,
On Thu, Jul 02, 2015 at 03:13:41PM +0100, Djalal Harouni wrote:
[...]
> > My journey with this piece of code began from spotting and immediately
> > "fixing" the overflow issue :) Then I decided to dig into the
> > out-of-tree repo to find the origin of this line. What I found were
> >
Hi,
On Thu, Jul 02, 2015 at 10:35:30AM +0200, David Herrmann wrote:
> Hi
>
> On Sun, Jun 28, 2015 at 3:17 PM, Sergei Zviagintsev wrote:
> > Replace the use of max() with explicit and obvious overflow check.
> >
> > Signed-off-by: Sergei Zviagintsev
> > --
Hi David,
Thank you for reviewing and providing comments on these all! I answered below.
On Thu, Jul 02, 2015 at 10:50:47AM +0200, David Herrmann wrote:
> Hi
>
> On Sun, Jun 28, 2015 at 3:17 PM, Sergei Zviagintsev wrote:
> > 1) Rewrite
> >
> > quota
Hi,
On Thu, Jul 02, 2015 at 10:37:05AM +0200, David Herrmann wrote:
> Hi
>
> On Sun, Jun 28, 2015 at 3:17 PM, Sergei Zviagintsev wrote:
> > If we spotted inconsistency, fix it by setting values to zero.
>
> Why?
>
> I prefer doing nothing and just bailing out on pr
Hi,
On Thu, Jul 02, 2015 at 10:31:48AM +0200, David Herrmann wrote:
> Hi
>
> On Sun, Jun 28, 2015 at 3:17 PM, Sergei Zviagintsev wrote:
> > Signed-off-by: Sergei Zviagintsev
> > ---
> > ipc/kdbus/connection.c | 4 ++--
> > 1 file changed, 2 insertions(+),
Hi,
I left some comments below.
On Sun, Jun 28, 2015 at 09:46:26PM +0200, Marek Belisko wrote:
> From: "H. Nikolaus Schaller"
>
> Add driver for Wi2Wi w2g004 GPS module connected through uart. Use uart
> slave + notification hooks to glue with tty.
>
> Signed-off-by: H. Nikolaus Schaller
> S
Hi,
On Mon, Jun 29, 2015 at 06:44:23PM +0200, Dr. H. Nikolaus Schaller wrote:
[...]
> >> + list_for_each_entry(uart, &uart_list, head) {
> >> + if (node != uart->dev->of_node)
> >> + continue;
> >> +
> >> + return uart;
> >
> > We can easily save three lines he
Hi,
Some minor comments below.
On Sun, Jun 28, 2015 at 09:46:25PM +0200, Marek Belisko wrote:
> From: "H. Nikolaus Schaller"
>
> 1. allow drivers to get notified in mctrl changes
> 2. allow drivers to get notified on rx data (indicating to the driver that
>the connected chip is active)
>
>
Hi,
Some comments below.
On Sun, Jun 28, 2015 at 09:46:24PM +0200, Marek Belisko wrote:
> From: "H. Nikolaus Schaller"
>
> 1. add registered uart_ports to a search list
> 2. provide a function to search an uart_port by phandle. This copies the
>mechanism how devm_usb_get_phy_by_phandle() wo
these.
Sergei Zviagintsev (5):
kdbus: fix typos in kdbus_conn_quota_inc()
kdbus: use standard kernel types in struct kdbus_quota
kdbus: do explicit overflow check in kdbus_conn_quota_inc()
kdbus: handle WARN_ON cases properly when decrementing quota
kdbus: improve tests on incrementing quota
overflow in `quota->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
uint{8,16,32}_t -> u{8,16,32}
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index df072487e23c..af044f93c14f 100644
--- a/ipc/kdbus/connection.c
+++ b/
Replace the use of max() with explicit and obvious overflow check.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index af044f93c14f..1d44e280eff0 100644
--- a
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 9993753d11de..df072487e23c 100644
--- a/ipc/kdbus/connection.c
+++ b/ipc/kdbus/connection.c
@@ -646,7 +646,7
If we spotted inconsistency, fix it by setting values to zero.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/connection.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/connection.c b/ipc/kdbus/connection.c
index 1d44e280eff0..12e32de310f5 100644
Hi,
I just was walking around and decided to look inside this driver :)
I left some comments below.
On Fri, Jun 26, 2015 at 01:29:22PM +0300, Adriana Reus wrote:
^^^
Your message came from future.
> Add support for TXC PA12203001 als and proximity sensor.
> Support for raw illuminance and pro
if (r->sync) branch and code after it both call kdbus_reply_unlink().
Rewrite them as if-else to eliminate code duplication and make algorithm
more obvious.
Convert outer if statement to use continue in order to reduce
indentation and make things easier to read.
Signed-off-by: Sergei Zviagint
Move cleanup code to separate location as it never executes on normal
flow. This removes extra if-block and the need to initialize `ret'.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/reply.c | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/ipc/kdbus/repl
Return found entry immediately instead of assigning it to additional
variable and breaking the loop. It's simpler to read, the same way is
used in kdbus_conn_has_name(), for example.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/reply.c | 10 --
1 file changed, 4 insertions(
Little improvements to make things easier to read.
Sergei Zviagintsev (3):
kdbus: kdbus_reply_find(): return on found entry
kdbus: optimize error path in kdbus_reply_new()
kdbus: optimize if statements in kdbus_conn_disconnect()
ipc/kdbus/connection.c | 15 +++
ipc/kdbus
Hi Greg,
On Wed, Jun 17, 2015 at 07:37:20AM -0700, Greg Kroah-Hartman wrote:
> You sent 5 patches, yet no hints as to what order they should be applied
> in :(
>
> Please resend in a patch series that is properly threaded so we can
> handle this correctly.
Thank you for feedback! I've resent ser
Fix typo in checking error value of cap_get_proc(): cap -> caps
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c
b/tools/testing/selftests/kdbus/kd
Handle errors properly, free allocated resources.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 31 ++
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c
b/tools/testing
Set value of `size' in one step instead of four.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c
b/tools/testing/selftests/kdbus/kdbus-u
Do not initialize efd, unpriv_conn_id, userns_conn_id and monitor. These
vars are assigned to values later in code while initial values are never
used.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/test-metadata-ns.c | 9 +++--
1 file changed, 3 insertions(+), 6
Assign returned file descriptor directly to `fd', without intermediate
`ret' variable.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.
...@s15v.net
http://lkml.kernel.org/g/1434550697-24785-3-git-send-email-ser...@s15v.net
http://lkml.kernel.org/g/1434550697-24785-4-git-send-email-ser...@s15v.net
http://lkml.kernel.org/g/1434550697-24785-5-git-send-email-ser...@s15v.net
Sergei Zviagintsev (5):
selftests/kdbus: handle cap_get_proc
Handle errors properly, free allocated resources.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 31 ++
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c
b/tools/testing
Set value of `size' in one step instead of four.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c
b/tools/testing/selftests/kdbus/kdbus-u
Do not initialize efd, unpriv_conn_id, userns_conn_id and monitor. These
vars are assigned to values later in code while initial values are never
used.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/test-metadata-ns.c | 9 +++--
1 file changed, 3 insertions(+), 6
Fix typo in checking error value of cap_get_proc(): cap -> caps
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.c
b/tools/testing/selftests/kdbus/kd
Assign returned file descriptor directly to `fd', without intermediate
`ret' variable.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.c | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kdbus/kdbus-util.
Hi
On Wed, Jun 10, 2015 at 04:13:49PM +0200, David Herrmann wrote:
> Next time, please merge most of these changes to reduce the number of
> patches and review-overhead. But looks all good to me, much
> appreciated.
Thank you for response, I will keep that in mind.
--
To unsubscribe from this lis
Enclose all arguments into parentheses to stay consistent across the
whole macro.
Signed-off-by: Sergei Zviagintsev
---
ipc/kdbus/item.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/kdbus/item.h b/ipc/kdbus/item.h
index 32909e2e7954..bca63b4e6e80 100644
--- a/ipc
Enclose all arguments into parentheses to stay consistent across the
whole macro.
Signed-off-by: Sergei Zviagintsev
---
samples/kdbus/kdbus-api.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/samples/kdbus/kdbus-api.h b/samples/kdbus/kdbus-api.h
index fab873b89d97
e, missing parentheses around
`clone_ret' when using indirection operator.
Use parentheses properly to guarantee right precedence.
Signed-off-by: Sergei Zviagintsev
---
tools/testing/selftests/kdbus/kdbus-util.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/te
1 - 100 of 128 matches
Mail list logo