Re: [PATCH 1/1] KVM: s390: mark irq_state.flags as non-usable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21.11.2017 18:42, Christian Borntraeger wrote:
> 
> 
> On 11/21/2017 04:18 PM, David Hildenbrand wrote:
>> On 21.11.2017 16:08, Christian Borntraeger wrote:
>>> Old kernels did not check for zero in the irq_state.flags field and old
>>> QEMUs did not zero the flag field when calling KVM_S390_*_IRQ_STATE.
>>> Let's add a comment and dummy code to prevent future usage of flags
>>> and pad.
>>>
>>> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
>>> ---
>>>  arch/s390/kvm/kvm-s390.c | 14 ++++++++++++++
>>>  1 file changed, 14 insertions(+)
>>>
>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>> index 6a5e02f..1baa393 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -3834,6 +3834,16 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>>>  			r = -EINVAL;
>>>  			break;
>>>  		}
>>> +		if (irq_state.flags) {
>>
>> I don't see the need for if (do I need more coffee?).
> 
> It is a dummy construct that matches other checks like "if flags return -EINVAL". But since
> it is dummy we can do whatever we want (even just a comment) since nobody reads flags as of
> today.

Not sure if changing the code here really makes sense ... I think I'd
rather prefer to add a comment to the header where the struct is
defined, and add some proper sentences about "flags" to the api.txt file.

 Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux