forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/usb/mon/mon_text.c
....@@ -414,7 +414,7 @@
414414
415415 mon_text_read_head_t(rp, &ptr, ep);
416416 mon_text_read_statset(rp, &ptr, ep);
417
- ptr.cnt += snprintf(ptr.pbuf + ptr.cnt, ptr.limit - ptr.cnt,
417
+ ptr.cnt += scnprintf(ptr.pbuf + ptr.cnt, ptr.limit - ptr.cnt,
418418 " %d", ep->length);
419419 mon_text_read_data(rp, &ptr, ep);
420420
....@@ -462,7 +462,7 @@
462462 } else {
463463 mon_text_read_statset(rp, &ptr, ep);
464464 }
465
- ptr.cnt += snprintf(ptr.pbuf + ptr.cnt, ptr.limit - ptr.cnt,
465
+ ptr.cnt += scnprintf(ptr.pbuf + ptr.cnt, ptr.limit - ptr.cnt,
466466 " %d", ep->length);
467467 mon_text_read_data(rp, &ptr, ep);
468468
....@@ -520,7 +520,7 @@
520520 case USB_ENDPOINT_XFER_CONTROL: utype = 'C'; break;
521521 default: /* PIPE_BULK */ utype = 'B';
522522 }
523
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
523
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
524524 "%lx %u %c %c%c:%03u:%02u",
525525 ep->id, ep->tstamp, ep->type,
526526 utype, udir, ep->devnum, ep->epnum);
....@@ -538,7 +538,7 @@
538538 case USB_ENDPOINT_XFER_CONTROL: utype = 'C'; break;
539539 default: /* PIPE_BULK */ utype = 'B';
540540 }
541
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
541
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
542542 "%lx %u %c %c%c:%d:%03u:%u",
543543 ep->id, ep->tstamp, ep->type,
544544 utype, udir, ep->busnum, ep->devnum, ep->epnum);
....@@ -549,7 +549,7 @@
549549 {
550550
551551 if (ep->setup_flag == 0) { /* Setup packet is present and captured */
552
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
552
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
553553 " s %02x %02x %04x %04x %04x",
554554 ep->setup[0],
555555 ep->setup[1],
....@@ -557,10 +557,10 @@
557557 (ep->setup[5] << 8) | ep->setup[4],
558558 (ep->setup[7] << 8) | ep->setup[6]);
559559 } else if (ep->setup_flag != '-') { /* Unable to capture setup packet */
560
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
560
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
561561 " %c __ __ ____ ____ ____", ep->setup_flag);
562562 } else { /* No setup for this kind of URB */
563
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
563
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
564564 " %d", ep->status);
565565 }
566566 }
....@@ -568,7 +568,7 @@
568568 static void mon_text_read_intstat(struct mon_reader_text *rp,
569569 struct mon_text_ptr *p, const struct mon_event_text *ep)
570570 {
571
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
571
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
572572 " %d:%d", ep->status, ep->interval);
573573 }
574574
....@@ -576,10 +576,10 @@
576576 struct mon_text_ptr *p, const struct mon_event_text *ep)
577577 {
578578 if (ep->type == 'S') {
579
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
579
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
580580 " %d:%d:%d", ep->status, ep->interval, ep->start_frame);
581581 } else {
582
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
582
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
583583 " %d:%d:%d:%d",
584584 ep->status, ep->interval, ep->start_frame, ep->error_count);
585585 }
....@@ -592,7 +592,7 @@
592592 int i;
593593 const struct mon_iso_desc *dp;
594594
595
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
595
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
596596 " %d", ep->numdesc);
597597 ndesc = ep->numdesc;
598598 if (ndesc > ISODESC_MAX)
....@@ -601,7 +601,7 @@
601601 ndesc = 0;
602602 dp = ep->isodesc;
603603 for (i = 0; i < ndesc; i++) {
604
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
604
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
605605 " %d:%u:%u", dp->status, dp->offset, dp->length);
606606 dp++;
607607 }
....@@ -614,28 +614,28 @@
614614
615615 if ((data_len = ep->length) > 0) {
616616 if (ep->data_flag == 0) {
617
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
617
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
618618 " =");
619619 if (data_len >= DATA_MAX)
620620 data_len = DATA_MAX;
621621 for (i = 0; i < data_len; i++) {
622622 if (i % 4 == 0) {
623
- p->cnt += snprintf(p->pbuf + p->cnt,
623
+ p->cnt += scnprintf(p->pbuf + p->cnt,
624624 p->limit - p->cnt,
625625 " ");
626626 }
627
- p->cnt += snprintf(p->pbuf + p->cnt,
627
+ p->cnt += scnprintf(p->pbuf + p->cnt,
628628 p->limit - p->cnt,
629629 "%02x", ep->data[i]);
630630 }
631
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
631
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
632632 "\n");
633633 } else {
634
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt,
634
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt,
635635 " %c\n", ep->data_flag);
636636 }
637637 } else {
638
- p->cnt += snprintf(p->pbuf + p->cnt, p->limit - p->cnt, "\n");
638
+ p->cnt += scnprintf(p->pbuf + p->cnt, p->limit - p->cnt, "\n");
639639 }
640640 }
641641