On 08/31/2017 08:27 PM, Philippe Mathieu-Daudé wrote:
> On 08/31/2017 09:14 PM, John Snow wrote:
>> Signed-off-by: John Snow <js...@redhat.com>
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>
> 

TY, and btw the reasoning behind what I went with:

Since s->dma_cmd is itself a type `enum ide_dma_cmd` then by definition
s->dma_cmd (even if corrupted or wrong) must fit inside the width of
that type. Performing the range checking in the getter is adequate for
protecting the table in this case, if I understand Laszlo's rationales
correctly.

In case case of the AHCI table, I do not use a getter since the IRQBIT
property is passed in statically for each instance and shouldn't have a
chance to get out-of-spec. (If it does, something MASSIVELY bad has
corrupted everything, and then we've got worse problems.)

Thanks,
John

Reply via email to