Re: [PATCH 1/2] OMAP2+: IOMMU: change OMAP2+ error message to dev_dbg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 15, 2011 at 4:44 PM, Russell King - ARM Linux
<linux@xxxxxxxxxxxxxxxx> wrote:
> On Tue, Feb 15, 2011 at 04:36:26PM +0200, David Cohen wrote:
>> But pr_cont() would be wrong in case of DEBUG isn't set, isn't it?
>
> Yes. ÂOne other solution you could do is:
>
> Â Â Â Âchar buf[80], *p = buf;
>
> Â Â Â Âbuf[0] = '\0';
> Â Â Â Âfor (i = 0; i < ARRAY_SIZE(err_msg); i++)
> Â Â Â Â Â Â Â Âif (stat & (1 << i))
> Â Â Â Â Â Â Â Â Â Â Â Âp += scnprintf(p, sizeof(buf) - (p - buf),
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â" %s", err_msg[i]);
>
> Â Â Â Âdev_dbg(obj->dev, "%s: da:%08x%s\n", __func__, da, buf);
>
> which means that you're then printing the entire string in one go -
> and there's no chance for another message to come in the middle of it.
>
> Note that I've placed the ' ' at the beginning of the format string so
> that we don't end up with useless trailing space in messages. ÂMinor
> point but it's easy to do here.

That could be my choice.
I'm not planing to resend this patch, but how good/bad it sounds to
you to have dev_dbg_cont() for such situation?

Br,

David
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux