Skip to content

Commit 1f9651b

Browse files
Yuesong Lidavejiang
authored andcommitted
cxl/port: 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: Yuesong Li <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Alison Schofield <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Dave Jiang <[email protected]>
1 parent 431c164 commit 1f9651b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cxl/core/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ struct cxl_root *devm_cxl_add_root(struct device *host,
941941

942942
port = devm_cxl_add_port(host, host, CXL_RESOURCE_NONE, NULL);
943943
if (IS_ERR(port))
944-
return (struct cxl_root *)port;
944+
return ERR_CAST(port);
945945

946946
cxl_root = to_cxl_root(port);
947947
cxl_root->ops = ops;

0 commit comments

Comments
 (0)