Skip to content

Commit

Permalink
remoteproc_allocated_id cannot assume end will be 32-bits
Browse files Browse the repository at this point in the history
handle_vdev_rsc explicitly sets end to RSC_NOTIFY_ID_ANY
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
  • Loading branch information
tammyleino committed Oct 3, 2022
1 parent afed3bd commit 4532351
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/include/openamp/remoteproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extern "C" {
#endif

#define RSC_NOTIFY_ID_ANY 0xFFFFFFFFUL
#define RSC_NOTIFY_ID_ANY 0xFFFFFFFFU

#define RPROC_MAX_NAME_LEN 32

Expand Down
2 changes: 1 addition & 1 deletion lib/remoteproc/remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ unsigned int remoteproc_allocate_id(struct remoteproc *rproc,

if (start == RSC_NOTIFY_ID_ANY)
start = 0;
if (end == 0)
if (end == RSC_NOTIFY_ID_ANY)
end = METAL_BITS_PER_ULONG;

notifyid = metal_bitmap_next_clear_bit(&rproc->bitmap,
Expand Down
4 changes: 3 additions & 1 deletion lib/remoteproc/rsc_table_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ int handle_vdev_rsc(struct remoteproc *rproc, void *rsc)
/* only assign notification IDs but do not initialize vdev */
notifyid = vdev_rsc->notifyid;
notifyid = remoteproc_allocate_id(rproc,
notifyid, notifyid + 1);
notifyid,
notifyid == RSC_NOTIFY_ID_ANY ?
RSC_NOTIFY_ID_ANY : notifyid + 1);
if (notifyid != RSC_NOTIFY_ID_ANY)
vdev_rsc->notifyid = notifyid;

Expand Down

0 comments on commit 4532351

Please sign in to comment.