Skip to content

Commit 63548a8

Browse files
ikegami-tigaw
authored andcommitted
ocp: fix ocp-print-stdout.c indentation error
Fix also some build warnings. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
1 parent 8dad0c5 commit 63548a8

File tree

1 file changed

+35
-50
lines changed

1 file changed

+35
-50
lines changed

plugins/ocp/ocp-print-stdout.c

+35-50
Original file line numberDiff line numberDiff line change
@@ -500,151 +500,136 @@ static int stdout_c9_log(struct telemetry_str_log_format *log_data, __u8 *log_da
500500
printf(" FIFO 4 ASCII String\n");
501501
printf(" index value ascii_val\n");
502502
for (j = 0; j < 16; j++)
503-
printf(" %d %d %c\n", j, log_data->fifo4[j],
504-
log_data->fifo4[j]);
503+
printf(" %d %d %c\n", j, log_data->fifo4[j], log_data->fifo4[j]);
505504

506505
printf(" FIFO 5 ASCII String\n");
507506
printf(" index value ascii_val\n");
508507
for (j = 0; j < 16; j++)
509-
printf(" %d %d %c\n", j, log_data->fifo5[j],
510-
log_data->fifo5[j]);
508+
printf(" %d %d %c\n", j, log_data->fifo5[j], log_data->fifo5[j]);
511509

512510
printf(" FIFO 6 ASCII String\n");
513511
printf(" index value ascii_val\n");
514512
for (j = 0; j < 16; j++)
515-
printf(" %d %d %c\n", j, log_data->fifo6[j],
516-
log_data->fifo6[j]);
513+
printf(" %d %d %c\n", j, log_data->fifo6[j], log_data->fifo6[j]);
517514

518515
printf(" FIFO 7 ASCII String\n");
519516
printf(" index value ascii_val\n");
520517
for (j = 0; j < 16; j++)
521-
printf(" %d %d %c\n", j, log_data->fifo7[j],
522-
log_data->fifo7[j]);
518+
printf(" %d %d %c\n", j, log_data->fifo7[j], log_data->fifo7[j]);
523519

524520
printf(" FIFO 8 ASCII String\n");
525521
printf(" index value ascii_val\n");
526522
for (j = 0; j < 16; j++)
527-
printf(" %d %d %c\n", j, log_data->fifo8[j],
528-
log_data->fifo8[j]);
523+
printf(" %d %d %c\n", j, log_data->fifo8[j], log_data->fifo8[j]);
529524

530525
printf(" FIFO 9 ASCII String\n");
531526
printf(" index value ascii_val\n");
532527
for (j = 0; j < 16; j++)
533-
printf(" %d %d %c\n", j, log_data->fifo9[j],
534-
log_data->fifo9[j]);
528+
printf(" %d %d %c\n", j, log_data->fifo9[j], log_data->fifo9[j]);
535529

536530
printf(" FIFO 10 ASCII String\n");
537531
printf(" index value ascii_val\n");
538532
for (j = 0; j < 16; j++)
539-
printf(" %d %d %c\n", j, log_data->fifo10[j],
540-
log_data->fifo10[j]);
533+
printf(" %d %d %c\n", j, log_data->fifo10[j], log_data->fifo10[j]);
541534

542535
printf(" FIFO 11 ASCII String\n");
543536
printf(" index value ascii_val\n");
544537
for (j = 0; j < 16; j++)
545-
printf(" %d %d %c\n", j, log_data->fifo11[j],
546-
log_data->fifo11[j]);
538+
printf(" %d %d %c\n", j, log_data->fifo11[j], log_data->fifo11[j]);
547539

548540
printf(" FIFO 12 ASCII String\n");
549541
printf(" index value ascii_val\n");
550542
for (j = 0; j < 16; j++)
551-
printf(" %d %d %c\n", j,
552-
log_data->fifo12[j], log_data->fifo12[j]);
543+
printf(" %d %d %c\n", j, log_data->fifo12[j], log_data->fifo12[j]);
553544

554545
printf(" FIFO 13 ASCII String\n");
555546
printf(" index value ascii_val\n");
556547
for (j = 0; j < 16; j++)
557-
printf(" %d %d %c\n", j,
558-
log_data->fifo13[j], log_data->fifo13[j]);
548+
printf(" %d %d %c\n", j, log_data->fifo13[j], log_data->fifo13[j]);
559549

560550
printf(" FIFO 14 ASCII String\n");
561551
printf(" index value ascii_val\n");
562552
for (j = 0; j < 16; j++)
563-
printf(" %d %d %c\n", j,
564-
log_data->fifo14[j], log_data->fifo14[j]);
553+
printf(" %d %d %c\n", j, log_data->fifo14[j], log_data->fifo14[j]);
565554

566555
printf(" FIFO 15 ASCII String\n");
567556
printf(" index value ascii_val\n");
568557
for (j = 0; j < 16; j++)
569-
printf(" %d %d %c\n", j,
570-
log_data->fifo15[j], log_data->fifo16[j]);
558+
printf(" %d %d %c\n", j, log_data->fifo15[j], log_data->fifo16[j]);
571559

572560
printf(" FIFO 16 ASCII String\n");
573561
printf(" index value ascii_val\n");
574562
for (j = 0; j < 16; j++)
575-
printf(" %d %d %c\n", j,
576-
log_data->fifo16[j], log_data->fifo16[j]);
563+
printf(" %d %d %c\n", j, log_data->fifo16[j], log_data->fifo16[j]);
577564

578565
printf(" Reserved : ");
579566
for (j = 0; j < 48; j++)
580567
printf("%d", log_data->reserved3[j]);
581568
printf("\n");
582569

583-
584570
if (log_data->sitsz != 0) {
585-
memcpy(stat_id_str_table_arr,
586-
(__u8 *)log_data_buf + stat_id_str_table_ofst,
587-
(log_data->sitsz * 4));
571+
memcpy(stat_id_str_table_arr, (__u8 *)log_data_buf + stat_id_str_table_ofst,
572+
(log_data->sitsz * 4));
588573
printf(" Statistics Identifier String Table\n");
589574
for (j = 0; j < stat_id_index; j++) {
590575
printf(" Vendor Specific Statistic Identifier : 0x%x\n",
591-
le16_to_cpu(stat_id_str_table_arr[j].vs_si));
576+
le16_to_cpu(stat_id_str_table_arr[j].vs_si));
592577
printf(" Reserved : 0x%x\n",
593-
stat_id_str_table_arr[j].reserved1);
578+
stat_id_str_table_arr[j].reserved1);
594579
printf(" ASCII ID Length : 0x%x\n",
595-
stat_id_str_table_arr[j].ascii_id_len);
580+
stat_id_str_table_arr[j].ascii_id_len);
596581
printf(" ASCII ID offset : 0x%"PRIx64"\n",
597582
le64_to_cpu(stat_id_str_table_arr[j].ascii_id_ofst));
598583
printf(" Reserved : 0x%x\n",
599-
stat_id_str_table_arr[j].reserved2);
584+
stat_id_str_table_arr[j].reserved2);
600585
}
601586
}
602587

603588
if (log_data->estsz != 0) {
604-
memcpy(event_id_str_table_arr, (__u8 *)log_data_buf +
605-
event_str_table_ofst, (log_data->estsz * 4));
589+
memcpy(event_id_str_table_arr, (__u8 *)log_data_buf + event_str_table_ofst,
590+
(log_data->estsz * 4));
606591
printf(" Event Identifier String Table Entry\n");
607592
for (j = 0; j < eve_id_index; j++) {
608593
printf(" Debug Event Class : 0x%x\n",
609-
event_id_str_table_arr[j].deb_eve_class);
594+
event_id_str_table_arr[j].deb_eve_class);
610595
printf(" Event Identifier : 0x%x\n",
611-
le16_to_cpu(event_id_str_table_arr[j].ei));
596+
le16_to_cpu(event_id_str_table_arr[j].ei));
612597
printf(" ASCII ID Length : 0x%x\n",
613-
event_id_str_table_arr[j].ascii_id_len);
598+
event_id_str_table_arr[j].ascii_id_len);
614599
printf(" ASCII ID offset : 0x%"PRIx64"\n",
615600
le64_to_cpu(event_id_str_table_arr[j].ascii_id_ofst));
616601
printf(" Reserved : 0x%x\n",
617-
event_id_str_table_arr[j].reserved2);
602+
event_id_str_table_arr[j].reserved2);
618603

619604
}
620605
}
621606

622607
if (log_data->vu_eve_st_sz != 0) {
623-
memcpy(vu_event_id_str_table_arr, (__u8 *)log_data_buf +
624-
vu_event_str_table_ofst, (log_data->vu_eve_st_sz * 4));
608+
memcpy(vu_event_id_str_table_arr, (__u8 *)log_data_buf + vu_event_str_table_ofst,
609+
(log_data->vu_eve_st_sz * 4));
625610
printf(" VU Event Identifier String Table Entry\n");
626611
for (j = 0; j < vu_eve_index; j++) {
627612
printf(" Debug Event Class : 0x%x\n",
628-
vu_event_id_str_table_arr[j].deb_eve_class);
613+
vu_event_id_str_table_arr[j].deb_eve_class);
629614
printf(" VU Event Identifier : 0x%x\n",
630-
le16_to_cpu(vu_event_id_str_table_arr[j].vu_ei));
615+
le16_to_cpu(vu_event_id_str_table_arr[j].vu_ei));
631616
printf(" ASCII ID Length : 0x%x\n",
632-
vu_event_id_str_table_arr[j].ascii_id_len);
617+
vu_event_id_str_table_arr[j].ascii_id_len);
633618
printf(" ASCII ID offset : 0x%"PRIx64"\n",
634619
le64_to_cpu(vu_event_id_str_table_arr[j].ascii_id_ofst));
635620
printf(" Reserved : 0x%x\n",
636-
vu_event_id_str_table_arr[j].reserved);
637-
621+
vu_event_id_str_table_arr[j].reserved);
638622
}
639623
}
640624

641625
if (log_data->asctsz != 0) {
642626
printf(" ASCII Table\n");
643627
printf(" Byte Data_Byte ASCII_Character\n");
644628
for (j = 0; j < ascii_table_index; j++)
645-
printf(" %lld %d %c\n",
646-
ascii_table_ofst+j, log_data_buf[ascii_table_ofst + j],
647-
(char)log_data_buf[ascii_table_ofst + j]);
629+
printf(" %"PRIu64" %d %c\n",
630+
le64_to_cpu(ascii_table_ofst + j),
631+
log_data_buf[ascii_table_ofst + j],
632+
(char)log_data_buf[ascii_table_ofst + j]);
648633
}
649634

650635
return 0;

0 commit comments

Comments
 (0)