Skip to content

Commit

Permalink
KVM: s390: add __must_check to interrupt deliver functions
Browse files Browse the repository at this point in the history
We now propagate interrupt injection errors back to the ioctl. We
should mark functions that might fail with __must_check.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
  • Loading branch information
Christian Borntraeger committed Sep 10, 2014
1 parent 5102ee8 commit 614aeab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions arch/s390/kvm/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define IOINT_AI_MASK 0x04000000
#define PFAULT_INIT 0x0600

static int deliver_ckc_interrupt(struct kvm_vcpu *vcpu);
static int __must_check deliver_ckc_interrupt(struct kvm_vcpu *vcpu);

static int is_ioint(u64 type)
{
Expand Down Expand Up @@ -77,7 +77,7 @@ static u64 int_word_to_isc_bits(u32 int_word)
return (0x80 >> isc) << 24;
}

static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
static int __must_check __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
struct kvm_s390_interrupt_info *inti)
{
switch (inti->type) {
Expand Down Expand Up @@ -225,7 +225,7 @@ static u16 get_ilc(struct kvm_vcpu *vcpu)
}
}

static int __deliver_prog_irq(struct kvm_vcpu *vcpu,
static int __must_check __deliver_prog_irq(struct kvm_vcpu *vcpu,
struct kvm_s390_pgm_info *pgm_info)
{
int rc = 0;
Expand Down Expand Up @@ -307,7 +307,7 @@ static int __deliver_prog_irq(struct kvm_vcpu *vcpu,
return rc;
}

static int __do_deliver_interrupt(struct kvm_vcpu *vcpu,
static int __must_check __do_deliver_interrupt(struct kvm_vcpu *vcpu,
struct kvm_s390_interrupt_info *inti)
{
const unsigned short table[] = { 2, 4, 4, 6 };
Expand Down Expand Up @@ -508,7 +508,7 @@ static int __do_deliver_interrupt(struct kvm_vcpu *vcpu,
return rc;
}

static int deliver_ckc_interrupt(struct kvm_vcpu *vcpu)
static int __must_check deliver_ckc_interrupt(struct kvm_vcpu *vcpu)
{
int rc;

Expand Down Expand Up @@ -657,7 +657,7 @@ void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu)
&vcpu->kvm->arch.sca->cpu[vcpu->vcpu_id].ctrl);
}

int kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
{
struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
struct kvm_s390_float_interrupt *fi = vcpu->arch.local_int.float_int;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kvm/kvm-s390.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static inline int kvm_s390_user_cpu_state_ctrl(struct kvm *kvm)
int kvm_s390_handle_wait(struct kvm_vcpu *vcpu);
void kvm_s390_vcpu_wakeup(struct kvm_vcpu *vcpu);
enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);
int kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu);
int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu);
void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu);
void kvm_s390_clear_float_irqs(struct kvm *kvm);
int __must_check kvm_s390_inject_vm(struct kvm *kvm,
Expand Down

0 comments on commit 614aeab

Please sign in to comment.