Re: [PATCH v3] PM / OPP: discard duplicate OPPs

From: Viresh Kumar
Date: Tue May 20 2014 - 00:00:12 EST


On 19 May 2014 18:38, Nishanth Menon <nm@xxxxxx> wrote:

>> + if (new_opp->rate == opp->rate) {
>> + mutex_unlock(&dev_opp_list_lock);
>> + kfree(new_opp);
>> + return 0;
>
> IF we decide on ensuring that the OPP additions are done one time[1] -

Fingers crossed :)

But that doesn't mean we covered everything. First of all platforms can
still add OPPs directly and then there are other OPPs than CPU's.

> then returning -EEXIST is appropriate here. we want to be able to
> catch warnings of sequencing errors, and returning 0 is not the way to
> do it.

I have asked this on the earlier thread as well, let me ask it again.
What would callers do on return value of EEXIST ? Is there anything
special we may want to handle ?

Yes, we shouldn't fix everything silently and so a pr_warn() can/should
be added here. But returning is zero is better in order not to complicate
error handling at callers side.

Isn't it ?
--
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/