Skip to contentSkip to conversation

dlm: clean up a type in waiters_read()

PATCH In review Dan Carpenter 3 participants 7 messages Oct 1 – Oct 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dlm: clean up a type in waiters_read()

This doesn't affect runtime but "rv" stores error codes and so declare it as ssize_t instead of size_t.

---
 fs/dlm/debug_fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/dlm/debug_fs.c +2 -1
index 700a0cbb2f14..f52a51b1382a 100644
@@ -596,7 +596,8 @@ static ssize_t waiters_read(struct file *file, char __user *userbuf,
 {
 	struct dlm_ls *ls = file->private_data;
 	struct dlm_lkb *lkb;
-	size_t len = DLM_DEBUG_BUF_LEN, pos = 0, ret, rv;
+	size_t len = DLM_DEBUG_BUF_LEN, pos = 0, ret;
+	ssize_t rv;
 
 	mutex_lock(&debug_buf_lock);
 	ret = dlm_lock_recovery_try(ls);
Signature · 1 line
2.53.0
#2 lore raw
In reply to Dan Carpenter
Quoted 2 lines

This doesn't affect runtime but "rv" stores error codes and so declare it as ssize_t instead of size_t.

Can a similar adjustment matter also for the local variable “ret”?

Regards,
Markus

maintainer
#3 lore raw

Hi,

Quoted 6 lines · Markus Elfring
Quoted 3 lines

This doesn't affect runtime but "rv" stores error codes and so declare it as ssize_t instead of size_t.

Can a similar adjustment matter also for the local variable “ret”?

What do you mean by 'matter'? It's declared as cleanup.

- Alex

#4 lore raw
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This doesn't affect runtime but "rv" stores error codes and so declare it as ssize_t instead of size_t.

Can a similar adjustment matter also for the local variable “ret”?

What do you mean by 'matter'? It's declared as cleanup.

Can the usage of a data type like “int” become more desirable for “ret” according to the affected function implementation?

Regards,
Markus

#5 lore raw
Quoted 8 lines · Markus Elfring
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This doesn't affect runtime but "rv" stores error codes and so declare it as ssize_t instead of size_t.

Can a similar adjustment matter also for the local variable “ret”?

What do you mean by 'matter'? It's declared as cleanup.

Can the usage of a data type like “int” become more desirable for “ret” according to the affected function implementation?

Either way is a defensible style choice for "ret" so I left it as-is.

regards,
dan carpenter

#6 lore raw
Quoted 4 lines
Quoted 2 lines

Can the usage of a data type like “int” become more desirable for “ret” according to the affected function implementation?

Either way is a defensible style choice for "ret" so I left it as-is.

Will consistent data type specifications be preferred in subsequent software revisions?

Regards,
Markus