resource-manager: Add convenient macro SYSCOMMON_RESOURCE_ID() 44/297044/2
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 9 Aug 2023 08:45:23 +0000 (17:45 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Wed, 9 Aug 2023 09:13:25 +0000 (18:13 +0900)
commit32b355358b5fd45e71c2c3efddf9335b5afafc46
treeb3496744fc554e2a9320111250ad33a4d74b61e6
parent574ef602fefede4f18a35ab1ff367c253aa6706d
resource-manager: Add convenient macro SYSCOMMON_RESOURCE_ID()

 The resource-manage APIs are working on top of the resource_id. Thus
an API user must get resource_id in advance to access resource instance.
Currently resource-manager provides syscommon_resman_get_resource_id()
for this purpose, however, it gets resource_id via parameter. Therefore,
it cannot pass resource_id directly to a function parameter.
 On the other hand, the convenient macro returns resource_id on success,
-1 on failure. As it returns reosurce_id, it can be used as an inline
parameter.

Change-Id: I45426096144c2a47de2554cbf2856b9f78d5b51d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
include/libsyscommon/resource-manager.h