>>> On 01.04.17 at 15:53, <yi.y....@linux.intel.com> wrote:
> --- a/xen/arch/x86/psr.c
> +++ b/xen/arch/x86/psr.c
> @@ -800,15 +800,82 @@ static int find_cos(const uint32_t val[], unsigned int 
> array_len,
>      return -ENOENT;
>  }
>  
> +static bool fits_cos_max(const uint32_t val[],
> +                         uint32_t array_len,
> +                         const struct psr_socket_info *info,
> +                         unsigned int cos)
> +{
> +    unsigned int i;
> +
> +    for ( i = 0; i < PSR_SOCKET_MAX_FEAT; i++ )
> +    {
> +        uint32_t default_val = 0;

Move this into the most narrow scope it's needed in, which will make
pretty clear that the initializer again isn't needed.

> +        const struct feat_node *feat = info->features[i];
> +        if ( !feat )
> +            continue;
> +
> +        if ( array_len < feat->props->cos_num )
> +            return false;
> +
> +        if ( cos > feat->props->cos_max )
> +        {
> +            feat->props->get_val(feat, 0, &default_val);
> +            if ( val[0] != default_val )

Same question as before.

Jan


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

Reply via email to