From: Yuesong Li Date: Thu, 29 Aug 2024 12:52:35 +0000 (+0800) Subject: cxl/port: Convert to use ERR_CAST() X-Git-Tag: v6.12-rc1~25^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f9651bfc51326fbed10df820c4e80f885f921d8;p=thirdparty%2Flinux.git 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 Reviewed-by: Jonathan Cameron Reviewed-by: Alison Schofield Link: https://patch.msgid.link/20240829125235.3266865-1-liyuesong@vivo.com Signed-off-by: Dave Jiang --- diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 1d5007e3795a3..bdd3275ad417e 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -941,7 +941,7 @@ struct cxl_root *devm_cxl_add_root(struct device *host, port = devm_cxl_add_port(host, host, CXL_RESOURCE_NONE, NULL); if (IS_ERR(port)) - return (struct cxl_root *)port; + return ERR_CAST(port); cxl_root = to_cxl_root(port); cxl_root->ops = ops;