Re: [PATCH v22] edac, ras/hw_event.h: use events to handle hw issues

From: Steven Rostedt
Date: Wed May 16 2012 - 13:05:14 EST


On Wed, 2012-05-16 at 12:24 -0300, Mauro Carvalho Chehab wrote:

> > Here's another trick if you want to get rid of the space and keep both
> > fields:
> >
> > TP_printk("%s error:%s on memory stick \"%s\" (mc:%d %s %s%s%s)",
> > (__entry->err_type == HW_EVENT_ERR_CORRECTED) ? "Corrected" :
> > ((__entry->err_type == HW_EVENT_ERR_FATAL) ?
> > "Fatal" : "Uncorrected"),
> >
> > __get_str(msg),
> > __get_str(label),
> > __entry->mc_index,
> > __get_str(location),
> > __get_str(detail),
> > strlen(__get_str(detail)) &&
> > strlen(__get_str(driver_detail) ? " ": "",
> > __get_str(driver_detail))
>
> Great! I'll use that trick, thanks!

strlen() may be too overblown. The following should work and is more
efficient:

(((char *)__get_str(detail))[0] &&
((char *)__get_str(driver_detail))[0]) ? " " : "",

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/