@samitouri / QOSamiQemu / commits / 970c895c1e

hw/dma/omap_dma: Fix coding style in omap_dma_transfer_setup()

We're about to fix indent in a section of the omap_dma_transfer_setup() function, which will make checkpatch complain. Since we're touching the code anyway, fix the uses of if() with no braces and wrongly formatted multiline comments. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260528152852.3349928-3-peter.maydell@linaro.org

Peter Maydell committed May 28, 2026 at 16:28 UTC 970c895c1e0aae00a2026d930b25b4d62073464b
1 file changed +33 -18
hw/dma/omap_dma.c
+33 -18
@@ -471,49 +471,59 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
471
472
473 /* If the channel is element synchronized, deactivate it */
474 - if (min_elems == elements[omap_dma_intr_element_sync])
474 + if (min_elems == elements[omap_dma_intr_element_sync]) {
475 omap_dma_deactivate_channel(s, ch);
476 + }
477
478 /* If it is the last frame, set the LAST_FRAME interrupt */
478 - if (min_elems == elements[omap_dma_intr_last_frame])
479 + if (min_elems == elements[omap_dma_intr_last_frame]) {
480 ch->status |= LAST_FRAME_INTR;
481 + }
482
481 - /* If exactly half of the frame was reached, set the HALF_FRAME
482 - interrupt */
483 - if (min_elems == elements[omap_dma_intr_half_frame])
483 + /*
484 + * If exactly half of the frame was reached, set the HALF_FRAME
485 + * interrupt
486 + */
487 + if (min_elems == elements[omap_dma_intr_half_frame]) {
488 ch->status |= HALF_FRAME_INTR;
489 + }
490
491 /* If a full packet has been transferred, set the END_PKT interrupt */
487 - if (min_elems == elements[omap_dma_intr_packet])
492 + if (min_elems == elements[omap_dma_intr_packet]) {
493 ch->status |= END_PKT_INTR;
494 + }
495
496 /* If the channel is packet-synchronized, deactivate it */
491 - if (min_elems == elements[omap_dma_intr_packet_sync])
497 + if (min_elems == elements[omap_dma_intr_packet_sync]) {
498 omap_dma_deactivate_channel(s, ch);
499 + }
500
501 /* If the channel is frame synchronized, deactivate it */
495 - if (min_elems == elements[omap_dma_intr_frame_sync])
502 + if (min_elems == elements[omap_dma_intr_frame_sync]) {
503 omap_dma_deactivate_channel(s, ch);
504 + }
505
506 /* Set the END_FRAME interrupt */
499 - if (min_elems == elements[omap_dma_intr_frame])
507 + if (min_elems == elements[omap_dma_intr_frame]) {
508 ch->status |= END_FRAME_INTR;
509 + }
510
511 if (min_elems == elements[omap_dma_intr_block]) {
512 /* End of Block */
513 /* Disable the channel */
514
506 - if (!ch->auto_init)
515 + if (!ch->auto_init) {
516 omap_dma_disable_channel(s, ch);
508 - else if (ch->repeat || ch->end_prog)
517 + } else if (ch->repeat || ch->end_prog) {
518 omap_dma_channel_load(ch);
510 - else {
519 + } else {
520 ch->waiting_end_prog = 1;
521 omap_dma_deactivate_channel(s, ch);
522 }
523
515 - if (ch->interrupts & END_BLOCK_INTR)
524 + if (ch->interrupts & END_BLOCK_INTR) {
525 ch->status |= END_BLOCK_INTR;
526 + }
527 }
528
529 /* Update packet number */
@@ -522,8 +532,10 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
532 a->pck_element %= a->pck_elements;
533 }
534
525 - /* TODO: check if we really need to update anything here or perhaps we
526 - * can skip part of this. */
535 + /*
536 + * TODO: check if we really need to update anything here or perhaps we
537 + * can skip part of this.
538 + */
539 if (dma->update) {
540 a->element += min_elems;
541
@@ -534,11 +546,14 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma)
546 a->dest += min_elems * a->elem_delta[1] + frames * a->frame_delta[1];
547
548 /* If the channel is async, update cpc */
537 - if (!ch->sync && frames)
549 + if (!ch->sync && frames) {
550 ch->cpc = a->dest & 0xffff;
551 + }
552
540 - /* TODO: if the destination port is IMIF or EMIFF, set the dirty
541 - * bits on it. */
553 + /*
554 + * TODO: if the destination port is IMIF or EMIFF, set the dirty
555 + * bits on it.
556 + */
557 }
558
559 omap_dma_interrupts_update(s);