>>> Yi Sun <yi.y....@linux.intel.com> 06/30/17 10:56 AM >>>
>On 17-06-30 15:22:56, Yi Sun wrote:
>> On 17-06-30 00:42:22, Jan Beulich wrote:
>> > >          {
>> > >              val[i] = new_val;
>> > > -            return 0;
>> > > +            ret = 0;
>> > >          }
>> > 
>> > Wouldn't it be better to return -EINVAL in a to be added else branch here
>> > and ...
>> > 
>After reading codes again, I think we cannot return -EINVAL in else branch 
>here.
>E.g. for CDP, user wants to set CODE. Then, the 'type' is CODE. At the first
>iteration, the props->type[0] is DATA which does not match 'type'. But we 
>cannot
>return error here. We should iterate next 'type[]'.

But that's why you're adding the second check in the if(). If neither of the two
conditions are true, this is an error, isn't it? On the converse, why would you
return 0 if the first loop iteration is fine but the second isn't.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to