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.

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 <liyuesong@vivo.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20240829125235.3266865-1-liyuesong@vivo.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>

authored by

Yuesong Li and committed by
Dave Jiang
1f9651bf 431c1646

+1 -1
+1 -1
drivers/cxl/core/port.c
··· 941 941 942 942 port = devm_cxl_add_port(host, host, CXL_RESOURCE_NONE, NULL); 943 943 if (IS_ERR(port)) 944 - return (struct cxl_root *)port; 944 + return ERR_CAST(port); 945 945 946 946 cxl_root = to_cxl_root(port); 947 947 cxl_root->ops = ops;