Merge tag 'firewire-updates-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394

Pull firewire update from Takashi Sakamoto:
"A single commit to use the common helper function for on-stack
trailing array to enqueue any isochronous packet by the requests
from userspace applications"

* tag 'firewire-updates-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
firewire: core: avoid -Wflex-array-member-not-at-end warning

+19 -23
+19 -23
drivers/firewire/core-cdev.c
··· 1137 1137 unsigned long payload, buffer_end, transmit_header_bytes = 0; 1138 1138 u32 control; 1139 1139 int count; 1140 - struct { 1141 - struct fw_iso_packet packet; 1142 - u8 header[256]; 1143 - } u; 1140 + DEFINE_RAW_FLEX(struct fw_iso_packet, u, header, 64); 1144 1141 1145 1142 if (ctx == NULL || a->handle != 0) 1146 1143 return -EINVAL; ··· 1169 1172 while (p < end) { 1170 1173 if (get_user(control, &p->control)) 1171 1174 return -EFAULT; 1172 - u.packet.payload_length = GET_PAYLOAD_LENGTH(control); 1173 - u.packet.interrupt = GET_INTERRUPT(control); 1174 - u.packet.skip = GET_SKIP(control); 1175 - u.packet.tag = GET_TAG(control); 1176 - u.packet.sy = GET_SY(control); 1177 - u.packet.header_length = GET_HEADER_LENGTH(control); 1175 + u->payload_length = GET_PAYLOAD_LENGTH(control); 1176 + u->interrupt = GET_INTERRUPT(control); 1177 + u->skip = GET_SKIP(control); 1178 + u->tag = GET_TAG(control); 1179 + u->sy = GET_SY(control); 1180 + u->header_length = GET_HEADER_LENGTH(control); 1178 1181 1179 1182 switch (ctx->type) { 1180 1183 case FW_ISO_CONTEXT_TRANSMIT: 1181 - if (u.packet.header_length & 3) 1184 + if (u->header_length & 3) 1182 1185 return -EINVAL; 1183 - transmit_header_bytes = u.packet.header_length; 1186 + transmit_header_bytes = u->header_length; 1184 1187 break; 1185 1188 1186 1189 case FW_ISO_CONTEXT_RECEIVE: 1187 - if (u.packet.header_length == 0 || 1188 - u.packet.header_length % ctx->header_size != 0) 1190 + if (u->header_length == 0 || 1191 + u->header_length % ctx->header_size != 0) 1189 1192 return -EINVAL; 1190 1193 break; 1191 1194 1192 1195 case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL: 1193 - if (u.packet.payload_length == 0 || 1194 - u.packet.payload_length & 3) 1196 + if (u->payload_length == 0 || 1197 + u->payload_length & 3) 1195 1198 return -EINVAL; 1196 1199 break; 1197 1200 } ··· 1201 1204 if (next > end) 1202 1205 return -EINVAL; 1203 1206 if (copy_from_user 1204 - (u.packet.header, p->header, transmit_header_bytes)) 1207 + (u->header, p->header, transmit_header_bytes)) 1205 1208 return -EFAULT; 1206 - if (u.packet.skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT && 1207 - u.packet.header_length + u.packet.payload_length > 0) 1209 + if (u->skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT && 1210 + u->header_length + u->payload_length > 0) 1208 1211 return -EINVAL; 1209 - if (payload + u.packet.payload_length > buffer_end) 1212 + if (payload + u->payload_length > buffer_end) 1210 1213 return -EINVAL; 1211 1214 1212 - if (fw_iso_context_queue(ctx, &u.packet, 1213 - &client->buffer, payload)) 1215 + if (fw_iso_context_queue(ctx, u, &client->buffer, payload)) 1214 1216 break; 1215 1217 1216 1218 p = next; 1217 - payload += u.packet.payload_length; 1219 + payload += u->payload_length; 1218 1220 count++; 1219 1221 } 1220 1222 fw_iso_context_queue_flush(ctx);