lkml.org 
[lkml]   [2018]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V6 07/38] x86/intel_rdt: Initialize new resource group with sane defaults
On Thu, 7 Jun 2018, Reinette Chatre wrote:
> +/**
> + * cbm_ensure_valid - Enforce validity on provided CBM
> + * @_val: Candidate CBM
> + * @r: RDT resource to which the CBM belongs
> + *
> + * The provided CBM represents all cache portions available for use. This
> + * may be represented by a bitmap that does not consist of contiguous ones
> + * and thus be an invalid CBM.
> + * Here the provided CBM is forced to be a valid CBM by only considering
> + * the first set of contiguous bits as valid and clearing all bits.
> + * The intention here is to provide a valid default CBM with which a new
> + * resource group is initialized. The user can follow this with a
> + * modification to the CBM if the default does not satisfy the
> + * requirements.
> + */
> +static void cbm_ensure_valid(u32 *_val, struct rdt_resource *r)
> +{
> + unsigned long *val = (unsigned long *)_val;

I'm a bit worried about the u32 to unsigned long case here. I know that
cbm_len cannot exceed 32, but still. At least it wants a comment.

Thanks,

tglx


\
 
 \ /
  Last update: 2018-06-19 14:32    [W:0.046 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site