]> git.baikalelectronics.ru Git - kernel.git/commit
ipc/util.c: cleanup and improve sysvipc_find_ipc()
authorManfred Spraul <manfred@colorfullife.com>
Fri, 5 Aug 2022 11:57:33 +0000 (13:57 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 Sep 2022 04:55:05 +0000 (21:55 -0700)
commit66a0ebc4c2d9a51a3617eeeb0f0e65b53d1c933d
treed78d8477f82242b2169d954e8dcc9fb411decd50
parentb18f5b49bdfbc312c992223394d4131f614385e8
ipc/util.c: cleanup and improve sysvipc_find_ipc()

sysvipc_find_ipc() can be simplified further:

- It uses a for() loop to locate the next entry in the idr.
  This can be replaced with idr_get_next().

- It receives two parameters (pos - which is actually
  an idr index and not a position, and new_pos, which
  is really a position).
  One parameter is sufficient.

Link: https://lore.kernel.org/all/20210903052020.3265-3-manfred@colorfullife.com/
Link: https://lkml.kernel.org/r/20220805115733.104763-1-manfred@colorfullife.com
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: Davidlohr Bueso <dave@stgolabs.net>
Acked-by: Waiman Long <longman@redhat.com>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>
Cc: <1vier1@web.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ipc/util.c