hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/s390/char/sclp_pci.c
....@@ -24,6 +24,7 @@
2424
2525 #define SCLP_ATYPE_PCI 2
2626
27
+#define SCLP_ERRNOTIFY_AQ_RESET 0
2728 #define SCLP_ERRNOTIFY_AQ_REPAIR 1
2829 #define SCLP_ERRNOTIFY_AQ_INFO_LOG 2
2930
....@@ -38,7 +39,7 @@
3839 u8 atype;
3940 u32 fh;
4041 u32 fid;
41
- u8 data[0];
42
+ u8 data[];
4243 } __packed;
4344
4445 struct err_notify_sccb {
....@@ -111,9 +112,14 @@
111112 if (report->version != 1)
112113 return -EINVAL;
113114
114
- if (report->action != SCLP_ERRNOTIFY_AQ_REPAIR &&
115
- report->action != SCLP_ERRNOTIFY_AQ_INFO_LOG)
115
+ switch (report->action) {
116
+ case SCLP_ERRNOTIFY_AQ_RESET:
117
+ case SCLP_ERRNOTIFY_AQ_REPAIR:
118
+ case SCLP_ERRNOTIFY_AQ_INFO_LOG:
119
+ break;
120
+ default:
116121 return -EINVAL;
122
+ }
117123
118124 if (report->length > (PAGE_SIZE - sizeof(struct err_notify_sccb)))
119125 return -EINVAL;