On Tue, Feb 15, 2011 at 4:44 PM, Russell King - ARM Linux <li...@arm.linux.org.uk> 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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html