All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: get rid of CONFIG_SND_VERBOSE_PRINTK
@ 2013-06-03 20:18 Alan Stern
  2013-06-03 20:24 ` Joe Perches
  2013-06-04  9:13 ` Takashi Iwai
  0 siblings, 2 replies; 44+ messages in thread
From: Alan Stern @ 2013-06-03 20:18 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Joe Perches, alsa-devel

According to Takashi Iwai, CONFIG_SND_VERBOSE_PRINTK is "useless".  All 
it does is add filenames and line numbers to certain log messages.

This patch gets rid of it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Joe Perches <joe@perches.com>

---

Updating all the snd_printk() and snd_printd() calls will be a huge
job.  Getting rid of the verbose logging is a lot easier, so that's
where I'm starting.

Alan Stern

[as1688]

 Documentation/DocBook/writing-an-alsa-driver.tmpl |    7 +---
 arch/arm/configs/eseries_pxa_defconfig            |    1 
 arch/arm/configs/omap2plus_defconfig              |    1 
 arch/arm/configs/s3c2410_defconfig                |    1 
 arch/arm/configs/trizeps4_defconfig               |    1 
 arch/ia64/configs/generic_defconfig               |    1 
 arch/ia64/configs/gensparse_defconfig             |    1 
 arch/mips/configs/pnx8335_stb225_defconfig        |    1 
 arch/powerpc/configs/ppc6xx_defconfig             |    1 
 arch/sh/configs/edosk7760_defconfig               |    1 
 arch/sh/configs/sh7785lcr_32bit_defconfig         |    1 
 include/sound/core.h                              |    4 +-
 sound/core/Kconfig                                |    9 ------
 sound/core/misc.c                                 |   33 ----------------------
 sound/pci/hda/hda_intel.c                         |    4 --
 15 files changed, 5 insertions(+), 62 deletions(-)

Index: usb-3.10/Documentation/DocBook/writing-an-alsa-driver.tmpl
===================================================================
--- usb-3.10.orig/Documentation/DocBook/writing-an-alsa-driver.tmpl
+++ usb-3.10/Documentation/DocBook/writing-an-alsa-driver.tmpl
@@ -6087,11 +6087,8 @@ struct _snd_pcm_runtime {
       <title><function>snd_printk()</function> and friends</title>
       <para>
         ALSA provides a verbose version of the
-      <function>printk()</function> function. If a kernel config
-      <constant>CONFIG_SND_VERBOSE_PRINTK</constant> is set, this
-      function prints the given message together with the file name
-      and the line of the caller. The <constant>KERN_XXX</constant>
-      prefix is processed as 
+      <function>printk()</function> function.
+      The <constant>KERN_XXX</constant> prefix is processed as
       well as the original <function>printk()</function> does, so it's
       recommended to add this prefix, e.g. 
 
Index: usb-3.10/arch/arm/configs/eseries_pxa_defconfig
===================================================================
--- usb-3.10.orig/arch/arm/configs/eseries_pxa_defconfig
+++ usb-3.10/arch/arm/configs/eseries_pxa_defconfig
@@ -90,7 +90,6 @@ CONFIG_SND=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_DYNAMIC_MINORS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 # CONFIG_SND_PCMCIA is not set
 CONFIG_SND_SOC=m
 CONFIG_SND_PXA2XX_SOC=m
Index: usb-3.10/arch/arm/configs/omap2plus_defconfig
===================================================================
--- usb-3.10.orig/arch/arm/configs/omap2plus_defconfig
+++ usb-3.10/arch/arm/configs/omap2plus_defconfig
@@ -192,7 +192,6 @@ CONFIG_SOUND=m
 CONFIG_SND=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
 CONFIG_SND_USB_AUDIO=m
 CONFIG_SND_SOC=m
Index: usb-3.10/arch/arm/configs/s3c2410_defconfig
===================================================================
--- usb-3.10.orig/arch/arm/configs/s3c2410_defconfig
+++ usb-3.10/arch/arm/configs/s3c2410_defconfig
@@ -315,7 +315,6 @@ CONFIG_SND_SEQUENCER=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 # CONFIG_SND_DRIVERS is not set
 # CONFIG_SND_ARM is not set
 # CONFIG_SND_SPI is not set
Index: usb-3.10/arch/arm/configs/trizeps4_defconfig
===================================================================
--- usb-3.10.orig/arch/arm/configs/trizeps4_defconfig
+++ usb-3.10/arch/arm/configs/trizeps4_defconfig
@@ -159,7 +159,6 @@ CONFIG_SND=y
 CONFIG_SND_SEQUENCER=y
 CONFIG_SND_MIXER_OSS=y
 CONFIG_SND_PCM_OSS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
 CONFIG_SND_PXA2XX_AC97=y
 CONFIG_SND_USB_AUDIO=m
Index: usb-3.10/arch/ia64/configs/generic_defconfig
===================================================================
--- usb-3.10.orig/arch/ia64/configs/generic_defconfig
+++ usb-3.10/arch/ia64/configs/generic_defconfig
@@ -127,7 +127,6 @@ CONFIG_SND_SEQ_DUMMY=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DUMMY=m
 CONFIG_SND_VIRMIDI=m
 CONFIG_SND_MTPAV=m
Index: usb-3.10/arch/ia64/configs/gensparse_defconfig
===================================================================
--- usb-3.10.orig/arch/ia64/configs/gensparse_defconfig
+++ usb-3.10/arch/ia64/configs/gensparse_defconfig
@@ -115,7 +115,6 @@ CONFIG_SND_SEQ_DUMMY=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DUMMY=m
 CONFIG_SND_VIRMIDI=m
 CONFIG_SND_MTPAV=m
Index: usb-3.10/arch/mips/configs/pnx8335_stb225_defconfig
===================================================================
--- usb-3.10.orig/arch/mips/configs/pnx8335_stb225_defconfig
+++ usb-3.10/arch/mips/configs/pnx8335_stb225_defconfig
@@ -73,7 +73,6 @@ CONFIG_SND_SEQUENCER=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
 CONFIG_EXT2_FS=m
 # CONFIG_DNOTIFY is not set
Index: usb-3.10/arch/powerpc/configs/ppc6xx_defconfig
===================================================================
--- usb-3.10.orig/arch/powerpc/configs/ppc6xx_defconfig
+++ usb-3.10/arch/powerpc/configs/ppc6xx_defconfig
@@ -870,7 +870,6 @@ CONFIG_SND_PCM_OSS=m
 CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_DYNAMIC_MINORS=y
 # CONFIG_SND_SUPPORT_OLD_API is not set
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
 CONFIG_SND_DEBUG_VERBOSE=y
 CONFIG_SND_PCM_XRUN_DEBUG=y
Index: usb-3.10/arch/sh/configs/edosk7760_defconfig
===================================================================
--- usb-3.10.orig/arch/sh/configs/edosk7760_defconfig
+++ usb-3.10/arch/sh/configs/edosk7760_defconfig
@@ -90,7 +90,6 @@ CONFIG_SOUND=y
 CONFIG_SND=y
 # CONFIG_SND_SUPPORT_OLD_API is not set
 # CONFIG_SND_VERBOSE_PROCFS is not set
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_SOC=y
 # CONFIG_HID_SUPPORT is not set
 # CONFIG_USB_SUPPORT is not set
Index: usb-3.10/arch/sh/configs/sh7785lcr_32bit_defconfig
===================================================================
--- usb-3.10.orig/arch/sh/configs/sh7785lcr_32bit_defconfig
+++ usb-3.10/arch/sh/configs/sh7785lcr_32bit_defconfig
@@ -105,7 +105,6 @@ CONFIG_SND_HRTIMER=y
 CONFIG_SND_DYNAMIC_MINORS=y
 # CONFIG_SND_SUPPORT_OLD_API is not set
 # CONFIG_SND_VERBOSE_PROCFS is not set
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
 CONFIG_SND_DEBUG_VERBOSE=y
 # CONFIG_SND_DRIVERS is not set
Index: usb-3.10/include/sound/core.h
===================================================================
--- usb-3.10.orig/include/sound/core.h
+++ usb-3.10/include/sound/core.h
@@ -335,7 +335,7 @@ enum {
 	SND_PR_VERBOSE,
 };
 
-#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
+#if defined(CONFIG_SND_DEBUG)
 __printf(4, 5)
 void __snd_printk(unsigned int level, const char *file, int line,
 		  const char *format, ...);
@@ -349,7 +349,7 @@ void __snd_printk(unsigned int level, co
  * @fmt: format string
  *
  * Works like printk() but prints the file and the line of the caller
- * when configured with CONFIG_SND_VERBOSE_PRINTK.
+ * when configured with CONFIG_SND_DEBUG.
  */
 #define snd_printk(fmt, args...) \
 	__snd_printk(0, __FILE__, __LINE__, fmt, ##args)
Index: usb-3.10/sound/core/Kconfig
===================================================================
--- usb-3.10.orig/sound/core/Kconfig
+++ usb-3.10/sound/core/Kconfig
@@ -173,15 +173,6 @@ config SND_VERBOSE_PROCFS
           useful information to developers when a problem occurs).  On the
           other side, it makes the ALSA subsystem larger.
 
-config SND_VERBOSE_PRINTK
-	bool "Verbose printk"
-	help
-	  Say Y here to enable verbose log messages.  These messages
-	  will help to identify source file and position containing
-	  printed messages.
-
-	  You don't need this unless you're debugging ALSA.
-
 config SND_DEBUG
 	bool "Debug"
 	help
Index: usb-3.10/sound/core/misc.c
===================================================================
--- usb-3.10.orig/sound/core/misc.c
+++ usb-3.10/sound/core/misc.c
@@ -51,27 +51,11 @@ void release_and_free_resource(struct re
 
 EXPORT_SYMBOL(release_and_free_resource);
 
-#ifdef CONFIG_SND_VERBOSE_PRINTK
-/* strip the leading path if the given path is absolute */
-static const char *sanity_file_name(const char *path)
-{
-	if (*path == '/')
-		return strrchr(path, '/') + 1;
-	else
-		return path;
-}
-#endif
-
-#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
+#if defined(CONFIG_SND_DEBUG)
 void __snd_printk(unsigned int level, const char *path, int line,
 		  const char *format, ...)
 {
 	va_list args;
-#ifdef CONFIG_SND_VERBOSE_PRINTK
-	int kern_level;
-	struct va_format vaf;
-	char verbose_fmt[] = KERN_DEFAULT "ALSA %s:%d %pV";
-#endif
 
 #ifdef CONFIG_SND_DEBUG
 	if (debug < level)
@@ -79,22 +63,7 @@ void __snd_printk(unsigned int level, co
 #endif
 
 	va_start(args, format);
-#ifdef CONFIG_SND_VERBOSE_PRINTK
-	vaf.fmt = format;
-	vaf.va = &args;
-
-	kern_level = printk_get_level(format);
-	if (kern_level) {
-		const char *end_of_header = printk_skip_level(format);
-		memcpy(verbose_fmt, format, end_of_header - format);
-		vaf.fmt = end_of_header;
-	} else if (level)
-		memcpy(verbose_fmt, KERN_DEBUG, sizeof(KERN_DEBUG) - 1);
-	printk(verbose_fmt, sanity_file_name(path), line, &vaf);
-
-#else
 	vprintk(format, args);
-#endif
 	va_end(args);
 }
 EXPORT_SYMBOL_GPL(__snd_printk);
Index: usb-3.10/sound/pci/hda/hda_intel.c
===================================================================
--- usb-3.10.orig/sound/pci/hda/hda_intel.c
+++ usb-3.10/sound/pci/hda/hda_intel.c
@@ -189,11 +189,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},
 			 "{ULI, M5461}}");
 MODULE_DESCRIPTION("Intel HDA driver");
 
-#ifdef CONFIG_SND_VERBOSE_PRINTK
-#define SFX	/* nop */
-#else
 #define SFX	"hda-intel "
-#endif
 
 #if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO)
 #ifdef CONFIG_SND_HDA_CODEC_HDMI

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2013-06-07 16:10 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 20:18 [PATCH] ALSA: get rid of CONFIG_SND_VERBOSE_PRINTK Alan Stern
2013-06-03 20:24 ` Joe Perches
2013-06-03 20:40   ` Alan Stern
2013-06-03 20:49     ` Joe Perches
2013-06-04  9:13 ` Takashi Iwai
2013-06-04 14:49   ` Alan Stern
2013-06-04 15:03     ` Takashi Iwai
2013-06-04 17:20       ` [PATCH 1/2] ALSA: convert "snd_printk(KERN_INFO" to "pr_info(" Alan Stern
2013-06-05  5:52         ` Takashi Iwai
2013-06-05  6:07           ` Joe Perches
2013-06-05  6:16             ` Takashi Iwai
2013-06-06 20:54           ` Alan Stern
2013-06-07  5:41             ` Takashi Iwai
2013-06-07 15:51               ` Alan Stern
2013-06-04 17:20       ` [PATCH 2/2 v.2] ALSA: get rid of CONFIG_SND_VERBOSE_PRINTK Alan Stern
2013-06-04 19:32       ` [PATCH] " Alan Stern
2013-06-04 19:45         ` Joe Perches
2013-06-04 20:54           ` Alan Stern
2013-06-04 21:19             ` Joe Perches
2013-06-06 20:42               ` Alan Stern
2013-06-06 20:59                 ` Joe Perches
2013-06-07 14:40                   ` Alan Stern
2013-06-07 16:10                     ` Joe Perches
2013-06-05  6:04             ` Takashi Iwai
2013-06-05  6:15               ` Joe Perches
2013-06-05  6:32                 ` Takashi Iwai
2013-06-05  6:52                   ` Joe Perches
2013-06-05  6:54                     ` Takashi Iwai
2013-06-05  7:07                       ` Joe Perches
2013-06-05  7:22                         ` Takashi Iwai
2013-06-05  7:34                           ` Joe Perches
2013-06-05  7:47                             ` CONFIG_SND_DEBUG (was: Re: [alsa-devel] [PATCH] ALSA: get rid of CONFIG_SND_VERBOSE_PRINTK) David Henningsson
2013-06-05  8:46                               ` CONFIG_SND_DEBUG (was: " Takashi Iwai
2013-06-05 10:53                               ` CONFIG_SND_DEBUG (was: Re: [alsa-devel] " Andy Whitcroft
2013-06-05 11:38                                 ` CONFIG_SND_DEBUG David Henningsson
2013-06-05 11:43                                   ` CONFIG_SND_DEBUG Takashi Iwai
2013-06-05 14:11                                     ` CONFIG_SND_DEBUG Alan Stern
2013-06-05 14:28                                       ` CONFIG_SND_DEBUG Takashi Iwai
2013-06-05 14:47                                         ` CONFIG_SND_DEBUG Alan Stern
2013-06-06 21:28               ` [PATCH] ALSA: get rid of CONFIG_SND_VERBOSE_PRINTK Alan Stern
2013-06-06 21:50                 ` Joe Perches
2013-06-07  5:57                   ` Takashi Iwai
2013-06-07 15:34                     ` Alan Stern
2013-06-07  5:53                 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.