Skip to content

Commit 90ec7c9

Browse files
arndbmartinkpetersen
authored andcommitted
scsi: lpfc: use div_u64 for 64-bit division
The new debugfs output causes a link error on 32-bit architectures: ERROR: "__aeabi_uldivmod" [drivers/scsi/lpfc/lpfc.ko] undefined! This code is not performance critical, so we can simply use div_u64(). [mkp: fixed up whitespace] Fixes: bd2cdd5 ("scsi: lpfc: NVME Initiator: Add debugfs support") Fixes: 2b65e18 ("scsi: lpfc: NVME Target: Add debugfs support") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 2559a1e commit 90ec7c9

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

drivers/scsi/lpfc/lpfc_debugfs.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,8 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
873873
len += snprintf(
874874
buf + len, PAGE_SIZE - len,
875875
"avg:%08lld min:%08lld max %08lld\n",
876-
phba->ktime_seg1_total /
877-
phba->ktime_data_samples,
876+
div_u64(phba->ktime_seg1_total,
877+
phba->ktime_data_samples),
878878
phba->ktime_seg1_min,
879879
phba->ktime_seg1_max);
880880
len += snprintf(
@@ -884,8 +884,8 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
884884
len += snprintf(
885885
buf + len, PAGE_SIZE - len,
886886
"avg:%08lld min:%08lld max %08lld\n",
887-
phba->ktime_seg2_total /
888-
phba->ktime_data_samples,
887+
div_u64(phba->ktime_seg2_total,
888+
phba->ktime_data_samples),
889889
phba->ktime_seg2_min,
890890
phba->ktime_seg2_max);
891891
len += snprintf(
@@ -895,8 +895,8 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
895895
len += snprintf(
896896
buf + len, PAGE_SIZE - len,
897897
"avg:%08lld min:%08lld max %08lld\n",
898-
phba->ktime_seg3_total /
899-
phba->ktime_data_samples,
898+
div_u64(phba->ktime_seg3_total,
899+
phba->ktime_data_samples),
900900
phba->ktime_seg3_min,
901901
phba->ktime_seg3_max);
902902
len += snprintf(
@@ -906,17 +906,17 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
906906
len += snprintf(
907907
buf + len, PAGE_SIZE - len,
908908
"avg:%08lld min:%08lld max %08lld\n",
909-
phba->ktime_seg4_total /
910-
phba->ktime_data_samples,
909+
div_u64(phba->ktime_seg4_total,
910+
phba->ktime_data_samples),
911911
phba->ktime_seg4_min,
912912
phba->ktime_seg4_max);
913913
len += snprintf(
914914
buf + len, PAGE_SIZE - len,
915915
"Total IO avg time: %08lld\n",
916-
((phba->ktime_seg1_total +
916+
div_u64(phba->ktime_seg1_total +
917917
phba->ktime_seg2_total +
918918
phba->ktime_seg3_total +
919-
phba->ktime_seg4_total) /
919+
phba->ktime_seg4_total,
920920
phba->ktime_data_samples));
921921
return len;
922922
}
@@ -935,44 +935,44 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
935935
"cmd pass to NVME Layer\n");
936936
len += snprintf(buf + len, PAGE_SIZE-len,
937937
"avg:%08lld min:%08lld max %08lld\n",
938-
phba->ktime_seg1_total /
939-
phba->ktime_data_samples,
938+
div_u64(phba->ktime_seg1_total,
939+
phba->ktime_data_samples),
940940
phba->ktime_seg1_min,
941941
phba->ktime_seg1_max);
942942
len += snprintf(buf + len, PAGE_SIZE-len,
943943
"Segment 2: cmd pass to NVME Layer- "
944944
"-to- Driver rcv cmd OP (action)\n");
945945
len += snprintf(buf + len, PAGE_SIZE-len,
946946
"avg:%08lld min:%08lld max %08lld\n",
947-
phba->ktime_seg2_total /
948-
phba->ktime_data_samples,
947+
div_u64(phba->ktime_seg2_total,
948+
phba->ktime_data_samples),
949949
phba->ktime_seg2_min,
950950
phba->ktime_seg2_max);
951951
len += snprintf(buf + len, PAGE_SIZE-len,
952952
"Segment 3: Driver rcv cmd OP -to- "
953953
"Firmware WQ doorbell: cmd\n");
954954
len += snprintf(buf + len, PAGE_SIZE-len,
955955
"avg:%08lld min:%08lld max %08lld\n",
956-
phba->ktime_seg3_total /
957-
phba->ktime_data_samples,
956+
div_u64(phba->ktime_seg3_total,
957+
phba->ktime_data_samples),
958958
phba->ktime_seg3_min,
959959
phba->ktime_seg3_max);
960960
len += snprintf(buf + len, PAGE_SIZE-len,
961961
"Segment 4: Firmware WQ doorbell: cmd "
962962
"-to- MSI-X ISR for cmd cmpl\n");
963963
len += snprintf(buf + len, PAGE_SIZE-len,
964964
"avg:%08lld min:%08lld max %08lld\n",
965-
phba->ktime_seg4_total /
966-
phba->ktime_data_samples,
965+
div_u64(phba->ktime_seg4_total,
966+
phba->ktime_data_samples),
967967
phba->ktime_seg4_min,
968968
phba->ktime_seg4_max);
969969
len += snprintf(buf + len, PAGE_SIZE-len,
970970
"Segment 5: MSI-X ISR for cmd cmpl "
971971
"-to- NVME layer passed cmd done\n");
972972
len += snprintf(buf + len, PAGE_SIZE-len,
973973
"avg:%08lld min:%08lld max %08lld\n",
974-
phba->ktime_seg5_total /
975-
phba->ktime_data_samples,
974+
div_u64(phba->ktime_seg5_total,
975+
phba->ktime_data_samples),
976976
phba->ktime_seg5_min,
977977
phba->ktime_seg5_max);
978978

@@ -983,8 +983,8 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
983983
len += snprintf(buf + len, PAGE_SIZE-len,
984984
"avg:%08lld min:%08lld "
985985
"max %08lld\n",
986-
phba->ktime_seg10_total /
987-
phba->ktime_data_samples,
986+
div_u64(phba->ktime_seg10_total,
987+
phba->ktime_data_samples),
988988
phba->ktime_seg10_min,
989989
phba->ktime_seg10_max);
990990
return len;
@@ -995,44 +995,44 @@ lpfc_debugfs_nvmektime_data(struct lpfc_vport *vport, char *buf, int size)
995995
"-to- Driver rcv rsp status OP\n");
996996
len += snprintf(buf + len, PAGE_SIZE-len,
997997
"avg:%08lld min:%08lld max %08lld\n",
998-
phba->ktime_seg6_total /
999-
phba->ktime_status_samples,
998+
div_u64(phba->ktime_seg6_total,
999+
phba->ktime_status_samples),
10001000
phba->ktime_seg6_min,
10011001
phba->ktime_seg6_max);
10021002
len += snprintf(buf + len, PAGE_SIZE-len,
10031003
"Segment 7: Driver rcv rsp status OP "
10041004
"-to- Firmware WQ doorbell: status\n");
10051005
len += snprintf(buf + len, PAGE_SIZE-len,
10061006
"avg:%08lld min:%08lld max %08lld\n",
1007-
phba->ktime_seg7_total /
1008-
phba->ktime_status_samples,
1007+
div_u64(phba->ktime_seg7_total,
1008+
phba->ktime_status_samples),
10091009
phba->ktime_seg7_min,
10101010
phba->ktime_seg7_max);
10111011
len += snprintf(buf + len, PAGE_SIZE-len,
10121012
"Segment 8: Firmware WQ doorbell: status"
10131013
" -to- MSI-X ISR for status cmpl\n");
10141014
len += snprintf(buf + len, PAGE_SIZE-len,
10151015
"avg:%08lld min:%08lld max %08lld\n",
1016-
phba->ktime_seg8_total /
1017-
phba->ktime_status_samples,
1016+
div_u64(phba->ktime_seg8_total,
1017+
phba->ktime_status_samples),
10181018
phba->ktime_seg8_min,
10191019
phba->ktime_seg8_max);
10201020
len += snprintf(buf + len, PAGE_SIZE-len,
10211021
"Segment 9: MSI-X ISR for status cmpl "
10221022
"-to- NVME layer passed status done\n");
10231023
len += snprintf(buf + len, PAGE_SIZE-len,
10241024
"avg:%08lld min:%08lld max %08lld\n",
1025-
phba->ktime_seg9_total /
1026-
phba->ktime_status_samples,
1025+
div_u64(phba->ktime_seg9_total,
1026+
phba->ktime_status_samples),
10271027
phba->ktime_seg9_min,
10281028
phba->ktime_seg9_max);
10291029
len += snprintf(buf + len, PAGE_SIZE-len,
10301030
"Total: cmd received by MSI-X ISR -to- "
10311031
"cmd completed on wire\n");
10321032
len += snprintf(buf + len, PAGE_SIZE-len,
10331033
"avg:%08lld min:%08lld max %08lld\n",
1034-
phba->ktime_seg10_total /
1035-
phba->ktime_status_samples,
1034+
div_u64(phba->ktime_seg10_total,
1035+
phba->ktime_status_samples),
10361036
phba->ktime_seg10_min,
10371037
phba->ktime_seg10_max);
10381038
return len;

0 commit comments

Comments
 (0)