Skip to content

Commit 3adc73e

Browse files
Shen Lichuanjgross1
authored andcommitted
xen/xenbus: Convert to use ERR_CAST()
Use ERR_CAST() as it is designed for casting an error pointer to another type. This macro utilizes the __force and __must_check modifiers, which instruct the compiler to verify for errors at the locations where it is employed. Signed-off-by: Shen Lichuan <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Message-ID: <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent fbe5a6d commit 3adc73e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/xen/xenbus/xenbus_xs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,12 @@ char **xenbus_directory(struct xenbus_transaction t,
427427

428428
path = join(dir, node);
429429
if (IS_ERR(path))
430-
return (char **)path;
430+
return ERR_CAST(path);
431431

432432
strings = xs_single(t, XS_DIRECTORY, path, &len);
433433
kfree(path);
434434
if (IS_ERR(strings))
435-
return (char **)strings;
435+
return ERR_CAST(strings);
436436

437437
return split(strings, len, num);
438438
}
@@ -465,7 +465,7 @@ void *xenbus_read(struct xenbus_transaction t,
465465

466466
path = join(dir, node);
467467
if (IS_ERR(path))
468-
return (void *)path;
468+
return ERR_CAST(path);
469469

470470
ret = xs_single(t, XS_READ, path, len);
471471
kfree(path);

0 commit comments

Comments
 (0)