Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firewire: ohci: code refactoring to use union for isoc multiple channel state

In 1394 OHCI driver, some members of struct iso_context are only used for
multi-channel isochronous contexts.

This commit uses a union for these members to clearly separate
multi-channel specific state.

Link: https://lore.kernel.org/r/20260117142823.440811-4-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+15 -14
+15 -14
drivers/firewire/ohci.c
··· 169 169 struct fw_iso_context base; 170 170 struct context context; 171 171 unsigned long flushing_completions; 172 - u32 mc_buffer_bus; 173 - u16 mc_completed; 174 172 u8 sync; 175 173 u8 tags; 176 174 union { ··· 177 179 size_t header_length; 178 180 void *header; 179 181 } sc; 182 + struct { 183 + u32 buffer_bus; 184 + u16 completed; 185 + } mc; 180 186 }; 181 187 }; 182 188 ··· 2828 2826 buffer_dma = le32_to_cpu(last->data_address); 2829 2827 2830 2828 if (completed > 0) { 2831 - ctx->mc_buffer_bus = buffer_dma; 2832 - ctx->mc_completed = completed; 2829 + ctx->mc.buffer_bus = buffer_dma; 2830 + ctx->mc.completed = completed; 2833 2831 } 2834 2832 2835 2833 if (res_count != 0) ··· 2848 2846 ctx->base.callback.mc(&ctx->base, 2849 2847 buffer_dma + completed, 2850 2848 ctx->base.callback_data); 2851 - ctx->mc_completed = 0; 2849 + ctx->mc.completed = 0; 2852 2850 } 2853 2851 2854 2852 return 1; ··· 2857 2855 static void flush_ir_buffer_fill(struct iso_context *ctx) 2858 2856 { 2859 2857 dma_sync_single_range_for_cpu(ctx->context.ohci->card.device, 2860 - ctx->mc_buffer_bus & PAGE_MASK, 2861 - ctx->mc_buffer_bus & ~PAGE_MASK, 2862 - ctx->mc_completed, DMA_FROM_DEVICE); 2858 + ctx->mc.buffer_bus & PAGE_MASK, 2859 + ctx->mc.buffer_bus & ~PAGE_MASK, 2860 + ctx->mc.completed, DMA_FROM_DEVICE); 2863 2861 2864 - trace_isoc_inbound_multiple_completions(&ctx->base, ctx->mc_completed, 2862 + trace_isoc_inbound_multiple_completions(&ctx->base, ctx->mc.completed, 2865 2863 FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH); 2866 2864 2867 - ctx->base.callback.mc(&ctx->base, 2868 - ctx->mc_buffer_bus + ctx->mc_completed, 2865 + ctx->base.callback.mc(&ctx->base, ctx->mc.buffer_bus + ctx->mc.completed, 2869 2866 ctx->base.callback_data); 2870 - ctx->mc_completed = 0; 2867 + ctx->mc.completed = 0; 2871 2868 } 2872 2869 2873 2870 static inline void sync_it_packet_for_cpu(struct context *context, ··· 3029 3028 3030 3029 if (type == FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) { 3031 3030 set_multichannel_mask(ohci, 0); 3032 - ctx->mc_completed = 0; 3031 + ctx->mc.completed = 0; 3033 3032 } 3034 3033 3035 3034 return &ctx->base; ··· 3494 3493 flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH); 3495 3494 break; 3496 3495 case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL: 3497 - if (ctx->mc_completed != 0) 3496 + if (ctx->mc.completed != 0) 3498 3497 flush_ir_buffer_fill(ctx); 3499 3498 break; 3500 3499 default: