* [PATCH] common: driver: fixes argument name mismatch in for_each_cdev
@ 2023-06-14 13:51 michael.kopfensteiner
2023-06-14 13:58 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: michael.kopfensteiner @ 2023-06-14 13:51 UTC (permalink / raw)
To: barebox; +Cc: Michael Kopfensteiner
From: Michael Kopfensteiner <michael.kopfensteiner@vahle.com>
The for_each_cdev makro takes a pointer argument as loop cursor.
Due to a name mismatch, not the provided pointer was used but
whatever was called `cdev`.
This mismatch had no effect, because in every usage the given
pointer is named cdev anyway.
This commit fixes the name-mismatch. The makro now works with
arguments name differently than 'cdev' too.
---
include/driver.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/driver.h b/include/driver.h
index d33e0fcbcc..e1ee3dc2dd 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -566,7 +566,7 @@ int cdev_truncate(struct cdev*, size_t size);
loff_t cdev_unallocated_space(struct cdev *cdev);
extern struct list_head cdev_list;
-#define for_each_cdev(c) \
+#define for_each_cdev(cdev) \
list_for_each_entry(cdev, &cdev_list, list)
#define DEVFS_PARTITION_FIXED (1U << 0)
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] common: driver: fixes argument name mismatch in for_each_cdev
2023-06-14 13:51 [PATCH] common: driver: fixes argument name mismatch in for_each_cdev michael.kopfensteiner
@ 2023-06-14 13:58 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-06-14 13:58 UTC (permalink / raw)
To: michael.kopfensteiner; +Cc: barebox
Hi Michael,
On Wed, Jun 14, 2023 at 03:51:33PM +0200, michael.kopfensteiner@vahle.com wrote:
> From: Michael Kopfensteiner <michael.kopfensteiner@vahle.com>
>
> The for_each_cdev makro takes a pointer argument as loop cursor.
> Due to a name mismatch, not the provided pointer was used but
> whatever was called `cdev`.
> This mismatch had no effect, because in every usage the given
> pointer is named cdev anyway.
>
> This commit fixes the name-mismatch. The makro now works with
> arguments name differently than 'cdev' too.
Thanks for fixing this. Ahmad was a bit faster though, it is already
fixed in next branch with 7fb4fd0417 ("cdev: fix for_each_cdev macro")
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-14 14:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 13:51 [PATCH] common: driver: fixes argument name mismatch in for_each_cdev michael.kopfensteiner
2023-06-14 13:58 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox