RE: [PATCH] power: introduce library for device-specific OPPs

From: Menon, Nishanth
Date: Thu Oct 07 2010 - 18:16:16 EST


> -----Original Message-----
> From: Kevin Hilman [mailto:khilman@xxxxxxxxxxxxxxxxxxx]
> Sent: Thursday, October 07, 2010 5:14 PM
> To: Menon, Nishanth
> Cc: Rafael J. Wysocki; linux-pm; lkml; l-o; l-a; Paul
> Subject: Re: [PATCH] power: introduce library for device-specific OPPs
>
[...]
> >> > +static int opp_set_availability(struct device *dev, unsigned long
> freq,
> >> > + bool availability_req)
> >> > +{
> >> > + struct device_opp *tmp_dev_opp, *dev_opp = NULL;
> >> > + struct opp *new_opp, *tmp_opp, *opp = ERR_PTR(-ENODEV);
> >> > + int r = 0;
> >> > +
> >> > + /* keep the node allocated */
> >> > + new_opp = kmalloc(sizeof(struct opp), GFP_KERNEL);
> >> > + if (!new_opp) {
> >> > + pr_warning("Unable to allocate opp\n");
> >>
> >> Please add an identification string to the messages, something like
> >> "OPP: Unable to allocat object\n" (and similarly in the other messages).
> >> That would help to find the source of a message in case there's any
> >> problem.
> >
> > pr_fmt has been reformatted for this. The actual message which will
> appear
> > is as follows:
> > opp_set_availability: Unable to allocate opp
> >
> > is'nt that good enough considering that all functions are opp_ prefixed?
> > I can modify pr_fmt to add "OPP:" but I kinda think it is redundant. But
> I
> > have no strong opinions on that and look forward to your recommendations.
>
> Even more informative would be to use dev_warn() and include the func.
> That way we'll even know which device has the problem.
Ack. Thanks. Yeah, this is better.. will do the change.

Regards,
Nishanth Menon
--
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/