Skip to content

Commit 6d6bd94

Browse files
Fabian Fredericktorvalds
authored andcommitted
fs/coda: use __func__
Replace all function names by __func__ in pr_foo() Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Jan Harkes <jaharkes@cs.cmu.edu> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent f38cfb2 commit 6d6bd94

5 files changed

Lines changed: 34 additions & 33 deletions

File tree

‎fs/coda/cnode.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct inode *coda_cnode_make(struct CodaFid *fid, struct super_block *sb)
101101

102102
inode = coda_iget(sb, fid, &attr);
103103
if (IS_ERR(inode))
104-
pr_warn("coda_cnode_make: coda_iget failed\n");
104+
pr_warn("%s: coda_iget failed\n", __func__);
105105
return inode;
106106
}
107107

@@ -137,7 +137,7 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
137137
unsigned long hash = coda_f2i(fid);
138138

139139
if ( !sb ) {
140-
pr_warn("coda_fid_to_inode: no sb!\n");
140+
pr_warn("%s: no sb!\n", __func__);
141141
return NULL;
142142
}
143143

‎fs/coda/dir.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -453,23 +453,23 @@ static int coda_venus_readdir(struct file *coda_file, struct dir_context *ctx)
453453
ret = kernel_read(host_file, ctx->pos - 2, (char *)vdir,
454454
sizeof(*vdir));
455455
if (ret < 0) {
456-
pr_err("coda readdir: read dir %s failed %d\n",
457-
coda_f2s(&cii->c_fid), ret);
456+
pr_err("%s: read dir %s failed %d\n",
457+
__func__, coda_f2s(&cii->c_fid), ret);
458458
break;
459459
}
460460
if (ret == 0) break; /* end of directory file reached */
461461

462462
/* catch truncated reads */
463463
if (ret < vdir_size || ret < vdir_size + vdir->d_namlen) {
464-
pr_err("coda readdir: short read on %s\n",
465-
coda_f2s(&cii->c_fid));
464+
pr_err("%s: short read on %s\n",
465+
__func__, coda_f2s(&cii->c_fid));
466466
ret = -EBADF;
467467
break;
468468
}
469469
/* validate whether the directory file actually makes sense */
470470
if (vdir->d_reclen < vdir_size + vdir->d_namlen) {
471-
pr_err("coda readdir: invalid dir %s\n",
472-
coda_f2s(&cii->c_fid));
471+
pr_err("%s: invalid dir %s\n",
472+
__func__, coda_f2s(&cii->c_fid));
473473
ret = -EBADF;
474474
break;
475475
}

‎fs/coda/inode.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ static int get_device_index(struct coda_mount_data *data)
119119
int idx;
120120

121121
if (data == NULL) {
122-
pr_warn("coda_read_super: Bad mount data\n");
122+
pr_warn("%s: Bad mount data\n", __func__);
123123
return -1;
124124
}
125125

126126
if (data->version != CODA_MOUNT_VERSION) {
127-
pr_warn("coda_read_super: Bad mount version\n");
127+
pr_warn("%s: Bad mount version\n", __func__);
128128
return -1;
129129
}
130130

@@ -141,13 +141,13 @@ static int get_device_index(struct coda_mount_data *data)
141141
fdput(f);
142142

143143
if (idx < 0 || idx >= MAX_CODADEVS) {
144-
pr_warn("coda_read_super: Bad minor number\n");
144+
pr_warn("%s: Bad minor number\n", __func__);
145145
return -1;
146146
}
147147

148148
return idx;
149149
Ebadf:
150-
pr_warn("coda_read_super: Bad file\n");
150+
pr_warn("%s: Bad file\n", __func__);
151151
return -1;
152152
}
153153

@@ -168,19 +168,19 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
168168
if(idx == -1)
169169
idx = 0;
170170

171-
pr_info("coda_read_super: device index: %i\n", idx);
171+
pr_info("%s: device index: %i\n", __func__, idx);
172172

173173
vc = &coda_comms[idx];
174174
mutex_lock(&vc->vc_mutex);
175175

176176
if (!vc->vc_inuse) {
177-
pr_warn("coda_read_super: No pseudo device\n");
177+
pr_warn("%s: No pseudo device\n", __func__);
178178
error = -EINVAL;
179179
goto unlock_out;
180180
}
181181

182182
if (vc->vc_sb) {
183-
pr_warn("coda_read_super: Device already mounted\n");
183+
pr_warn("%s: Device already mounted\n", __func__);
184184
error = -EBUSY;
185185
goto unlock_out;
186186
}
@@ -204,11 +204,11 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
204204
/* get root fid from Venus: this needs the root inode */
205205
error = venus_rootfid(sb, &fid);
206206
if ( error ) {
207-
pr_warn("coda_read_super: coda_get_rootfid failed with %d\n",
208-
error);
207+
pr_warn("%s: coda_get_rootfid failed with %d\n",
208+
__func__, error);
209209
goto error;
210210
}
211-
pr_info("coda_read_super: rootfid is %s\n", coda_f2s(&fid));
211+
pr_info("%s: rootfid is %s\n", __func__, coda_f2s(&fid));
212212

213213
/* make root inode */
214214
root = coda_cnode_make(&fid, sb);
@@ -219,8 +219,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
219219
goto error;
220220
}
221221

222-
pr_info("coda_read_super: rootinode is %ld dev %s\n",
223-
root->i_ino, root->i_sb->s_id);
222+
pr_info("%s: rootinode is %ld dev %s\n",
223+
__func__, root->i_ino, root->i_sb->s_id);
224224
sb->s_root = d_make_root(root);
225225
if (!sb->s_root) {
226226
error = -EINVAL;

‎fs/coda/psdev.c‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
136136

137137
CODA_FREE(dcbuf, nbytes);
138138
if (error) {
139-
pr_warn("psdev_write: coda_downcall error: %d\n",
140-
error);
139+
pr_warn("%s: coda_downcall error: %d\n",
140+
__func__, error);
141141
retval = error;
142142
goto out;
143143
}
@@ -158,16 +158,17 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
158158
mutex_unlock(&vcp->vc_mutex);
159159

160160
if (!req) {
161-
pr_warn("psdev_write: msg (%d, %d) not found\n",
162-
hdr.opcode, hdr.unique);
161+
pr_warn("%s: msg (%d, %d) not found\n",
162+
__func__, hdr.opcode, hdr.unique);
163163
retval = -ESRCH;
164164
goto out;
165165
}
166166

167167
/* move data into response buffer. */
168168
if (req->uc_outSize < nbytes) {
169-
pr_warn("psdev_write: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n",
170-
req->uc_outSize, (long)nbytes, hdr.opcode, hdr.unique);
169+
pr_warn("%s: too much cnt: %d, cnt: %ld, opc: %d, uniq: %d.\n",
170+
__func__, req->uc_outSize, (long)nbytes,
171+
hdr.opcode, hdr.unique);
171172
nbytes = req->uc_outSize; /* don't have more space! */
172173
}
173174
if (copy_from_user(req->uc_data, buf, nbytes)) {
@@ -241,8 +242,8 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf,
241242
/* Move the input args into userspace */
242243
count = req->uc_inSize;
243244
if (nbytes < req->uc_inSize) {
244-
pr_warn("psdev_read: Venus read %ld bytes of %d in message\n",
245-
(long)nbytes, req->uc_inSize);
245+
pr_warn("%s: Venus read %ld bytes of %d in message\n",
246+
__func__, (long)nbytes, req->uc_inSize);
246247
count = nbytes;
247248
}
248249

@@ -306,7 +307,7 @@ static int coda_psdev_release(struct inode * inode, struct file * file)
306307
struct upc_req *req, *tmp;
307308

308309
if (!vcp || !vcp->vc_inuse ) {
309-
pr_warn("psdev_release: Not open.\n");
310+
pr_warn("%s: Not open.\n", __func__);
310311
return -1;
311312
}
312313

@@ -355,8 +356,8 @@ static int init_coda_psdev(void)
355356
{
356357
int i, err = 0;
357358
if (register_chrdev(CODA_PSDEV_MAJOR, "coda", &coda_psdev_fops)) {
358-
pr_err("coda_psdev: unable to get major %d\n",
359-
CODA_PSDEV_MAJOR);
359+
pr_err("%s: unable to get major %d\n",
360+
__func__, CODA_PSDEV_MAJOR);
360361
return -EIO;
361362
}
362363
coda_psdev_class = class_create(THIS_MODULE, "coda");

‎fs/coda/upcall.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
518518
&outsize, inp);
519519

520520
if (error) {
521-
pr_warn("coda_pioctl: Venus returns: %d for %s\n",
522-
error, coda_f2s(fid));
521+
pr_warn("%s: Venus returns: %d for %s\n",
522+
__func__, error, coda_f2s(fid));
523523
goto exit;
524524
}
525525

0 commit comments

Comments
 (0)