gpu: pvr: change snprintf to scnprintf
authorImre Deak <imre.deak@nokia.com>
Tue, 22 Mar 2011 14:18:20 +0000 (16:18 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:04 +0000 (21:43 +0300)
snprintf returns how many characters _would_ have been written if there
had been enough space, whereas scnprintf returns the actual numer of
written characters. The latter fits better our use case.

Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/pvr_debugfs.c

index 81761cd..ed2c795 100644 (file)
@@ -139,7 +139,7 @@ edm_trace_print(struct PVRSRV_SGXDEV_INFO *sdev, char *dst, size_t dst_len)
 
        buf = sdev->psKernelEDMStatusBufferMemInfo->pvLinAddrKM;
 
-       p += snprintf(dst + p, dst_len - p,
+       p += scnprintf(dst + p, dst_len - p,
                      "Last SGX microkernel status code: 0x%x\n", *buf);
        buf++;
        wr_ofs = *buf;
@@ -152,7 +152,8 @@ edm_trace_print(struct PVRSRV_SGXDEV_INFO *sdev, char *dst, size_t dst_len)
 
        /* Dump the status values */
        for (i = 0; i < SGXMK_TRACE_BUFFER_SIZE; i++) {
-               p += snprintf(dst + p, dst_len - p, "%3d %08X %08X %08X %08X\n",
+               p += scnprintf(dst + p, dst_len - p,
+                             "%3d %08X %08X %08X %08X\n",
                              i, buf[2], buf[3], buf[1], buf[0]);
                buf += 4;
                if (buf >= buf_end)