Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <shenlichuan@vivo.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Message-ID: <20240829084710.30312-1-shenlichuan@vivo.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Shen Lichuan and committed by
Juergen Gross
3adc73ef fbe5a6df

+3 -3
+3 -3
drivers/xen/xenbus/xenbus_xs.c
··· 427 427 428 428 path = join(dir, node); 429 429 if (IS_ERR(path)) 430 - return (char **)path; 430 + return ERR_CAST(path); 431 431 432 432 strings = xs_single(t, XS_DIRECTORY, path, &len); 433 433 kfree(path); 434 434 if (IS_ERR(strings)) 435 - return (char **)strings; 435 + return ERR_CAST(strings); 436 436 437 437 return split(strings, len, num); 438 438 } ··· 465 465 466 466 path = join(dir, node); 467 467 if (IS_ERR(path)) 468 - return (void *)path; 468 + return ERR_CAST(path); 469 469 470 470 ret = xs_single(t, XS_READ, path, len); 471 471 kfree(path);