@@ -592,9 +592,12 @@ static void sndk_print_fw_act_history_log_normal(__u8 *data, int num_entries)
592592
593593 if (data [0 ] == SNDK_NVME_GET_FW_ACT_HISTORY_C2_LOG_ID ) {
594594 printf (" Firmware Activate History Log\n" );
595- printf (" Power Cycle Previous New\n" );
596- printf (" Entry Timestamp Count Firmware Firmware Slot Action Result\n" );
597- printf (" ----- ----------------- ----------------- --------- --------- ----- ------ -------\n" );
595+ printf (" Power Cycle " );
596+ printf ("Previous New\n" );
597+ printf (" Entry Timestamp Count " );
598+ printf ("Firmware Firmware Slot Action Result\n" );
599+ printf (" ----- ----------------- ----------------- " );
600+ printf ("--------- --------- ----- ------ -------\n" );
598601
599602 struct sndk_fw_act_history_log_format_c2 * fw_act_history_entry =
600603 (struct sndk_fw_act_history_log_format_c2 * )(data );
@@ -604,8 +607,10 @@ static void sndk_print_fw_act_history_log_normal(__u8 *data, int num_entries)
604607 /* find lowest/oldest entry */
605608 for (i = 0 ; i < num_entries ; i ++ ) {
606609 j = (i + 1 == SNDK_MAX_NUM_ACT_HIST_ENTRIES ) ? 0 : i + 1 ;
607- if (le16_to_cpu (fw_act_history_entry -> entry [i ].fw_act_hist_entries ) >
608- le16_to_cpu (fw_act_history_entry -> entry [j ].fw_act_hist_entries )) {
610+ if (le16_to_cpu (
611+ fw_act_history_entry -> entry [i ].fw_act_hist_entries ) >
612+ le16_to_cpu (
613+ fw_act_history_entry -> entry [j ].fw_act_hist_entries )) {
609614 oldestEntryIdx = j ;
610615 break ;
611616 }
@@ -622,19 +627,22 @@ static void sndk_print_fw_act_history_log_normal(__u8 *data, int num_entries)
622627 memset ((void * )commit_action_bin , 0 , 8 );
623628
624629 memcpy (previous_fw ,
625- (char * )& (fw_act_history_entry -> entry [entryIdx ].previous_fw_version ),
630+ (char * )& (
631+ fw_act_history_entry -> entry [entryIdx ].previous_fw_version ),
626632 8 );
627633 fw_vers_len = strlen ((char * )
628634 & (fw_act_history_entry -> entry [entryIdx ].current_fw_version ));
629635 if (fw_vers_len > 1 )
630636 memcpy (new_fw ,
631- (char * )& (fw_act_history_entry -> entry [entryIdx ].current_fw_version ),
637+ (char * )& (
638+ fw_act_history_entry -> entry [entryIdx ].current_fw_version ),
632639 8 );
633640 else
634641 memcpy (new_fw , null_fw , 8 );
635642
636643 printf ("%5" PRIu16 "" ,
637- (uint16_t )le16_to_cpu (fw_act_history_entry -> entry [entryIdx ].fw_act_hist_entries ));
644+ (uint16_t )le16_to_cpu (
645+ fw_act_history_entry -> entry [entryIdx ].fw_act_hist_entries ));
638646
639647 timestamp = (0x0000FFFFFFFFFFFF &
640648 le64_to_cpu (
@@ -644,7 +652,8 @@ static void sndk_print_fw_act_history_log_normal(__u8 *data, int num_entries)
644652 printf (" " );
645653
646654 printf ("%16" PRIu64 "" ,
647- (uint64_t )le64_to_cpu (fw_act_history_entry -> entry [entryIdx ].power_cycle_count ));
655+ (uint64_t )le64_to_cpu (
656+ fw_act_history_entry -> entry [entryIdx ].power_cycle_count ));
648657 printf (" " );
649658 printf ("%s" , (char * )previous_fw );
650659 printf (" " );
@@ -662,7 +671,8 @@ static void sndk_print_fw_act_history_log_normal(__u8 *data, int num_entries)
662671 printf ("pass" );
663672 else
664673 printf ("fail #%d" ,
665- (uint16_t )le16_to_cpu (fw_act_history_entry -> entry [entryIdx ].result ));
674+ (uint16_t )le16_to_cpu (
675+ fw_act_history_entry -> entry [entryIdx ].result ));
666676 printf ("\n" );
667677
668678 entryIdx ++ ;
@@ -704,8 +714,10 @@ static void sndk_print_fw_act_history_log_json(__u8 *data, int num_entries)
704714 /* find lowest/oldest entry */
705715 for (i = 0 ; i < num_entries ; i ++ ) {
706716 j = (i + 1 == SNDK_MAX_NUM_ACT_HIST_ENTRIES ) ? 0 : i + 1 ;
707- if (le16_to_cpu (fw_act_history_entry -> entry [i ].fw_act_hist_entries ) >
708- le16_to_cpu (fw_act_history_entry -> entry [j ].fw_act_hist_entries )) {
717+ if (le16_to_cpu (
718+ fw_act_history_entry -> entry [i ].fw_act_hist_entries ) >
719+ le16_to_cpu (
720+ fw_act_history_entry -> entry [j ].fw_act_hist_entries )) {
709721 oldestEntryIdx = j ;
710722 break ;
711723 }
@@ -718,13 +730,15 @@ static void sndk_print_fw_act_history_log_json(__u8 *data, int num_entries)
718730
719731 for (i = 0 ; i < num_entries ; i ++ ) {
720732 memcpy (previous_fw ,
721- (char * )& (fw_act_history_entry -> entry [entryIdx ].previous_fw_version ),
733+ (char * )&
734+ (fw_act_history_entry -> entry [entryIdx ].previous_fw_version ),
722735 8 );
723736 fw_vers_len = strlen ((char * )
724737 & (fw_act_history_entry -> entry [entryIdx ].current_fw_version ));
725738 if (fw_vers_len > 1 )
726739 memcpy (new_fw ,
727- (char * )& (fw_act_history_entry -> entry [entryIdx ].current_fw_version ),
740+ (char * )&
741+ (fw_act_history_entry -> entry [entryIdx ].current_fw_version ),
728742 8 );
729743 else
730744 memcpy (new_fw , null_fw , 8 );
@@ -756,7 +770,8 @@ static void sndk_print_fw_act_history_log_json(__u8 *data, int num_entries)
756770 json_object_add_value_string (root , "Result" , "pass" );
757771 } else {
758772 sprintf ((char * )fail_str , "fail #%d" ,
759- (int )(le16_to_cpu (fw_act_history_entry -> entry [entryIdx ].result )));
773+ (int )(le16_to_cpu (
774+ fw_act_history_entry -> entry [entryIdx ].result )));
760775 json_object_add_value_string (root , "Result" , fail_str );
761776 }
762777
0 commit comments