dtc: Cleanup srcpos_string()
dtc: Cleanup srcpos_string()

There are several small problems with the current srcpos_string().

	- The code unnecessarily uses a temp buffer and two rounds of
	  *printf(); a single asprintf() will suffice.

	- With previous changes, pos->file->name can never be NULL,
          and the name field for a srcfile bound to stdin is already
          set to something sensible.

	- On allocation failure in asprintf() it returns a bogus
          result, instead of causing a fatal error like every other
          failed allocation.

	- The format for representing file/line/column is gratuitously
          different from the file/line format we used to use, and the
          format used by gcc and bison.

This patch addresses all of these.  There remains the problem that
asprintf() is not portable, but that can wait until another patch.

Signed-off-by: David Gibson <aa743a0aaec8f7d7a1f01442503957f4d7a2d634@gibson.dropbear.id.au>

thornbirdblue/codeaurora_lk,t2m-foxfone/kernel_lk,utilite2/lk,Foxda-Tech/argo8-bootable-bootloader-lk,hanjae/lumiab0,RonGokhale/android_lk_bootloader,chirayudesai/android_bootable_bootloader_lk,DooMLoRD/android_bootable_bootloader_lk,lg-devs/g2-bootloader,jbott/lk_gee,utilite2/lk,jsr-d10/android_bootable_bootloader_lk,M1cha/android_bootable_bootloader_lk,Foxda-Tech/polaris-bootable-bootloader-lk,Redmi-dev/android_bootable_lk,thornbirdblue/codeaurora_lk,Blefish/android_bootable_bootloader_lk,detule/lk-g2-spr,DooMLoRD/android_bootable_bootloader_lk,jsr-d10/android_bootable_bootloader_lk,Foxda-Tech/argo8-bootable-bootloader-lk,zhuotong/mi2_lk_NoEmmc,RonGokhale/android_lk_bootloader,mozilla-b2g/kernel_lk,efidroid/lk,pichina/lk,Foxda-Tech/argo8-bootable-bootloader-lk,M1cha/lktris,jsr-d9/android_kernel_lk,zhuotong/mi2_lk_NoEmmc,Redmi-dev/android_bootable_lk,hanjae/lumiab0,efidroid/lk,zhuotong/mi2_lk_NoEmmc,MiCode/mi2_lk,detule/lk-g2-spr,RonGokhale/android_lk_bootloader,detule/lk-g2-spr,lg-devs/g2-bootloader,pichina/lk,chirayudesai/android_bootable_bootloader_lk,Foxda-Tech/polaris-bootable-bootloader-lk,DooMLoRD/android_bootable_bootloader_lk,jsr-d10/android_bootable_bootloader_lk,t2m-foxfone/kernel_lk,oubeichen/lk-v500,oubeichen/lk-v500,M1cha/android_bootable_bootloader_lk,mozilla-b2g/fairphone2_kernel_lk,t2m-foxfone/kernel_lk,jbott/lk_gee,mozilla-b2g/fairphone2_kernel_lk,CanarySolutions/little-kernel,oubeichen/lk-v500,Blefish/android_bootable_bootloader_lk,idor/dk50-bootable_bootloader_lk,Foxda-Tech/polaris-bootable-bootloader-lk,pichina/lk,Blefish/android_bootable_bootloader_lk,t2m-foxfone/android_kernel_lk,lg-devs/g2-bootloader,t2m-foxfone/android_kernel_lk,utilite2/lk,CanarySolutions/little-kernel,efidroid/lk,zhuotong/mi2_lk_NoEmmc,DooMLoRD/android_bootable_bootloader_lk,M1cha/lktris,pichina/lk,jsr-d9/android_kernel_lk,M1cha/mi2_lk,pichina/lk,idor/dk50-bootable_bootloader_lk,idor/dk50-bootable_bootloader_lk,MiCode/mi2_lk,M1cha/mi2_lk,mozilla-b2g/kernel_lk,jbott/lk_gee,thornbirdblue/codeaurora_lk,detule/lk-g2-spr,utilite2/lk,mozilla-b2g/kernel_lk,CanarySolutions/little-kernel,hanjae/lumiab0,MiCode/mi2_lk,t2m-foxfone/android_kernel_lk,M1cha/android_bootable_bootloader_lk,MiCode/mi2_lk,lg-devs/g2-bootloader,t2m-foxfone/android_kernel_lk,M1cha/android_bootable_bootloader_lk,Blefish/android_bootable_bootloader_lk,M1cha/mi2_lk,Redmi-dev/android_bootable_lk,MiCode/mi2_lk,lg-devs/g2-bootloader,M1cha/lktris,jsr-d10/android_bootable_bootloader_lk,thornbirdblue/codeaurora_lk,Redmi-dev/android_bootable_lk,t2m-foxfone/kernel_lk,efidroid/lk,jsr-d9/android_kernel_lk,chirayudesai/android_bootable_bootloader_lk,Foxda-Tech/argo8-bootable-bootloader-lk,t2m-foxfone/android_kernel_lk,M1cha/lktris,idor/dk50-bootable_bootloader_lk,Blefish/android_bootable_bootloader_lk,mozilla-b2g/fairphone2_kernel_lk,mozilla-b2g/fairphone2_kernel_lk,Foxda-Tech/argo8-bootable-bootloader-lk,DooMLoRD/android_bootable_bootloader_lk,efidroid/lk,M1cha/mi2_lk,M1cha/lktris,Foxda-Tech/polaris-bootable-bootloader-lk,jsr-d9/android_kernel_lk,oubeichen/lk-v500,M1cha/android_bootable_bootloader_lk,t2m-foxfone/kernel_lk,zhuotong/mi2_lk_NoEmmc,hanjae/lumiab0,mozilla-b2g/kernel_lk,utilite2/lk,jbott/lk_gee,CanarySolutions/little-kernel,idor/dk50-bootable_bootloader_lk,oubeichen/lk-v500,mozilla-b2g/kernel_lk,hanjae/lumiab0,chirayudesai/android_bootable_bootloader_lk,M1cha/android_bootable_bootloader_lk,detule/lk-g2-spr,Foxda-Tech/polaris-bootable-bootloader-lk,jsr-d10/android_bootable_bootloader_lk,chirayudesai/android_bootable_bootloader_lk,mozilla-b2g/fairphone2_kernel_lk,CanarySolutions/little-kernel,RonGokhale/android_lk_bootloader,Redmi-dev/android_bootable_lk,jsr-d9/android_kernel_lk,thornbirdblue/codeaurora_lk,RonGokhale/android_lk_bootloader,M1cha/mi2_lk,jbott/lk_gee