Re: [PATCH] IB/ocrdma: pr_err() strings should end with newlines

From: Joe Perches
Date: Tue Sep 26 2017 - 11:23:16 EST


On Tue, 2017-09-26 at 10:19 +0300, Yuval Shaia wrote:
> On Tue, Sep 26, 2017 at 12:21:44PM +0530, Arvind Yadav wrote:
> > pr_err() messages should end with a new-line to avoid other messages
> > being concatenated.
[]
> > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_stats.c b/drivers/infiniband/hw/ocrdma/ocrdma_stats.c
[]
> > @@ -658,7 +658,7 @@ static ssize_t ocrdma_dbgfs_ops_write(struct file *filp,
> > if (reset) {
> > status = ocrdma_mbx_rdma_stats(dev, true);
> > if (status) {
> > - pr_err("Failed to reset stats = %d", status);
> > + pr_err("Failed to reset stats = %d\n", status);
> > goto err;
> > }
> > }
>
> While there, can you also fix line 1096 in ocrdma_hw.c?
>
> (is it too naive to expect checkptahc to catch such errors?)

Yes. It is not reasonable.

There would be way too high a false positive rate
as checkpatch could not trace whether or not there
is a printk(KERN_CONT or pr_cont after that.