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

dca: Use PTR_ERR_OR_ZERO() to simplify code

The function PTR_ERR_OR_ZERO() contains the check of
IS_ERR() and the return of PTR_ERR() or zero.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200507111224.4176-1-tangbin@cmss.chinamobile.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tang Bin and committed by
Greg Kroah-Hartman
0548745f cafa1a5b

+1 -3
+1 -3
drivers/dca/dca-sysfs.c
··· 24 24 25 25 cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL, 26 26 "requester%d", req_count++); 27 - if (IS_ERR(cd)) 28 - return PTR_ERR(cd); 29 - return 0; 27 + return PTR_ERR_OR_ZERO(cd); 30 28 } 31 29 32 30 void dca_sysfs_remove_req(struct dca_provider *dca, int slot)