You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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
This commit is contained in:
@@ -181,7 +181,7 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
|
||||
sizeof(struct omap_i2c_bus_platform_data));
|
||||
WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
|
||||
|
||||
return PTR_RET(pdev);
|
||||
return PTR_ERR_OR_ZERO(pdev);
|
||||
}
|
||||
|
||||
static int __init omap_i2c_cmdline(void)
|
||||
|
||||
@@ -56,7 +56,7 @@ static int __init amiga_init_bus(void)
|
||||
n = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
|
||||
pdev = platform_device_register_simple("amiga-zorro", -1,
|
||||
zorro_resources, n);
|
||||
return PTR_RET(pdev);
|
||||
return PTR_ERR_OR_ZERO(pdev);
|
||||
}
|
||||
|
||||
subsys_initcall(amiga_init_bus);
|
||||
|
||||
@@ -90,7 +90,7 @@ static int __init rtc_init(void)
|
||||
return -ENODEV;
|
||||
|
||||
pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
|
||||
return PTR_RET(pdev);
|
||||
return PTR_ERR_OR_ZERO(pdev);
|
||||
}
|
||||
|
||||
module_init(rtc_init);
|
||||
|
||||
@@ -338,6 +338,6 @@ static __init int q40_add_kbd_device(void)
|
||||
return -ENODEV;
|
||||
|
||||
pdev = platform_device_register_simple("q40kbd", -1, NULL, 0);
|
||||
return PTR_RET(pdev);
|
||||
return PTR_ERR_OR_ZERO(pdev);
|
||||
}
|
||||
arch_initcall(q40_add_kbd_device);
|
||||
|
||||
@@ -105,7 +105,7 @@ static int __init fail_iommu_debugfs(void)
|
||||
struct dentry *dir = fault_create_debugfs_attr("fail_iommu",
|
||||
NULL, &fail_iommu);
|
||||
|
||||
return PTR_RET(dir);
|
||||
return PTR_ERR_OR_ZERO(dir);
|
||||
}
|
||||
late_initcall(fail_iommu_debugfs);
|
||||
|
||||
|
||||
@@ -1049,7 +1049,7 @@ static int __init rtc_init(void)
|
||||
|
||||
pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
|
||||
|
||||
return PTR_RET(pdev);
|
||||
return PTR_ERR_OR_ZERO(pdev);
|
||||
}
|
||||
|
||||
module_init(rtc_init);
|
||||
|
||||
@@ -90,7 +90,7 @@ static int __init ps3_rtc_init(void)
|
||||
|
||||
pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0);
|
||||
|
||||
return PTR_RET(pdev);
|
||||
return PTR_ERR_OR_ZERO(pdev);
|
||||
}
|
||||
|
||||
module_init(ps3_rtc_init);
|
||||
|
||||
@@ -62,7 +62,7 @@ static int __init add_rtc(void)
|
||||
pd = platform_device_register_simple("rtc_cmos", -1,
|
||||
&res[0], num_res);
|
||||
|
||||
return PTR_RET(pd);
|
||||
return PTR_ERR_OR_ZERO(pd);
|
||||
}
|
||||
fs_initcall(add_rtc);
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df)
|
||||
int hypfs_dbfs_init(void)
|
||||
{
|
||||
dbfs_dir = debugfs_create_dir("s390_hypfs", NULL);
|
||||
return PTR_RET(dbfs_dir);
|
||||
return PTR_ERR_OR_ZERO(dbfs_dir);
|
||||
}
|
||||
|
||||
void hypfs_dbfs_exit(void)
|
||||
|
||||
@@ -42,9 +42,11 @@ static inline void __user *__gptr_to_uptr(struct kvm_vcpu *vcpu,
|
||||
({ \
|
||||
__typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr, 1);\
|
||||
int __mask = sizeof(__typeof__(*(gptr))) - 1; \
|
||||
int __ret = PTR_RET((void __force *)__uptr); \
|
||||
int __ret; \
|
||||
\
|
||||
if (!__ret) { \
|
||||
if (IS_ERR((void __force *)__uptr)) { \
|
||||
__ret = PTR_ERR((void __force *)__uptr); \
|
||||
} else { \
|
||||
BUG_ON((unsigned long)__uptr & __mask); \
|
||||
__ret = get_user(x, __uptr); \
|
||||
} \
|
||||
@@ -55,9 +57,11 @@ static inline void __user *__gptr_to_uptr(struct kvm_vcpu *vcpu,
|
||||
({ \
|
||||
__typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr, 1);\
|
||||
int __mask = sizeof(__typeof__(*(gptr))) - 1; \
|
||||
int __ret = PTR_RET((void __force *)__uptr); \
|
||||
int __ret; \
|
||||
\
|
||||
if (!__ret) { \
|
||||
if (IS_ERR((void __force *)__uptr)) { \
|
||||
__ret = PTR_ERR((void __force *)__uptr); \
|
||||
} else { \
|
||||
BUG_ON((unsigned long)__uptr & __mask); \
|
||||
__ret = put_user(x, __uptr); \
|
||||
} \
|
||||
|
||||
@@ -231,16 +231,19 @@ static struct task_struct *ps_tsks[NR_CPUS];
|
||||
static unsigned int ps_tsk_num;
|
||||
static int create_power_saving_task(void)
|
||||
{
|
||||
int rc = -ENOMEM;
|
||||
int rc;
|
||||
|
||||
ps_tsks[ps_tsk_num] = kthread_run(power_saving_thread,
|
||||
(void *)(unsigned long)ps_tsk_num,
|
||||
"acpi_pad/%d", ps_tsk_num);
|
||||
rc = PTR_RET(ps_tsks[ps_tsk_num]);
|
||||
if (!rc)
|
||||
ps_tsk_num++;
|
||||
else
|
||||
|
||||
if (IS_ERR(ps_tsks[ps_tsk_num])) {
|
||||
rc = PTR_ERR(ps_tsks[ps_tsk_num]);
|
||||
ps_tsks[ps_tsk_num] = NULL;
|
||||
} else {
|
||||
rc = 0;
|
||||
ps_tsk_num++;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -680,7 +680,7 @@ int dma_buf_debugfs_create_file(const char *name,
|
||||
d = debugfs_create_file(name, S_IRUGO, dma_buf_debugfs_dir,
|
||||
write, &dma_buf_debug_fops);
|
||||
|
||||
return PTR_RET(d);
|
||||
return PTR_ERR_OR_ZERO(d);
|
||||
}
|
||||
#else
|
||||
static inline int dma_buf_init_debugfs(void)
|
||||
|
||||
@@ -353,7 +353,7 @@ static int srom_setup_minor(struct srom_dev *srom, int index)
|
||||
|
||||
dev = device_create(srom_class, &platform_bus,
|
||||
MKDEV(srom_major, index), srom, "%d", index);
|
||||
return PTR_RET(dev);
|
||||
return PTR_ERR_OR_ZERO(dev);
|
||||
}
|
||||
|
||||
/** srom_init() - Initialize the driver's module. */
|
||||
|
||||
@@ -215,7 +215,7 @@ int drm_gem_cma_dumb_create(struct drm_file *file_priv,
|
||||
|
||||
cma_obj = drm_gem_cma_create_with_handle(file_priv, dev,
|
||||
args->size, &args->handle);
|
||||
return PTR_RET(cma_obj);
|
||||
return PTR_ERR_OR_ZERO(cma_obj);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(drm_gem_cma_dumb_create);
|
||||
|
||||
|
||||
@@ -3208,7 +3208,7 @@ static int cma_join_ib_multicast(struct rdma_id_private *id_priv,
|
||||
id_priv->id.port_num, &rec,
|
||||
comp_mask, GFP_KERNEL,
|
||||
cma_ib_mc_handler, mc);
|
||||
return PTR_RET(mc->multicast.ib);
|
||||
return PTR_ERR_OR_ZERO(mc->multicast.ib);
|
||||
}
|
||||
|
||||
static void iboe_mcast_work_handler(struct work_struct *work)
|
||||
|
||||
@@ -359,7 +359,7 @@ static int sh_veu_context_init(struct sh_veu_dev *veu)
|
||||
veu->m2m_ctx = v4l2_m2m_ctx_init(veu->m2m_dev, veu,
|
||||
sh_veu_queue_init);
|
||||
|
||||
return PTR_RET(veu->m2m_ctx);
|
||||
return PTR_ERR_OR_ZERO(veu->m2m_ctx);
|
||||
}
|
||||
|
||||
static int sh_veu_querycap(struct file *file, void *priv,
|
||||
|
||||
@@ -996,7 +996,7 @@ static int __init cops_module_init(void)
|
||||
printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n",
|
||||
cardname);
|
||||
cops_dev = cops_probe(-1);
|
||||
return PTR_RET(cops_dev);
|
||||
return PTR_ERR_OR_ZERO(cops_dev);
|
||||
}
|
||||
|
||||
static void __exit cops_module_exit(void)
|
||||
|
||||
@@ -1243,7 +1243,7 @@ static int __init ltpc_module_init(void)
|
||||
"ltpc: Autoprobing is not recommended for modules\n");
|
||||
|
||||
dev_ltpc = ltpc_probe();
|
||||
return PTR_RET(dev_ltpc);
|
||||
return PTR_ERR_OR_ZERO(dev_ltpc);
|
||||
}
|
||||
module_init(ltpc_module_init);
|
||||
#endif
|
||||
|
||||
@@ -1147,7 +1147,7 @@ static struct net_device *atarilance_dev;
|
||||
static int __init atarilance_module_init(void)
|
||||
{
|
||||
atarilance_dev = atarilance_probe(-1);
|
||||
return PTR_RET(atarilance_dev);
|
||||
return PTR_ERR_OR_ZERO(atarilance_dev);
|
||||
}
|
||||
|
||||
static void __exit atarilance_module_exit(void)
|
||||
|
||||
@@ -188,7 +188,7 @@ static struct net_device *dev_mvme147_lance;
|
||||
int __init init_module(void)
|
||||
{
|
||||
dev_mvme147_lance = mvme147lance_probe(-1);
|
||||
return PTR_RET(dev_mvme147_lance);
|
||||
return PTR_ERR_OR_ZERO(dev_mvme147_lance);
|
||||
}
|
||||
|
||||
void __exit cleanup_module(void)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user