staging: tidspbridge: eliminate uuid_uuid_to_string
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 2 Aug 2012 16:05:41 +0000 (19:05 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Aug 2012 02:06:59 +0000 (19:06 -0700)
There is native specificator for snprintf to get UUID in human readable format.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/tidspbridge/gen/uuidutil.c
drivers/staging/tidspbridge/include/dspbridge/uuidutil.h
drivers/staging/tidspbridge/rmgr/dbdcd.c

index b44656cf7858ea1ec3f5fb186634ad7fe67019e5..b7d8313d1acb2eec29402988b9f43651b525542a 100644 (file)
 /*  ----------------------------------- This */
 #include <dspbridge/uuidutil.h>
 
-/*
- *  ======== uuid_uuid_to_string ========
- *  Purpose:
- *      Converts a struct dsp_uuid to a string.
- *      Note: snprintf format specifier is:
- *      %[flags] [width] [.precision] [{h | l | I64 | L}]type
- */
-void uuid_uuid_to_string(struct dsp_uuid *uuid_obj, char *sz_uuid,
-                        s32 size)
-{
-       s32 i;                  /* return result from snprintf. */
-
-       i = snprintf(sz_uuid, size,
-                    "%.8X_%.4X_%.4X_%.2X%.2X_%.2X%.2X%.2X%.2X%.2X%.2X",
-                    uuid_obj->data1, uuid_obj->data2, uuid_obj->data3,
-                    uuid_obj->data4, uuid_obj->data5,
-                    uuid_obj->data6[0], uuid_obj->data6[1],
-                    uuid_obj->data6[2], uuid_obj->data6[3],
-                    uuid_obj->data6[4], uuid_obj->data6[5]);
-}
-
 static s32 uuid_hex_to_bin(char *buf, s32 len)
 {
        s32 i;
index 9a994753e9ba143143b677ebc16ea8462b86ddc0..414bf71d652db7bf6c3e080129628987ee9a1050 100644 (file)
 
 #define MAXUUIDLEN  37
 
-/*
- *  ======== uuid_uuid_to_string ========
- *  Purpose:
- *      Converts a dsp_uuid to an ANSI string.
- *  Parameters:
- *      uuid_obj:      Pointer to a dsp_uuid object.
- *      sz_uuid:    Pointer to a buffer to receive a NULL-terminated UUID
- *                  string.
- *      size:      Maximum size of the sz_uuid string.
- *  Returns:
- *  Requires:
- *      uuid_obj & sz_uuid are non-NULL values.
- *  Ensures:
- *      Lenghth of sz_uuid is less than MAXUUIDLEN.
- *  Details:
- *      UUID string limit currently set at MAXUUIDLEN.
- */
-void uuid_uuid_to_string(struct dsp_uuid *uuid_obj, char *sz_uuid,
-                        s32 size);
-
 /*
  *  ======== uuid_uuid_from_string ========
  *  Purpose:
index 12a1d34b39546e93e1b604d3264ac8eef5b71b81..eba36f4849798f6daf88707632f400d94e6adae2 100644 (file)
@@ -395,7 +395,7 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
                }
 
                /* Create UUID value to set in registry. */
-               uuid_uuid_to_string(obj_uuid, sz_uuid, MAXUUIDLEN);
+               snprintf(sz_uuid, MAXUUIDLEN, "%pU", obj_uuid);
 
                if ((strlen(sz_reg_key) + MAXUUIDLEN) < DCD_MAXPATHLENGTH)
                        strncat(sz_reg_key, sz_uuid, MAXUUIDLEN);