Commit e231c2ee64eb1c5cd3c63c31da9dac7d888dcf7f
Committed by
Linus Torvalds
1 parent
d1bc8e9544
Exists in
master
and in
20 other branches
Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p)
Convert instances of ERR_PTR(PTR_ERR(p)) to ERR_CAST(p) using: perl -spi -e 's/ERR_PTR[(]PTR_ERR[(](.*)[)][)]/ERR_CAST(\1)/' `grep -rl 'ERR_PTR[(]*PTR_ERR' fs crypto net security` Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 28 changed files with 39 additions and 39 deletions Side-by-side Diff
- crypto/cbc.c
- crypto/cryptd.c
- crypto/ecb.c
- crypto/hmac.c
- crypto/lrw.c
- crypto/pcbc.c
- crypto/xcbc.c
- fs/9p/vfs_inode.c
- fs/affs/namei.c
- fs/afs/dir.c
- fs/afs/security.c
- fs/fat/inode.c
- fs/fuse/dir.c
- fs/gfs2/dir.c
- fs/gfs2/ops_export.c
- fs/gfs2/ops_inode.c
- fs/jffs2/write.c
- fs/nfs/getroot.c
- fs/nfsd/export.c
- fs/quota.c
- fs/reiserfs/inode.c
- fs/reiserfs/xattr.c
- fs/vfat/namei.c
- net/rxrpc/af_rxrpc.c
- security/keys/key.c
- security/keys/process_keys.c
- security/keys/request_key.c
- security/keys/request_key_auth.c
crypto/cbc.c
crypto/cryptd.c
... | ... | @@ -230,7 +230,7 @@ |
230 | 230 | alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER, |
231 | 231 | CRYPTO_ALG_TYPE_MASK); |
232 | 232 | if (IS_ERR(alg)) |
233 | - return ERR_PTR(PTR_ERR(alg)); | |
233 | + return ERR_CAST(alg); | |
234 | 234 | |
235 | 235 | inst = cryptd_alloc_instance(alg, state); |
236 | 236 | if (IS_ERR(inst)) |
... | ... | @@ -267,7 +267,7 @@ |
267 | 267 | |
268 | 268 | algt = crypto_get_attr_type(tb); |
269 | 269 | if (IS_ERR(algt)) |
270 | - return ERR_PTR(PTR_ERR(algt)); | |
270 | + return ERR_CAST(algt); | |
271 | 271 | |
272 | 272 | switch (algt->type & algt->mask & CRYPTO_ALG_TYPE_MASK) { |
273 | 273 | case CRYPTO_ALG_TYPE_BLKCIPHER: |
crypto/ecb.c
crypto/hmac.c
crypto/lrw.c
crypto/pcbc.c
crypto/xcbc.c
fs/9p/vfs_inode.c
... | ... | @@ -573,7 +573,7 @@ |
573 | 573 | v9ses = v9fs_inode2v9ses(dir); |
574 | 574 | dfid = v9fs_fid_lookup(dentry->d_parent); |
575 | 575 | if (IS_ERR(dfid)) |
576 | - return ERR_PTR(PTR_ERR(dfid)); | |
576 | + return ERR_CAST(dfid); | |
577 | 577 | |
578 | 578 | name = (char *) dentry->d_name.name; |
579 | 579 | fid = p9_client_walk(dfid, 1, &name, 1); |
fs/affs/namei.c
fs/afs/dir.c
... | ... | @@ -512,7 +512,7 @@ |
512 | 512 | key = afs_request_key(vnode->volume->cell); |
513 | 513 | if (IS_ERR(key)) { |
514 | 514 | _leave(" = %ld [key]", PTR_ERR(key)); |
515 | - return ERR_PTR(PTR_ERR(key)); | |
515 | + return ERR_CAST(key); | |
516 | 516 | } |
517 | 517 | |
518 | 518 | ret = afs_validate(vnode, key); |
... | ... | @@ -540,7 +540,7 @@ |
540 | 540 | key_put(key); |
541 | 541 | if (IS_ERR(inode)) { |
542 | 542 | _leave(" = %ld", PTR_ERR(inode)); |
543 | - return ERR_PTR(PTR_ERR(inode)); | |
543 | + return ERR_CAST(inode); | |
544 | 544 | } |
545 | 545 | |
546 | 546 | dentry->d_op = &afs_fs_dentry_operations; |
fs/afs/security.c
fs/fat/inode.c
fs/fuse/dir.c
... | ... | @@ -269,12 +269,12 @@ |
269 | 269 | |
270 | 270 | req = fuse_get_req(fc); |
271 | 271 | if (IS_ERR(req)) |
272 | - return ERR_PTR(PTR_ERR(req)); | |
272 | + return ERR_CAST(req); | |
273 | 273 | |
274 | 274 | forget_req = fuse_get_req(fc); |
275 | 275 | if (IS_ERR(forget_req)) { |
276 | 276 | fuse_put_request(fc, req); |
277 | - return ERR_PTR(PTR_ERR(forget_req)); | |
277 | + return ERR_CAST(forget_req); | |
278 | 278 | } |
279 | 279 | |
280 | 280 | attr_version = fuse_get_attr_version(fc); |
... | ... | @@ -1006,7 +1006,7 @@ |
1006 | 1006 | char *link; |
1007 | 1007 | |
1008 | 1008 | if (IS_ERR(req)) |
1009 | - return ERR_PTR(PTR_ERR(req)); | |
1009 | + return ERR_CAST(req); | |
1010 | 1010 | |
1011 | 1011 | link = (char *) __get_free_page(GFP_KERNEL); |
1012 | 1012 | if (!link) { |
fs/gfs2/dir.c
... | ... | @@ -1498,7 +1498,7 @@ |
1498 | 1498 | dent = gfs2_dirent_search(dir, name, gfs2_dirent_find, &bh); |
1499 | 1499 | if (dent) { |
1500 | 1500 | if (IS_ERR(dent)) |
1501 | - return ERR_PTR(PTR_ERR(dent)); | |
1501 | + return ERR_CAST(dent); | |
1502 | 1502 | inode = gfs2_inode_lookup(dir->i_sb, |
1503 | 1503 | be16_to_cpu(dent->de_type), |
1504 | 1504 | be64_to_cpu(dent->de_inum.no_addr), |
fs/gfs2/ops_export.c
fs/gfs2/ops_inode.c
fs/jffs2/write.c
... | ... | @@ -177,7 +177,7 @@ |
177 | 177 | void *hold_err = fn->raw; |
178 | 178 | /* Release the full_dnode which is now useless, and return */ |
179 | 179 | jffs2_free_full_dnode(fn); |
180 | - return ERR_PTR(PTR_ERR(hold_err)); | |
180 | + return ERR_CAST(hold_err); | |
181 | 181 | } |
182 | 182 | fn->ofs = je32_to_cpu(ri->offset); |
183 | 183 | fn->size = je32_to_cpu(ri->dsize); |
... | ... | @@ -313,7 +313,7 @@ |
313 | 313 | void *hold_err = fd->raw; |
314 | 314 | /* Release the full_dirent which is now useless, and return */ |
315 | 315 | jffs2_free_full_dirent(fd); |
316 | - return ERR_PTR(PTR_ERR(hold_err)); | |
316 | + return ERR_CAST(hold_err); | |
317 | 317 | } |
318 | 318 | |
319 | 319 | if (retried) { |
fs/nfs/getroot.c
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | inode = nfs_fhget(sb, mntfh, fsinfo.fattr); |
97 | 97 | if (IS_ERR(inode)) { |
98 | 98 | dprintk("nfs_get_root: get root inode failed\n"); |
99 | - return ERR_PTR(PTR_ERR(inode)); | |
99 | + return ERR_CAST(inode); | |
100 | 100 | } |
101 | 101 | |
102 | 102 | error = nfs_superblock_set_dummy_root(sb, inode); |
... | ... | @@ -266,7 +266,7 @@ |
266 | 266 | inode = nfs_fhget(sb, mntfh, &fattr); |
267 | 267 | if (IS_ERR(inode)) { |
268 | 268 | dprintk("nfs_get_root: get root inode failed\n"); |
269 | - return ERR_PTR(PTR_ERR(inode)); | |
269 | + return ERR_CAST(inode); | |
270 | 270 | } |
271 | 271 | |
272 | 272 | error = nfs_superblock_set_dummy_root(sb, inode); |
fs/nfsd/export.c
... | ... | @@ -1218,13 +1218,13 @@ |
1218 | 1218 | struct svc_export *exp; |
1219 | 1219 | struct svc_expkey *ek = exp_find_key(clp, fsid_type, fsidv, reqp); |
1220 | 1220 | if (IS_ERR(ek)) |
1221 | - return ERR_PTR(PTR_ERR(ek)); | |
1221 | + return ERR_CAST(ek); | |
1222 | 1222 | |
1223 | 1223 | exp = exp_get_by_name(clp, ek->ek_mnt, ek->ek_dentry, reqp); |
1224 | 1224 | cache_put(&ek->h, &svc_expkey_cache); |
1225 | 1225 | |
1226 | 1226 | if (IS_ERR(exp)) |
1227 | - return ERR_PTR(PTR_ERR(exp)); | |
1227 | + return ERR_CAST(exp); | |
1228 | 1228 | return exp; |
1229 | 1229 | } |
1230 | 1230 |
fs/quota.c
... | ... | @@ -341,11 +341,11 @@ |
341 | 341 | char *tmp = getname(special); |
342 | 342 | |
343 | 343 | if (IS_ERR(tmp)) |
344 | - return ERR_PTR(PTR_ERR(tmp)); | |
344 | + return ERR_CAST(tmp); | |
345 | 345 | bdev = lookup_bdev(tmp); |
346 | 346 | putname(tmp); |
347 | 347 | if (IS_ERR(bdev)) |
348 | - return ERR_PTR(PTR_ERR(bdev)); | |
348 | + return ERR_CAST(bdev); | |
349 | 349 | sb = get_super(bdev); |
350 | 350 | bdput(bdev); |
351 | 351 | if (!sb) |
fs/reiserfs/inode.c
fs/reiserfs/xattr.c
... | ... | @@ -155,7 +155,7 @@ |
155 | 155 | |
156 | 156 | xadir = open_xa_dir(inode, flags); |
157 | 157 | if (IS_ERR(xadir)) { |
158 | - return ERR_PTR(PTR_ERR(xadir)); | |
158 | + return ERR_CAST(xadir); | |
159 | 159 | } else if (xadir && !xadir->d_inode) { |
160 | 160 | dput(xadir); |
161 | 161 | return ERR_PTR(-ENODATA); |
... | ... | @@ -164,7 +164,7 @@ |
164 | 164 | xafile = lookup_one_len(name, xadir, strlen(name)); |
165 | 165 | if (IS_ERR(xafile)) { |
166 | 166 | dput(xadir); |
167 | - return ERR_PTR(PTR_ERR(xafile)); | |
167 | + return ERR_CAST(xafile); | |
168 | 168 | } |
169 | 169 | |
170 | 170 | if (xafile->d_inode) { /* file exists */ |
fs/vfat/namei.c
net/rxrpc/af_rxrpc.c
... | ... | @@ -239,7 +239,7 @@ |
239 | 239 | /* find a remote transport endpoint from the local one */ |
240 | 240 | peer = rxrpc_get_peer(srx, gfp); |
241 | 241 | if (IS_ERR(peer)) |
242 | - return ERR_PTR(PTR_ERR(peer)); | |
242 | + return ERR_CAST(peer); | |
243 | 243 | |
244 | 244 | /* find a transport */ |
245 | 245 | trans = rxrpc_get_transport(rx->local, peer, gfp); |
... | ... | @@ -282,7 +282,7 @@ |
282 | 282 | trans = rxrpc_name_to_transport(sock, (struct sockaddr *) srx, |
283 | 283 | sizeof(*srx), 0, gfp); |
284 | 284 | if (IS_ERR(trans)) { |
285 | - call = ERR_PTR(PTR_ERR(trans)); | |
285 | + call = ERR_CAST(trans); | |
286 | 286 | trans = NULL; |
287 | 287 | goto out; |
288 | 288 | } |
... | ... | @@ -306,7 +306,7 @@ |
306 | 306 | |
307 | 307 | bundle = rxrpc_get_bundle(rx, trans, key, service_id, gfp); |
308 | 308 | if (IS_ERR(bundle)) { |
309 | - call = ERR_PTR(PTR_ERR(bundle)); | |
309 | + call = ERR_CAST(bundle); | |
310 | 310 | goto out; |
311 | 311 | } |
312 | 312 |
security/keys/key.c
security/keys/process_keys.c
security/keys/request_key.c
... | ... | @@ -389,7 +389,7 @@ |
389 | 389 | if (!IS_ERR(key_ref)) { |
390 | 390 | key = key_ref_to_ptr(key_ref); |
391 | 391 | } else if (PTR_ERR(key_ref) != -EAGAIN) { |
392 | - key = ERR_PTR(PTR_ERR(key_ref)); | |
392 | + key = ERR_CAST(key_ref); | |
393 | 393 | } else { |
394 | 394 | /* the search failed, but the keyrings were searchable, so we |
395 | 395 | * should consult userspace if we can */ |