Re: mptbase: fix printk output using pr_cont

From: Joe Perches
Date: Fri Nov 25 2016 - 06:34:38 EST


On Fri, 2016-11-25 at 01:02 +0000, Jongman Heo wrote:
> With current linus git, Fusion MPT driver prints out unnecessary new lines.
>
> [ 2.090255] Fusion MPT base driver 3.04.20
> [ 2.090257] Copyright (c) 1999-2008 LSI Corporation
> [ 2.090262] Fusion MPT SPI Host driver 3.04.20
> [ 2.090979] mptbase: ioc0: Initiating bringup
> [ 2.196306] ioc0:
> [ 2.196310] LSI53C1030 B0:
> [ 2.196312] Capabilities={
> [ 2.196313] Initiator
> [ 2.196314] }
>
>
> I modified set of printk()s to pr_cont to fix the problem.
> Not sure if it's correct, but now I can see the message as previous.
[]
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
[]
> @@ -2866,23 +2866,23 @@ MptDisplayIocCapabilities(MPT_ADAPTER *ioc)
> {
> int i = 0;
>
> - printk(KERN_INFO "%s: ", ioc->name);
> + pr_cont(KERN_INFO "%s: ", ioc->name);

This is not s correct conversion.
This can either stay as printk(KERN_INFO
or be converted to pr_info

pr_info("%s: ", ioc->name);