Skip to content

Commit 27703bb

Browse files
committed
Merge tag 'PTR_RET-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull PTR_RET() removal patches from Rusty Russell: "PTR_RET() is a weird name, and led to some confusing usage. We ended up with PTR_ERR_OR_ZERO(), and replacing or fixing all the usages. This has been sitting in linux-next for a whole cycle" [ There are still some PTR_RET users scattered about, with some of them possibly being new, but most of them existing in Rusty's tree too. We have that #define PTR_RET(p) PTR_ERR_OR_ZERO(p) thing in <linux/err.h>, so they continue to work for now - Linus ] * tag 'PTR_RET-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: GFS2: Replace PTR_RET with PTR_ERR_OR_ZERO Btrfs: volume: Replace PTR_RET with PTR_ERR_OR_ZERO drm/cma: Replace PTR_RET with PTR_ERR_OR_ZERO sh_veu: Replace PTR_RET with PTR_ERR_OR_ZERO dma-buf: Replace PTR_RET with PTR_ERR_OR_ZERO drivers/rtc: Replace PTR_RET with PTR_ERR_OR_ZERO mm/oom_kill: remove weird use of ERR_PTR()/PTR_ERR(). staging/zcache: don't use PTR_RET(). remoteproc: don't use PTR_RET(). pinctrl: don't use PTR_RET(). acpi: Replace weird use of PTR_RET. s390: Replace weird use of PTR_RET. PTR_RET is now PTR_ERR_OR_ZERO(): Replace most. PTR_RET is now PTR_ERR_OR_ZERO
2 parents 6f3bc58 + ad151d5 commit 27703bb

58 files changed

Lines changed: 81 additions & 71 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/arm/mach-omap2/i2c.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
181181
sizeof(struct omap_i2c_bus_platform_data));
182182
WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
183183

184-
return PTR_RET(pdev);
184+
return PTR_ERR_OR_ZERO(pdev);
185185
}
186186

187187
static int __init omap_i2c_cmdline(void)

‎arch/m68k/amiga/platform.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int __init amiga_init_bus(void)
5656
n = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
5757
pdev = platform_device_register_simple("amiga-zorro", -1,
5858
zorro_resources, n);
59-
return PTR_RET(pdev);
59+
return PTR_ERR_OR_ZERO(pdev);
6060
}
6161

6262
subsys_initcall(amiga_init_bus);

‎arch/m68k/kernel/time.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int __init rtc_init(void)
9090
return -ENODEV;
9191

9292
pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
93-
return PTR_RET(pdev);
93+
return PTR_ERR_OR_ZERO(pdev);
9494
}
9595

9696
module_init(rtc_init);

‎arch/m68k/q40/config.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,6 @@ static __init int q40_add_kbd_device(void)
338338
return -ENODEV;
339339

340340
pdev = platform_device_register_simple("q40kbd", -1, NULL, 0);
341-
return PTR_RET(pdev);
341+
return PTR_ERR_OR_ZERO(pdev);
342342
}
343343
arch_initcall(q40_add_kbd_device);

‎arch/powerpc/kernel/iommu.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int __init fail_iommu_debugfs(void)
105105
struct dentry *dir = fault_create_debugfs_attr("fail_iommu",
106106
NULL, &fail_iommu);
107107

108-
return PTR_RET(dir);
108+
return PTR_ERR_OR_ZERO(dir);
109109
}
110110
late_initcall(fail_iommu_debugfs);
111111

‎arch/powerpc/kernel/time.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ static int __init rtc_init(void)
10491049

10501050
pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
10511051

1052-
return PTR_RET(pdev);
1052+
return PTR_ERR_OR_ZERO(pdev);
10531053
}
10541054

10551055
module_init(rtc_init);

‎arch/powerpc/platforms/ps3/time.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int __init ps3_rtc_init(void)
9090

9191
pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0);
9292

93-
return PTR_RET(pdev);
93+
return PTR_ERR_OR_ZERO(pdev);
9494
}
9595

9696
module_init(ps3_rtc_init);

‎arch/powerpc/sysdev/rtc_cmos_setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int __init add_rtc(void)
6262
pd = platform_device_register_simple("rtc_cmos", -1,
6363
&res[0], num_res);
6464

65-
return PTR_RET(pd);
65+
return PTR_ERR_OR_ZERO(pd);
6666
}
6767
fs_initcall(add_rtc);
6868

‎arch/s390/hypfs/hypfs_dbfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df)
105105
int hypfs_dbfs_init(void)
106106
{
107107
dbfs_dir = debugfs_create_dir("s390_hypfs", NULL);
108-
return PTR_RET(dbfs_dir);
108+
return PTR_ERR_OR_ZERO(dbfs_dir);
109109
}
110110

111111
void hypfs_dbfs_exit(void)

‎arch/s390/kvm/gaccess.h‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ static inline void __user *__gptr_to_uptr(struct kvm_vcpu *vcpu,
4242
({ \
4343
__typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr, 1);\
4444
int __mask = sizeof(__typeof__(*(gptr))) - 1; \
45-
int __ret = PTR_RET((void __force *)__uptr); \
45+
int __ret; \
4646
\
47-
if (!__ret) { \
47+
if (IS_ERR((void __force *)__uptr)) { \
48+
__ret = PTR_ERR((void __force *)__uptr); \
49+
} else { \
4850
BUG_ON((unsigned long)__uptr & __mask); \
4951
__ret = get_user(x, __uptr); \
5052
} \
@@ -55,9 +57,11 @@ static inline void __user *__gptr_to_uptr(struct kvm_vcpu *vcpu,
5557
({ \
5658
__typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr, 1);\
5759
int __mask = sizeof(__typeof__(*(gptr))) - 1; \
58-
int __ret = PTR_RET((void __force *)__uptr); \
60+
int __ret; \
5961
\
60-
if (!__ret) { \
62+
if (IS_ERR((void __force *)__uptr)) { \
63+
__ret = PTR_ERR((void __force *)__uptr); \
64+
} else { \
6165
BUG_ON((unsigned long)__uptr & __mask); \
6266
__ret = put_user(x, __uptr); \
6367
} \

0 commit comments

Comments
 (0)