Skip to content

Commit edb2bca

Browse files
jonhunterthierryreding
authored andcommitted
firmware: tegra: Use consistent return variable name
Most functions in the BPMP driver use 'err' as the return variable name but there are a few places that use 'ret'. Let's use 'err' to be consistent. Signed-off-by: Jon Hunter <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 8b08dbb commit edb2bca

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

drivers/firmware/tegra/bpmp-debugfs.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static int debugfs_show(struct seq_file *m, void *p)
206206
char buf[256];
207207
const char *filename;
208208
size_t len, nbytes;
209-
int ret;
209+
int err;
210210

211211
filename = get_filename(bpmp, file, buf, sizeof(buf));
212212
if (!filename)
@@ -220,24 +220,24 @@ static int debugfs_show(struct seq_file *m, void *p)
220220
datavirt = dma_alloc_coherent(bpmp->dev, datasize, &dataphys,
221221
GFP_KERNEL | GFP_DMA32);
222222
if (!datavirt) {
223-
ret = -ENOMEM;
223+
err = -ENOMEM;
224224
goto free_namebuf;
225225
}
226226

227227
len = strlen(filename);
228228
strncpy(namevirt, filename, namesize);
229229

230-
ret = mrq_debugfs_read(bpmp, namephys, len, dataphys, datasize,
230+
err = mrq_debugfs_read(bpmp, namephys, len, dataphys, datasize,
231231
&nbytes);
232232

233-
if (!ret)
233+
if (!err)
234234
seq_write(m, datavirt, nbytes);
235235

236236
dma_free_coherent(bpmp->dev, datasize, datavirt, dataphys);
237237
free_namebuf:
238238
dma_free_coherent(bpmp->dev, namesize, namevirt, namephys);
239239

240-
return ret;
240+
return err;
241241
}
242242

243243
static int debugfs_open(struct inode *inode, struct file *file)
@@ -257,7 +257,7 @@ static ssize_t debugfs_store(struct file *file, const char __user *buf,
257257
char fnamebuf[256];
258258
const char *filename;
259259
size_t len;
260-
int ret;
260+
int err;
261261

262262
filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf));
263263
if (!filename)
@@ -271,27 +271,27 @@ static ssize_t debugfs_store(struct file *file, const char __user *buf,
271271
datavirt = dma_alloc_coherent(bpmp->dev, datasize, &dataphys,
272272
GFP_KERNEL | GFP_DMA32);
273273
if (!datavirt) {
274-
ret = -ENOMEM;
274+
err = -ENOMEM;
275275
goto free_namebuf;
276276
}
277277

278278
len = strlen(filename);
279279
strncpy(namevirt, filename, namesize);
280280

281281
if (copy_from_user(datavirt, buf, count)) {
282-
ret = -EFAULT;
282+
err = -EFAULT;
283283
goto free_databuf;
284284
}
285285

286-
ret = mrq_debugfs_write(bpmp, namephys, len, dataphys,
286+
err = mrq_debugfs_write(bpmp, namephys, len, dataphys,
287287
count);
288288

289289
free_databuf:
290290
dma_free_coherent(bpmp->dev, datasize, datavirt, dataphys);
291291
free_namebuf:
292292
dma_free_coherent(bpmp->dev, namesize, namevirt, namephys);
293293

294-
return ret ?: count;
294+
return err ?: count;
295295
}
296296

297297
static const struct file_operations debugfs_fops = {
@@ -380,8 +380,8 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
380380
void *virt;
381381
const size_t sz = SZ_512K;
382382
size_t nbytes;
383-
int ret;
384383
struct dentry *root;
384+
int err;
385385

386386
if (!tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS))
387387
return 0;
@@ -393,24 +393,24 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
393393
virt = dma_alloc_coherent(bpmp->dev, sz, &phys,
394394
GFP_KERNEL | GFP_DMA32);
395395
if (!virt) {
396-
ret = -ENOMEM;
396+
err = -ENOMEM;
397397
goto out;
398398
}
399399

400-
ret = mrq_debugfs_dumpdir(bpmp, phys, sz, &nbytes);
401-
if (ret < 0) {
400+
err = mrq_debugfs_dumpdir(bpmp, phys, sz, &nbytes);
401+
if (err < 0) {
402402
goto free;
403403
} else if (nbytes > sz) {
404-
ret = -EINVAL;
404+
err = -EINVAL;
405405
goto free;
406406
}
407407

408-
ret = create_debugfs_mirror(bpmp, virt, nbytes, root);
408+
err = create_debugfs_mirror(bpmp, virt, nbytes, root);
409409
free:
410410
dma_free_coherent(bpmp->dev, sz, virt, phys);
411411
out:
412-
if (ret < 0)
412+
if (err < 0)
413413
debugfs_remove(root);
414414

415-
return ret;
415+
return err;
416416
}

drivers/firmware/tegra/bpmp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,10 @@ bool tegra_bpmp_mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq)
515515
.size = sizeof(resp),
516516
},
517517
};
518-
int ret;
518+
int err;
519519

520-
ret = tegra_bpmp_transfer(bpmp, &msg);
521-
if (ret || msg.rx.ret)
520+
err = tegra_bpmp_transfer(bpmp, &msg);
521+
if (err || msg.rx.ret)
522522
return false;
523523

524524
return resp.status == 0;

0 commit comments

Comments
 (0)