* [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul()
@ 2019-10-25 9:41 Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 1/7] debugfs: Add debugfs_create_xul() for hexadecimal unsigned long Geert Uytterhoeven
` (7 more replies)
0 siblings, 8 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
Hi all,
The existing debugfs_create_ulong() function supports objects of
type "unsigned long", which are 32-bit or 64-bit depending on the
platform, in decimal form. To format objects in hexadecimal, various
debugfs_create_x*() functions exist, but all of them take fixed-size
types.
To work around this, some drivers call one of debugfs_create_x{32,64}(),
depending on the size of unsigned long.
Other drivers just cast the value pointer to "u32 *" or "u64 *",
introducing portability bugs or data leaks in the process.
Hence this patch series adds a debugfs helper for "unsigned long"
objects in hexadecimal format, and converts drivers to make use of it.
It also contains two cleanups removing superfluous casts, which I added
to this series to avoid conflicts.
Changes compared to v1[1]:
- Add kerneldoc,
- Update Documentation/filesystems/debugfs.txt,
- Add Acked-by.
Dependencies:
- The first patch now depends on "Documentation: debugfs: Document
debugfs helper for unsigned long values"[2], which Jon said he
applied to his tree.
Thanks!
[1] https://lore.kernel.org/lkml/20191021143742.14487-1-geert+renesas@glider.be/
[2] https://lore.kernel.org/lkml/20191021150645.32440-1-geert+renesas@glider.be/
Geert Uytterhoeven (7):
debugfs: Add debugfs_create_xul() for hexadecimal unsigned long
mac80211: Use debugfs_create_xul() helper
net: caif: Fix debugfs on 64-bit platforms
mmc: atmel-mci: Fix debugfs on 64-bit platforms
mmc: atmel-mci: Remove superfluous cast in debugfs_create_u32() call
mmc: dw_mmc: Fix debugfs on 64-bit platforms
mmc: dw_mmc: Remove superfluous cast in debugfs_create_u32() call
Documentation/filesystems/debugfs.txt | 5 ++++-
drivers/mmc/host/atmel-mci.c | 10 +++++-----
drivers/mmc/host/dw_mmc.c | 10 +++++-----
drivers/net/caif/caif_serial.c | 4 ++--
include/linux/debugfs.h | 21 +++++++++++++++++++++
net/mac80211/debugfs_sta.c | 17 +++--------------
6 files changed, 40 insertions(+), 27 deletions(-)
--
2.17.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/7] debugfs: Add debugfs_create_xul() for hexadecimal unsigned long
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper Geert Uytterhoeven
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
The existing debugfs_create_ulong() function supports objects of
type "unsigned long", which are 32-bit or 64-bit depending on the
platform, in decimal form. To format objects in hexadecimal, various
debugfs_create_x*() functions exist, but all of them take fixed-size
types.
Add a debugfs helper for "unsigned long" objects in hexadecimal format.
This avoids the need for users to open-code the same, or introduce
bugs when casting the value pointer to "u32 *" or "u64 *" to call
debugfs_create_x{32,64}().
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
- Add kerneldoc,
- Update Documentation/filesystems/debugfs.txt.
---
Documentation/filesystems/debugfs.txt | 5 ++++-
include/linux/debugfs.h | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt
index 50e8f91f2421ec04..8c8e60fe8c7deb86 100644
--- a/Documentation/filesystems/debugfs.txt
+++ b/Documentation/filesystems/debugfs.txt
@@ -102,11 +102,14 @@ functions meant to help out in such special cases:
As might be expected, this function will create a debugfs file to represent
a variable of type size_t.
-Similarly, there is a helper for variables of type unsigned long:
+Similarly, there are helpers for variables of type unsigned long, in decimal
+and hexadecimal:
struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
struct dentry *parent,
unsigned long *value);
+ void debugfs_create_xul(const char *name, umode_t mode,
+ struct dentry *parent, unsigned long *value);
Boolean values can be placed in debugfs with:
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 33690949b45d6904..af6c2e5b7d3c7afa 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -356,4 +356,25 @@ static inline ssize_t debugfs_write_file_bool(struct file *file,
#endif
+/**
+ * debugfs_create_xul - create a debugfs file that is used to read and write an
+ * unsigned long value, formatted in hexadecimal
+ * @name: a pointer to a string containing the name of the file to create.
+ * @mode: the permission that the file should have
+ * @parent: a pointer to the parent dentry for this file. This should be a
+ * directory dentry if set. If this parameter is %NULL, then the
+ * file will be created in the root of the debugfs filesystem.
+ * @value: a pointer to the variable that the file should read to and write
+ * from.
+ */
+static inline void debugfs_create_xul(const char *name, umode_t mode,
+ struct dentry *parent,
+ unsigned long *value)
+{
+ if (sizeof(*value) == sizeof(u32))
+ debugfs_create_x32(name, mode, parent, (u32 *)value);
+ else
+ debugfs_create_x64(name, mode, parent, (u64 *)value);
+}
+
#endif
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 1/7] debugfs: Add debugfs_create_xul() for hexadecimal unsigned long Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-11-04 7:28 ` Johannes Berg
2019-10-25 9:41 ` [PATCH v2 3/7] net: caif: Fix debugfs on 64-bit platforms Geert Uytterhoeven
` (5 subsequent siblings)
7 siblings, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
Use the new debugfs_create_xul() helper instead of open-coding the same
operation.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
- No changes.
---
net/mac80211/debugfs_sta.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index c8ad20c28c438dab..ca34dcdac8c0bd4d 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -928,12 +928,7 @@ STA_OPS(he_capa);
sta->debugfs_dir, sta, &sta_ ##name## _ops);
#define DEBUGFS_ADD_COUNTER(name, field) \
- if (sizeof(sta->field) == sizeof(u32)) \
- debugfs_create_u32(#name, 0400, sta->debugfs_dir, \
- (u32 *) &sta->field); \
- else \
- debugfs_create_u64(#name, 0400, sta->debugfs_dir, \
- (u64 *) &sta->field);
+ debugfs_create_ulong(#name, 0400, sta->debugfs_dir, &sta->field);
void ieee80211_sta_debugfs_add(struct sta_info *sta)
{
@@ -978,14 +973,8 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
NL80211_EXT_FEATURE_AIRTIME_FAIRNESS))
DEBUGFS_ADD(airtime);
- if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
- debugfs_create_x32("driver_buffered_tids", 0400,
- sta->debugfs_dir,
- (u32 *)&sta->driver_buffered_tids);
- else
- debugfs_create_x64("driver_buffered_tids", 0400,
- sta->debugfs_dir,
- (u64 *)&sta->driver_buffered_tids);
+ debugfs_create_xul("driver_buffered_tids", 0400, sta->debugfs_dir,
+ &sta->driver_buffered_tids);
drv_sta_add_debugfs(local, sdata, &sta->sta, sta->debugfs_dir);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 3/7] net: caif: Fix debugfs on 64-bit platforms
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 1/7] debugfs: Add debugfs_create_xul() for hexadecimal unsigned long Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 4/7] mmc: atmel-mci: " Geert Uytterhoeven
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
"ser_device.state" is "unsigned long", i.e. 32-bit or 64-bit, depending
on the platform. Hence casting its address to "u32 *", and calling
debugfs_create_x32() breaks operation on 64-bit platforms.
Fix this by using the new debugfs_create_xul() helper instead.
Fixes: 9b27105b4a44c54b ("net-caif-driver: add CAIF serial driver (ldisc)")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
- No changes.
---
drivers/net/caif/caif_serial.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index 40b079162804fb0c..bd40b114d6cd7214 100644
--- a/drivers/net/caif/caif_serial.c
+++ b/drivers/net/caif/caif_serial.c
@@ -102,8 +102,8 @@ static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty)
debugfs_create_blob("last_rx_msg", 0400, ser->debugfs_tty_dir,
&ser->rx_blob);
- debugfs_create_x32("ser_state", 0400, ser->debugfs_tty_dir,
- (u32 *)&ser->state);
+ debugfs_create_xul("ser_state", 0400, ser->debugfs_tty_dir,
+ &ser->state);
debugfs_create_x8("tty_status", 0400, ser->debugfs_tty_dir,
&ser->tty_status);
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 4/7] mmc: atmel-mci: Fix debugfs on 64-bit platforms
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
` (2 preceding siblings ...)
2019-10-25 9:41 ` [PATCH v2 3/7] net: caif: Fix debugfs on 64-bit platforms Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 5/7] mmc: atmel-mci: Remove superfluous cast in debugfs_create_u32() call Geert Uytterhoeven
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
"atmel_mci.pending_events" and "atmel_mci.completed_events" are
"unsigned long", i.e. 32-bit or 64-bit, depending on the platform.
Hence casting their addresses to "u32 *", and calling
debugfs_create_x32() breaks operation on 64-bit platforms.
Fix this by using the new debugfs_create_xul() helper instead.
Fixes: deec9ae31e607955 ("atmel-mci: debugfs support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
v2:
- Add Acked-by.
---
drivers/mmc/host/atmel-mci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index c26fbe5f22221d95..ef2eb9e7c75a32a1 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -584,10 +584,10 @@ static void atmci_init_debugfs(struct atmel_mci_slot *slot)
debugfs_create_file("regs", S_IRUSR, root, host, &atmci_regs_fops);
debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops);
debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state);
- debugfs_create_x32("pending_events", S_IRUSR, root,
- (u32 *)&host->pending_events);
- debugfs_create_x32("completed_events", S_IRUSR, root,
- (u32 *)&host->completed_events);
+ debugfs_create_xul("pending_events", S_IRUSR, root,
+ &host->pending_events);
+ debugfs_create_xul("completed_events", S_IRUSR, root,
+ &host->completed_events);
}
#if defined(CONFIG_OF)
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/7] mmc: atmel-mci: Remove superfluous cast in debugfs_create_u32() call
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
` (3 preceding siblings ...)
2019-10-25 9:41 ` [PATCH v2 4/7] mmc: atmel-mci: " Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 6/7] mmc: dw_mmc: Fix debugfs on 64-bit platforms Geert Uytterhoeven
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
"atmel_mci.state" is an enum, which is compatible with u32, so there is
no need to cast its address, preventing further compiler checks.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
v2:
- Add Acked-by.
---
drivers/mmc/host/atmel-mci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index ef2eb9e7c75a32a1..34c992d875298932 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -583,7 +583,7 @@ static void atmci_init_debugfs(struct atmel_mci_slot *slot)
debugfs_create_file("regs", S_IRUSR, root, host, &atmci_regs_fops);
debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops);
- debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state);
+ debugfs_create_u32("state", S_IRUSR, root, &host->state);
debugfs_create_xul("pending_events", S_IRUSR, root,
&host->pending_events);
debugfs_create_xul("completed_events", S_IRUSR, root,
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 6/7] mmc: dw_mmc: Fix debugfs on 64-bit platforms
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
` (4 preceding siblings ...)
2019-10-25 9:41 ` [PATCH v2 5/7] mmc: atmel-mci: Remove superfluous cast in debugfs_create_u32() call Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 7/7] mmc: dw_mmc: Remove superfluous cast in debugfs_create_u32() call Geert Uytterhoeven
2019-11-03 17:13 ` [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Greg Kroah-Hartman
7 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
"dw_mci.pending_events" and "dw_mci.completed_events" are "unsigned
long", i.e. 32-bit or 64-bit, depending on the platform. Hence casting
their addresses to "u32 *", and calling debugfs_create_x32() breaks
operation on 64-bit platforms.
Fix this by using the new debugfs_create_xul() helper instead.
Fixes: f95f3850f7a9e1d4 ("mmc: dw_mmc: Add Synopsys DesignWare mmc host driver.")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
v2:
- Add Acked-by.
---
drivers/mmc/host/dw_mmc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index bf0048ebbda356a7..b4c4a9cd6365f122 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -177,10 +177,10 @@ static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
debugfs_create_file("regs", S_IRUSR, root, host, &dw_mci_regs_fops);
debugfs_create_file("req", S_IRUSR, root, slot, &dw_mci_req_fops);
debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state);
- debugfs_create_x32("pending_events", S_IRUSR, root,
- (u32 *)&host->pending_events);
- debugfs_create_x32("completed_events", S_IRUSR, root,
- (u32 *)&host->completed_events);
+ debugfs_create_xul("pending_events", S_IRUSR, root,
+ &host->pending_events);
+ debugfs_create_xul("completed_events", S_IRUSR, root,
+ &host->completed_events);
}
#endif /* defined(CONFIG_DEBUG_FS) */
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 7/7] mmc: dw_mmc: Remove superfluous cast in debugfs_create_u32() call
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
` (5 preceding siblings ...)
2019-10-25 9:41 ` [PATCH v2 6/7] mmc: dw_mmc: Fix debugfs on 64-bit platforms Geert Uytterhoeven
@ 2019-10-25 9:41 ` Geert Uytterhoeven
2019-11-03 17:13 ` [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Greg Kroah-Hartman
7 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-10-25 9:41 UTC (permalink / raw)
To: Jonathan Corbet, Greg Kroah-Hartman, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, Johannes Berg
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel, Geert Uytterhoeven
"dw_mci.state" is an enum, which is compatible with u32, so there is no
need to cast its address, preventing further compiler checks.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
---
v2:
- Add Acked-by.
---
drivers/mmc/host/dw_mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index b4c4a9cd6365f122..fc9d4d000f97e434 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -176,7 +176,7 @@ static void dw_mci_init_debugfs(struct dw_mci_slot *slot)
debugfs_create_file("regs", S_IRUSR, root, host, &dw_mci_regs_fops);
debugfs_create_file("req", S_IRUSR, root, slot, &dw_mci_req_fops);
- debugfs_create_u32("state", S_IRUSR, root, (u32 *)&host->state);
+ debugfs_create_u32("state", S_IRUSR, root, &host->state);
debugfs_create_xul("pending_events", S_IRUSR, root,
&host->pending_events);
debugfs_create_xul("completed_events", S_IRUSR, root,
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul()
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
` (6 preceding siblings ...)
2019-10-25 9:41 ` [PATCH v2 7/7] mmc: dw_mmc: Remove superfluous cast in debugfs_create_u32() call Geert Uytterhoeven
@ 2019-11-03 17:13 ` Greg Kroah-Hartman
7 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-03 17:13 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Jonathan Corbet, Ludovic Desroches, Ulf Hansson, Nicolas Ferre,
Alexandre Belloni, Jaehoon Chung, David S . Miller,
Rafael J . Wysocki, Johannes Berg, linux-doc, linux-mmc,
linux-arm-kernel, netdev, linux-wireless, linux-kernel
On Fri, Oct 25, 2019 at 11:41:23AM +0200, Geert Uytterhoeven wrote:
> Hi all,
>
> The existing debugfs_create_ulong() function supports objects of
> type "unsigned long", which are 32-bit or 64-bit depending on the
> platform, in decimal form. To format objects in hexadecimal, various
> debugfs_create_x*() functions exist, but all of them take fixed-size
> types.
>
> To work around this, some drivers call one of debugfs_create_x{32,64}(),
> depending on the size of unsigned long.
> Other drivers just cast the value pointer to "u32 *" or "u64 *",
> introducing portability bugs or data leaks in the process.
>
> Hence this patch series adds a debugfs helper for "unsigned long"
> objects in hexadecimal format, and converts drivers to make use of it.
> It also contains two cleanups removing superfluous casts, which I added
> to this series to avoid conflicts.
>
> Changes compared to v1[1]:
> - Add kerneldoc,
> - Update Documentation/filesystems/debugfs.txt,
> - Add Acked-by.
>
> Dependencies:
> - The first patch now depends on "Documentation: debugfs: Document
> debugfs helper for unsigned long values"[2], which Jon said he
> applied to his tree.
I did not take patches 2 or 3 as I need acks from those subsystem
maintainers to do so.
But I did take all the others.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper
2019-10-25 9:41 ` [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper Geert Uytterhoeven
@ 2019-11-04 7:28 ` Johannes Berg
2019-11-04 7:39 ` Greg Kroah-Hartman
0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2019-11-04 7:28 UTC (permalink / raw)
To: Geert Uytterhoeven, Jonathan Corbet, Greg Kroah-Hartman,
Ludovic Desroches, Ulf Hansson, Nicolas Ferre, Alexandre Belloni,
Jaehoon Chung, David S . Miller, Rafael J . Wysocki
Cc: linux-doc, linux-mmc, linux-arm-kernel, netdev, linux-wireless,
linux-kernel
On Fri, 2019-10-25 at 11:41 +0200, Geert Uytterhoeven wrote:
> Use the new debugfs_create_xul() helper instead of open-coding the same
> operation.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Sorry Greg, this slipped through on my side.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Do you prefer to take this to your tree still, or should I pick it up
later once debugfs_create_xul() is available (to me)?
johannes
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper
2019-11-04 7:28 ` Johannes Berg
@ 2019-11-04 7:39 ` Greg Kroah-Hartman
0 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-04 7:39 UTC (permalink / raw)
To: Johannes Berg
Cc: Geert Uytterhoeven, Jonathan Corbet, Ludovic Desroches,
Ulf Hansson, Nicolas Ferre, Alexandre Belloni, Jaehoon Chung,
David S . Miller, Rafael J . Wysocki, linux-doc, linux-mmc,
linux-arm-kernel, netdev, linux-wireless, linux-kernel
On Mon, Nov 04, 2019 at 08:28:57AM +0100, Johannes Berg wrote:
> On Fri, 2019-10-25 at 11:41 +0200, Geert Uytterhoeven wrote:
> > Use the new debugfs_create_xul() helper instead of open-coding the same
> > operation.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Sorry Greg, this slipped through on my side.
>
> Acked-by: Johannes Berg <johannes@sipsolutions.net>
>
> Do you prefer to take this to your tree still, or should I pick it up
> later once debugfs_create_xul() is available (to me)?
I can take it now, thanks!
greg k-h
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-11-04 7:39 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 9:41 [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 1/7] debugfs: Add debugfs_create_xul() for hexadecimal unsigned long Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 2/7] mac80211: Use debugfs_create_xul() helper Geert Uytterhoeven
2019-11-04 7:28 ` Johannes Berg
2019-11-04 7:39 ` Greg Kroah-Hartman
2019-10-25 9:41 ` [PATCH v2 3/7] net: caif: Fix debugfs on 64-bit platforms Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 4/7] mmc: atmel-mci: " Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 5/7] mmc: atmel-mci: Remove superfluous cast in debugfs_create_u32() call Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 6/7] mmc: dw_mmc: Fix debugfs on 64-bit platforms Geert Uytterhoeven
2019-10-25 9:41 ` [PATCH v2 7/7] mmc: dw_mmc: Remove superfluous cast in debugfs_create_u32() call Geert Uytterhoeven
2019-11-03 17:13 ` [PATCH v2 0/7] debugfs: Add and use debugfs_create_xul() Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).