diff options
author | Janosch Frank <frankja@linux.ibm.com> | 2020-03-10 05:09:50 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2020-03-10 10:18:20 +0100 |
commit | 94c21436e5a89143f8b9cb4d089d1a2f3f4fd377 (patch) | |
tree | 6c356ce06d87f81ea44a1596175bf8f1724dfc6d /hw/s390x | |
parent | 0a01e082a428b921e48b5314881b1f23a7b0fe50 (diff) |
s390x: ipl: Consolidate iplb validity check into one function
It's nicer to just call one function than calling a function for each
possible iplb type.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20200310090950.61172-1-frankja@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r-- | hw/s390x/ipl.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index d4813105db..3e44abe1c6 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -173,16 +173,16 @@ static inline bool iplb_valid_len(IplParameterBlock *iplb) return be32_to_cpu(iplb->len) <= sizeof(IplParameterBlock); } -static inline bool iplb_valid_ccw(IplParameterBlock *iplb) +static inline bool iplb_valid(IplParameterBlock *iplb) { - return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN && - iplb->pbt == S390_IPL_TYPE_CCW; -} - -static inline bool iplb_valid_fcp(IplParameterBlock *iplb) -{ - return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN && - iplb->pbt == S390_IPL_TYPE_FCP; + switch (iplb->pbt) { + case S390_IPL_TYPE_FCP: + return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN; + case S390_IPL_TYPE_CCW: + return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN; + default: + return false; + } } #endif |