Skip to content

Commit e231c2e

Browse files
dhowellsLinus Torvalds
authored andcommitted
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>
1 parent d1bc8e9 commit e231c2e

28 files changed

Lines changed: 39 additions & 39 deletions

File tree

‎crypto/cbc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static struct crypto_instance *crypto_cbc_alloc(struct rtattr **tb)
224224
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
225225
CRYPTO_ALG_TYPE_MASK);
226226
if (IS_ERR(alg))
227-
return ERR_PTR(PTR_ERR(alg));
227+
return ERR_CAST(alg);
228228

229229
inst = ERR_PTR(-EINVAL);
230230
if (!is_power_of_2(alg->cra_blocksize))

‎crypto/cryptd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static struct crypto_instance *cryptd_alloc_blkcipher(
230230
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER,
231231
CRYPTO_ALG_TYPE_MASK);
232232
if (IS_ERR(alg))
233-
return ERR_PTR(PTR_ERR(alg));
233+
return ERR_CAST(alg);
234234

235235
inst = cryptd_alloc_instance(alg, state);
236236
if (IS_ERR(inst))
@@ -267,7 +267,7 @@ static struct crypto_instance *cryptd_alloc(struct rtattr **tb)
267267

268268
algt = crypto_get_attr_type(tb);
269269
if (IS_ERR(algt))
270-
return ERR_PTR(PTR_ERR(algt));
270+
return ERR_CAST(algt);
271271

272272
switch (algt->type & algt->mask & CRYPTO_ALG_TYPE_MASK) {
273273
case CRYPTO_ALG_TYPE_BLKCIPHER:

‎crypto/ecb.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static struct crypto_instance *crypto_ecb_alloc(struct rtattr **tb)
128128
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
129129
CRYPTO_ALG_TYPE_MASK);
130130
if (IS_ERR(alg))
131-
return ERR_PTR(PTR_ERR(alg));
131+
return ERR_CAST(alg);
132132

133133
inst = crypto_alloc_instance("ecb", alg);
134134
if (IS_ERR(inst))

‎crypto/hmac.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static struct crypto_instance *hmac_alloc(struct rtattr **tb)
213213
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_HASH,
214214
CRYPTO_ALG_TYPE_HASH_MASK);
215215
if (IS_ERR(alg))
216-
return ERR_PTR(PTR_ERR(alg));
216+
return ERR_CAST(alg);
217217

218218
inst = crypto_alloc_instance("hmac", alg);
219219
if (IS_ERR(inst))

‎crypto/lrw.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static struct crypto_instance *alloc(struct rtattr **tb)
241241
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
242242
CRYPTO_ALG_TYPE_MASK);
243243
if (IS_ERR(alg))
244-
return ERR_PTR(PTR_ERR(alg));
244+
return ERR_CAST(alg);
245245

246246
inst = crypto_alloc_instance("lrw", alg);
247247
if (IS_ERR(inst))

‎crypto/pcbc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static struct crypto_instance *crypto_pcbc_alloc(struct rtattr **tb)
234234
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
235235
CRYPTO_ALG_TYPE_MASK);
236236
if (IS_ERR(alg))
237-
return ERR_PTR(PTR_ERR(alg));
237+
return ERR_CAST(alg);
238238

239239
inst = crypto_alloc_instance("pcbc", alg);
240240
if (IS_ERR(inst))

‎crypto/xcbc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static struct crypto_instance *xcbc_alloc(struct rtattr **tb)
301301
alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER,
302302
CRYPTO_ALG_TYPE_MASK);
303303
if (IS_ERR(alg))
304-
return ERR_PTR(PTR_ERR(alg));
304+
return ERR_CAST(alg);
305305

306306
switch(alg->cra_blocksize) {
307307
case 16:

‎fs/9p/vfs_inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
573573
v9ses = v9fs_inode2v9ses(dir);
574574
dfid = v9fs_fid_lookup(dentry->d_parent);
575575
if (IS_ERR(dfid))
576-
return ERR_PTR(PTR_ERR(dfid));
576+
return ERR_CAST(dfid);
577577

578578
name = (char *) dentry->d_name.name;
579579
fid = p9_client_walk(dfid, 1, &name, 1);

‎fs/affs/namei.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
209209
bh = affs_find_entry(dir, dentry);
210210
affs_unlock_dir(dir);
211211
if (IS_ERR(bh)) {
212-
return ERR_PTR(PTR_ERR(bh));
212+
return ERR_CAST(bh);
213213
}
214214
if (bh) {
215215
u32 ino = bh->b_blocknr;

‎fs/afs/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
512512
key = afs_request_key(vnode->volume->cell);
513513
if (IS_ERR(key)) {
514514
_leave(" = %ld [key]", PTR_ERR(key));
515-
return ERR_PTR(PTR_ERR(key));
515+
return ERR_CAST(key);
516516
}
517517

518518
ret = afs_validate(vnode, key);
@@ -540,7 +540,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
540540
key_put(key);
541541
if (IS_ERR(inode)) {
542542
_leave(" = %ld", PTR_ERR(inode));
543-
return ERR_PTR(PTR_ERR(inode));
543+
return ERR_CAST(inode);
544544
}
545545

546546
dentry->d_op = &afs_fs_dentry_operations;

0 commit comments

Comments
 (0)