dm: remove unneeded variable
PATCH 1/1 dm: remove unneeded variable
fix the following coccicheck warning:
drivers/md/dm-snap-persistent.c:909:14-16: Unneeded variable: "sz".
---
drivers/md/dm-snap-persistent.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
drivers/md/dm-snap-persistent.c +0 -0
index 15649921f2a9..7ea01bceba59 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -906,7 +906,6 @@ static unsigned int persistent_status(struct dm_exception_store *store,
status_type_t status, char *result,
unsigned int maxlen)
{
- unsigned int sz = 0;
switch (status) {
case STATUSTYPE_INFO:
@@ -920,7 +919,7 @@ static unsigned int persistent_status(struct dm_exception_store *store,
break;
}
- return sz;
+ return 0;
}
static struct dm_exception_store_type _persistent_type = {
--
2.40.1
Alasdair G Kergon
maintainerQuoted 7 lines · On Wed, Jun 14, 2023 at 10:10:33AM +0800, [email protected] wrote:
fix the following coccicheck warning:
drivers/md/dm-snap-persistent.c:909:14-16: Unneeded variable: "sz".- unsigned int sz = 0;
- return sz;
+ return 0;
Did the patched code compile OK for you?
The semantics of the DMEMIT macro are perhaps a tad unexpected.
Alasdair
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Alasdair G Kergon
maintainerQuoted 4 lines · On Wed, Jun 14, 2023 at 11:12:19AM +0800, [email protected] wrote:
在 2023-06-14 10:42,Alasdair G Kergon 写道:Quoted 1 line
Did the patched code compile OK for you?
Yes!
So what is the definition of DMEMIT that your compiler uses and why?
Alasdair
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel