Re: [PATCH -next] staging/cxt1e1: Convert bare printks to pr_<level>

Previous thread: [PATCH 1/2] mfd: add TC35892 MFD core by Rabin Vincent on Sunday, May 2, 2010 - 8:15 pm. (1 message)

Next thread: [PATCH 1/1] drivers: misc: pass miscdevice pointer via file private data by Samu Onkalo on Sunday, May 2, 2010 - 10:31 pm. (1 message)
From: Stephen Rothwell
Date: Sunday, May 2, 2010 - 10:16 pm

Hi all,

Changes since 20100430:

Dropped trees: tmio-mmc (long unresolved conflicts and unable to fetch)
	hwlat (at the maintainer's request)

My fixes tree is empty.

The usb.current tree lost its conflict.

The v4l-dvb tree still has its build failure, so I used the version from
next-20100409.

The net tree gained a build failure so I used the version from
next-20100430.

The bk-ioctl tree lost its build failure and 2 conflicts.

The driver-core tree gained a build failure for which I applied a patch.

The usb tree lost two of its build failures bit still has one more for
which I have reverted a commit.

----------------------------------------------------------------------------

I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ).  If you
are tracking the linux-next tree using git, you should not use &quot;git pull&quot;
to do so as that will try to merge the new linux-next release with the
old one.  You should use &quot;git fetch&quot; as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.

Below is a summary of the state of the merge.

We are up to 162 trees (counting Linus' and 22 trees of patches pending
for Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, ...
From: Randy Dunlap
Date: Monday, May 3, 2010 - 10:07 am

From: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;

Fix mos7720 Kconfig dependencies.
When an enabled bool selects a tristate, the tristate becomes =y,
even if it should be limited to modular, so limit the bool kconfig
option to configs that will build cleanly.
Also change the if-block to a simple depends on.

drivers/built-in.o: In function `mos7720_release':
mos7720.c:(.text+0xad432): undefined reference to `parport_remove_port'
drivers/built-in.o: In function `mos7715_parport_init':
mos7720.c:(.text+0xae197): undefined reference to `parport_register_port'
mos7720.c:(.text+0xae210): undefined reference to `parport_announce_port'
drivers/built-in.o:(.data+0x201c8): undefined reference to `parport_ieee1284_read_nibble'
drivers/built-in.o:(.data+0x201d0): undefined reference to `parport_ieee1284_read_byte'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
---
 drivers/usb/serial/Kconfig |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- linux-next-20100503.orig/drivers/usb/serial/Kconfig
+++ linux-next-20100503/drivers/usb/serial/Kconfig
@@ -425,16 +425,15 @@ config USB_SERIAL_MOS7720
 	  To compile this driver as a module, choose M here: the
 	  module will be called mos7720.
 
-if USB_SERIAL_MOS7720
 config USB_SERIAL_MOS7715_PARPORT
 	bool &quot;Support for parallel port on the Moschip 7715&quot;
+	depends on USB_SERIAL_MOS7720
+	depends on PARPORT=y || PARPORT=USB_SERIAL_MOS7720
 	select PARPORT_NOT_PC
-	depends on PARPORT
 	---help---
 	Say Y if you have a Moschip 7715 device and would like to use
 	the parallel port it provides.  The port will register with
 	the parport subsystem as a low-level driver.
-endif
 
 config USB_SERIAL_MOS7840
 	tristate &quot;USB Moschip 7840/7820 USB Serial Driver&quot;
--

From: Randy Dunlap
Date: Monday, May 3, 2010 - 10:06 am

From: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;

Fix printk format warning in block_io.c:

kernel/power/block_io.c:41: warning: format '%ld' expects type 'long int', but argument 2 has type 'sector_t'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: &quot;Rafael J. Wysocki&quot; &lt;rjw@sisk.pl&gt;
---
 kernel/power/block_io.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20100503.orig/kernel/power/block_io.c
+++ linux-next-20100503/kernel/power/block_io.c
@@ -37,8 +37,8 @@ static int submit(int rw, struct block_d
 	bio-&gt;bi_end_io = end_swap_bio_read;
 
 	if (bio_add_page(bio, page, PAGE_SIZE, 0) &lt; PAGE_SIZE) {
-		printk(KERN_ERR &quot;PM: Adding page to bio failed at %ld\n&quot;,
-			sector);
+		printk(KERN_ERR &quot;PM: Adding page to bio failed at %llu\n&quot;,
+			(unsigned long long)sector);
 		bio_put(bio);
 		return -EFAULT;
 	}
--

From: Rafael J. Wysocki
Date: Monday, May 3, 2010 - 3:00 pm

Applied to suspend-2.6/linux-next.

Thanks,

--

From: Randy Dunlap
Date: Monday, May 3, 2010 - 10:09 am

From: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;

Lots of cxt1e1 source code uses THIS_MODULE-&gt;name, which won't build
when CONFIG_MODULES is not enabled, so use KBUILD_MODNAME instead.

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: support@sbei.com
Cc: support@onestopsystems.com
---
 drivers/staging/cxt1e1/hwprobe.c   |    9 +++++----
 drivers/staging/cxt1e1/linux.c     |   16 ++++++++--------
 drivers/staging/cxt1e1/musycc.c    |    4 ++--
 drivers/staging/cxt1e1/pmcc4_drv.c |   13 ++++++++-----
 drivers/staging/cxt1e1/sbeproc.c   |    4 ++--
 5 files changed, 25 insertions(+), 21 deletions(-)

--- linux-next-20100503.orig/drivers/staging/cxt1e1/musycc.c
+++ linux-next-20100503/drivers/staging/cxt1e1/musycc.c
@@ -960,13 +960,13 @@ musycc_init (ci_t * ci)
     if (max_mru &gt; 0xffe)
     {
         printk (KERN_WARNING &quot;%s: Maximum allowed MRU exceeded, resetting %d to %d.\n&quot;,
-                THIS_MODULE-&gt;name, max_mru, 0xffe);
+                KBUILD_MODNAME, max_mru, 0xffe);
         max_mru = 0xffe;
     }
     if (max_mtu &gt; 0xffe)
     {
         printk (KERN_WARNING &quot;%s: Maximum allowed MTU exceeded, resetting %d to %d.\n&quot;,
-                THIS_MODULE-&gt;name, max_mtu, 0xffe);
+                KBUILD_MODNAME, max_mtu, 0xffe);
         max_mtu = 0xffe;
     }
 #ifdef SBE_WAN256T3_ENABLE
--- linux-next-20100503.orig/drivers/staging/cxt1e1/pmcc4_drv.c
+++ linux-next-20100503/drivers/staging/cxt1e1/pmcc4_drv.c
@@ -171,10 +171,11 @@ sbecom_set_loglevel (int d)
     {
         if (log_level != d)
         {
-            printk (&quot;%s: log level changed from %d to %d\n&quot;, THIS_MODULE-&gt;name, log_level, d);
+            printk (&quot;%s: log level changed from %d to %d\n&quot;,
+		KBUILD_MODNAME, log_level, d);
             log_level = d;          /* set new */
         } else
-            printk (&quot;%s: log level is %d\n&quot;, THIS_MODULE-&gt;name, log_level);
+            printk (&quot;%s: log level is %d\n&quot;, KBUILD_MODNAME, log_level);
     }
 }
 
@@ -221,7 +222,7 @@ c4_new (void ...
From: Joe Perches
Date: Monday, May 3, 2010 - 11:02 am

Perhaps a conversion to pr_&lt;level&gt; is better?

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
---
 drivers/staging/cxt1e1/functions.c           |    4 ++-
 drivers/staging/cxt1e1/hwprobe.c             |   28 ++++++++++---------
 drivers/staging/cxt1e1/linux.c               |   38 +++++++++++++-------------
 drivers/staging/cxt1e1/musycc.c              |   13 +++++----
 drivers/staging/cxt1e1/pmcc4_drv.c           |   16 ++++++-----
 drivers/staging/cxt1e1/sbecom_inline_linux.h |    2 +-
 drivers/staging/cxt1e1/sbeproc.c             |    8 +++---
 7 files changed, 58 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/cxt1e1/functions.c b/drivers/staging/cxt1e1/functions.c
index c95c62d..738129d 100644
--- a/drivers/staging/cxt1e1/functions.c
+++ b/drivers/staging/cxt1e1/functions.c
@@ -11,6 +11,8 @@
  *   GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME &quot;: &quot; fmt
+
 #include &lt;linux/slab.h&gt;
 #include &lt;asm/io.h&gt;
 #include &lt;asm/byteorder.h&gt;
@@ -117,7 +119,7 @@ watchdog_func (unsigned long arg)
     if (drvr_state != SBE_DRVR_AVAILABLE)
     {
         if (log_level &gt;= LOG_MONITOR)
-            printk (KERN_WARNING &quot;watchdog_func: drvr not available (%x)\n&quot;, drvr_state);
+            pr_warning(&quot;%s: drvr not available (%x)\n&quot;, __func__, drvr_state);
         return;
     }
 #if LINUX_VERSION_CODE &lt; KERNEL_VERSION(2,5,0)
diff --git a/drivers/staging/cxt1e1/hwprobe.c b/drivers/staging/cxt1e1/hwprobe.c
index 0f9d653..571fa1f 100644
--- a/drivers/staging/cxt1e1/hwprobe.c
+++ b/drivers/staging/cxt1e1/hwprobe.c
@@ -12,6 +12,8 @@
  *   GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME &quot;: &quot; fmt
+
 #include &lt;linux/netdevice.h&gt;
 #include &lt;linux/hdlc.h&gt;
 #include &lt;linux/if_arp.h&gt;
@@ -230,7 +232,7 @@ c4_hdw_init (struct pci_dev * pdev, int found)
     /* our MUSYCC chip supports two functions, 0 &amp; 1 */
     if ((fun = PCI_FUNC (pdev-&gt;devfn)) &gt; 1)
     {
-        printk (KERN_WARNING &quot;%s: ...
From: Randy Dunlap
Date: Monday, May 3, 2010 - 11:06 am

Sure, fine with me.  Thanks.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--

From: Joe Perches
Date: Monday, May 3, 2010 - 12:33 pm

Added #define pr_fmt(fmt) KBUILD_MODNAME &quot;: &quot; fmt
A few line splits for long arguments
A couple of embedded function names converted to &quot;%s&quot;, __func__
Removed some uses of THIS_MODULE-&gt;name
 
Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
---
 drivers/staging/cxt1e1/comet.c               |    8 +-
 drivers/staging/cxt1e1/functions.c           |    4 +-
 drivers/staging/cxt1e1/hwprobe.c             |   22 ++--
 drivers/staging/cxt1e1/linux.c               |   28 ++--
 drivers/staging/cxt1e1/musycc.c              |  128 +++++++++---------
 drivers/staging/cxt1e1/pmc93x6_eeprom.c      |   12 +-
 drivers/staging/cxt1e1/pmcc4_drv.c           |  183 +++++++++++++-------------
 drivers/staging/cxt1e1/sbecom_inline_linux.h |    4 +-
 drivers/staging/cxt1e1/sbeproc.c             |    6 +-
 9 files changed, 204 insertions(+), 191 deletions(-)

diff --git a/drivers/staging/cxt1e1/comet.c b/drivers/staging/cxt1e1/comet.c
index b709099..dcbe6b6 100644
--- a/drivers/staging/cxt1e1/comet.c
+++ b/drivers/staging/cxt1e1/comet.c
@@ -11,6 +11,8 @@
  *   GNU General Public License for more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME &quot;: &quot; fmt
+
 #include &lt;asm/io.h&gt;
 #include &lt;linux/hdlc.h&gt;
 #include &quot;pmcc4_sysdep.h&quot;
@@ -291,12 +293,12 @@ init_comet (void *ci, comet_t * comet, u_int32_t port_mode, int clockmaster,
         if ((moreParams &amp; CFG_CLK_PORT_MASK) == CFG_CLK_PORT_INTERNAL)
         {
             if (log_level &gt;= LOG_SBEBUG12)
-                printk (&quot;&gt;&gt; init_comet: clockmaster internal clock\n&quot;);
+                pr_info(&quot;&gt;&gt; %s: clockmaster internal clock\n&quot;, __func__);
             pci_write_32 ((u_int32_t *) &amp;comet-&gt;tx_time, 0x0d); /* internal oscillator */
         } else                      /* external clock source */
         {
             if (log_level &gt;= LOG_SBEBUG12)
-                printk (&quot;&gt;&gt; init_comet: clockmaster external clock\n&quot;);
+                pr_info(&quot;&gt;&gt; %s: clockmaster external clock\n&quot;, __func__);
             pci_write_32 ((u_int32_t *) ...
From: Peter =?iso-8859-1?q?H=FCwe?=
Date: Wednesday, May 5, 2010 - 5:21 am

Hi, 
I applied Joe's patch, but unfortunately it misses out one part of Randy's 
original patch, i.e. the conversion in line 286 of hwprobe.c.

Joe: Can you perhaps add this to your patch?

Thanks, 
Peter

Signed-off-by: Peter Huewe &lt;peterhuewe@gmx.de&gt;
---
Copied from original Patch by Randy dunlap

--- linux-next-20100503.orig/drivers/staging/cxt1e1/hwprobe.c
+++ linux-next-20100503/drivers/staging/cxt1e1/hwprobe.c
@@ -282,7 +283,7 @@ c4_hdw_init (struct pci_dev * pdev, int 
          */
         char       *cp = hi-&gt;devname;
 
-        strcpy (cp, THIS_MODULE-&gt;name);
+        strcpy (cp, KBUILD_MODNAME);
         cp += strlen (cp);          /* reposition */
         *cp++ = '-';
         *cp++ = '0' + (found / 2);  /* there are two found interfaces per





--

From: Greg KH
Date: Wednesday, May 5, 2010 - 9:21 am

I've already applied Joe's patch, so I'll queue up yours as well.

thanks,

greg k-h
--

Previous thread: [PATCH 1/2] mfd: add TC35892 MFD core by Rabin Vincent on Sunday, May 2, 2010 - 8:15 pm. (1 message)

Next thread: [PATCH 1/1] drivers: misc: pass miscdevice pointer via file private data by Samu Onkalo on Sunday, May 2, 2010 - 10:31 pm. (1 message)