Re: [PATCH v17 2/3] vfio/pci: rename and export range_intesect_range

From: Ankit Agrawal
Date: Thu Feb 08 2024 - 01:43:16 EST


Thanks Kevin.

>> range_intesect_range determines an overlap between two ranges. If an
>
> s/intesect/intersect/

Will fix the typo.

>> + * vfio_pci_core_range_intersect_range() - Determine overlap between a
>> buffer
>> + *                                      and register offset ranges.
>> + * @range1_start:    start offset of the buffer
>> + * @count1:       number of buffer bytes.
>> + * @range2_start:    start register offset
>> + * @count2:       number of bytes of register
>> + * @start_offset:    start offset of overlap start in the buffer
>> + * @intersect_count: number of overlapping bytes
>> + * @register_offset: start offset of overlap start in register
>> + *
>> + * The function determines an overlap between a register and a buffer.
>> + * range1 represents the buffer and range2 represents register.
>> + *
>> + * Returns: true if there is overlap, false if not.
>> + * The overlap start and range is returned through function args.
>> + */
>> +bool vfio_pci_core_range_intersect_range(loff_t range1_start, size_t count1,
>> +                                      loff_t range2_start, size_t count2,
>> +                                      loff_t *start_offset,
>> +                                      size_t *intersect_count,
>> +                                      size_t *register_offset)
>
> based on description it's probably clearer to rename:
>
> range1_start -> buf_start
> count1 -> buf_cnt
> range2_start -> reg_start
> count2 -> reg_cnt
> start_offset -> buf_offset
>
> but not big deal, so:

Fine by me. Will rename them.

> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>

Thanks!