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)
commit58b5c203360799e181325f3f8ce212de80ebf304
treed78d8477f82242b2169d954e8dcc9fb411decd50
parent765f2bf04fdaced4e7d7e94cfc3f743048629f31
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