public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: [PATCH 5/5] block: switch ldm partition code to use pr_xxx() functions
Date: Tue,  8 Aug 2023 22:57:02 +0900	[thread overview]
Message-ID: <20230808135702.628588-6-dlemoal@kernel.org> (raw)
In-Reply-To: <20230808135702.628588-1-dlemoal@kernel.org>

Modify the ldm partition code to use the regular pr_info(), pr_err() etc
functions instead of using printk(). With this change, the function
_ldm_printk() is not necessary and removed. The special LDM_DEBUG
configuration option is also removed as regular dynamic debug control
can be used to turn on or off the debug messages. References to this
configuration option is removed from the documentation and from the m68k
defconfig.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 Documentation/admin-guide/ldm.rst |  7 +++----
 arch/m68k/configs/virt_defconfig  |  1 -
 block/partitions/Kconfig          | 10 ---------
 block/partitions/ldm.c            | 35 +++++++------------------------
 4 files changed, 10 insertions(+), 43 deletions(-)

diff --git a/Documentation/admin-guide/ldm.rst b/Documentation/admin-guide/ldm.rst
index 12c571368e73..e7b69a03e938 100644
--- a/Documentation/admin-guide/ldm.rst
+++ b/Documentation/admin-guide/ldm.rst
@@ -80,10 +80,9 @@ To enable LDM, choose the following two options:
   - "Advanced partition selection" CONFIG_PARTITION_ADVANCED
   - "Windows Logical Disk Manager (Dynamic Disk) support" CONFIG_LDM_PARTITION
 
-If you believe the driver isn't working as it should, you can enable the extra
-debugging code.  This will produce a LOT of output.  The option is:
-
-  - "Windows LDM extra logging" CONFIG_LDM_DEBUG
+If you believe the driver isn't working as it should, you can enable extra
+debugging messages using dynamic debug.  This will produce a LOT of output.
+See Documentation/admin-guide/dynamic-debug-howto.rst for details.
 
 N.B. The partition code cannot be compiled as a module.
 
diff --git a/arch/m68k/configs/virt_defconfig b/arch/m68k/configs/virt_defconfig
index 311b57e73316..94dd334da74f 100644
--- a/arch/m68k/configs/virt_defconfig
+++ b/arch/m68k/configs/virt_defconfig
@@ -19,7 +19,6 @@ CONFIG_MINIX_SUBPARTITION=y
 CONFIG_SOLARIS_X86_PARTITION=y
 CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_LDM_PARTITION=y
-CONFIG_LDM_DEBUG=y
 CONFIG_SUN_PARTITION=y
 CONFIG_SYSV68_PARTITION=y
 CONFIG_NET=y
diff --git a/block/partitions/Kconfig b/block/partitions/Kconfig
index 7aff4eb81c60..71e4461fc35d 100644
--- a/block/partitions/Kconfig
+++ b/block/partitions/Kconfig
@@ -200,16 +200,6 @@ config LDM_PARTITION
 
 	  If unsure, say N.
 
-config LDM_DEBUG
-	bool "Windows LDM extra logging"
-	depends on LDM_PARTITION
-	help
-	  Say Y here if you would like LDM to log verbosely.  This could be
-	  helpful if the driver doesn't work as expected and you'd like to
-	  report a bug.
-
-	  If unsure, say N.
-
 config SGI_PARTITION
 	bool "SGI partition support" if PARTITION_ADVANCED
 	default y if DEFAULT_SGI_PARTITION
diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c
index 38e58960ae03..691908c8c8f3 100644
--- a/block/partitions/ldm.c
+++ b/block/partitions/ldm.c
@@ -19,39 +19,18 @@
 #include "ldm.h"
 #include "check.h"
 
+#undef pr_fmt
+#define pr_fmt(fmt) "partition: ldm: " fmt
+
 /*
  * ldm_debug/info/error/crit - Output an error message
  * @f:    A printf format string containing the message
  * @...:  Variables to substitute into @f
- *
- * ldm_debug() writes a DEBUG level message to the syslog but only if the
- * driver was compiled with debug enabled. Otherwise, the call turns into a NOP.
  */
-#ifndef CONFIG_LDM_DEBUG
-#define ldm_debug(...)	do {} while (0)
-#else
-#define ldm_debug(f, a...) _ldm_printk (KERN_DEBUG, __func__, f, ##a)
-#endif
-
-#define ldm_crit(f, a...)  _ldm_printk (KERN_CRIT,  __func__, f, ##a)
-#define ldm_error(f, a...) _ldm_printk (KERN_ERR,   __func__, f, ##a)
-#define ldm_info(f, a...)  _ldm_printk (KERN_INFO,  __func__, f, ##a)
-
-static __printf(3, 4)
-void _ldm_printk(const char *level, const char *function, const char *fmt, ...)
-{
-	struct va_format vaf;
-	va_list args;
-
-	va_start (args, fmt);
-
-	vaf.fmt = fmt;
-	vaf.va = &args;
-
-	printk("%s%s(): %pV\n", level, function, &vaf);
-
-	va_end(args);
-}
+#define ldm_debug(f, a...) pr_debug("%s(): " f, __func__, ##a)
+#define ldm_crit(f, a...)  pr_crit("%s(): " f, __func__, ##a)
+#define ldm_error(f, a...) pr_err("%s(): " f, __func__, ##a)
+#define ldm_info(f, a...)  pr_info("%s(): " f, __func__, ##a)
 
 /**
  * ldm_parse_privhead - Read the LDM Database PRIVHEAD structure
-- 
2.41.0


  parent reply	other threads:[~2023-08-08 17:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 13:56 [PATCH 0/5] Some minor cleanups Damien Le Moal
2023-08-08 13:56 ` [PATCH 1/5] block: use PAGE_SECTORS_SHIFT to set limits Damien Le Moal
2023-08-09  2:04   ` Chaitanya Kulkarni
2023-08-09  6:07   ` Hannes Reinecke
2023-08-15 10:00   ` Johannes Thumshirn
2023-08-08 13:56 ` [PATCH 2/5] block: use pr_xxx() instead of printk() Damien Le Moal
2023-08-09  2:06   ` Chaitanya Kulkarni
2023-08-09  6:08   ` Hannes Reinecke
2023-08-15 10:01   ` Johannes Thumshirn
2023-08-08 13:57 ` [PATCH 3/5] block: use pr_xxx() instead of printk() in partition code Damien Le Moal
2023-08-09  2:07   ` Chaitanya Kulkarni
2023-08-09  3:42     ` Damien Le Moal
2023-08-09  6:09   ` Hannes Reinecke
2023-08-15 10:02   ` Johannes Thumshirn
2023-08-08 13:57 ` [PATCH 4/5] block: Improve efi partition debug messages Damien Le Moal
2023-08-09  2:07   ` Chaitanya Kulkarni
2023-08-09  6:09   ` Hannes Reinecke
2023-08-15 10:03   ` Johannes Thumshirn
2023-08-08 13:57 ` Damien Le Moal [this message]
2023-08-09  2:08   ` [PATCH 5/5] block: switch ldm partition code to use pr_xxx() functions Chaitanya Kulkarni
2023-08-09  6:10   ` Hannes Reinecke
2023-08-15 10:06   ` Johannes Thumshirn
2023-08-15 12:41     ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808135702.628588-6-dlemoal@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox