linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Hebbar Shivananda <x0hebbar@ti.com>,
	Ramos Falcon Ernesto <ernesto@ti.com>, Anna Suman <s-anna@ti.com>,
	Kanigeri Hari <h-kanigeri2@ti.com>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Felipe Balbi <felipe.balbi@nokia.com>,
	Hiroshi DOYU <Hiroshi.DOYU@nokia.com>,
	Gupta Ramesh <grgupta@ti.com>,
	Guzman Lugo Fernando <fernando.lugo@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	Ameya Palande <ameya.palande@nokia.com>,
	Gomez Castellanos Ivan <ivan.gomez@ti.com>,
	Andy Shevchenko <ext-andriy.shevchenko@nokia.com>,
	Armando Uribe De Leon <x0095078@ti.com>,
	Deepak Chitriki <deepak.chitriki@ti.com>,
	Menon Nishanth <nm@ti.com>,
	Phil Carmody <ext-phil.2.carmody@nokia.com>,
	Pitney Gilbert <gpitney@ti.com>, Bhavin Shah <bshah@ti.com>,
	Omar Ramirez Luna <omar.ramirez@ti.com>
Subject: Re: [PATCH 06/11] staging: ti dspbridge: add generic utilities
Date: Wed, 23 Jun 2010 18:43:31 +0300	[thread overview]
Message-ID: <AANLkTinNSUXZkFhEhf5nRzlNGDkm_-OsOGtqfgs32717@mail.gmail.com> (raw)
In-Reply-To: <1277298125-17991-7-git-send-email-ohad@wizery.com>

On Wed, Jun 23, 2010 at 4:02 PM, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> Add TI's DSP Bridge generic utilities driver sources
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>


> +++ b/drivers/staging/tidspbridge/gen/uuidutil.c

Following part could be significantly simplified

> +/*
> + *  ======== htoi ========
> + *  Purpose:
> + *      Converts a hex value to a decimal integer.
> + */

> +/*
> + *  ======== uuid_uuid_from_string ========
> + *  Purpose:
> + *      Converts a string to a struct dsp_uuid.
> + */


There is a code (because I am already in s-o-b list I just put here
the excerpts, however, I could prepare patch in standard form, if you
want to)

static s32 uuid_hex_to_bin(char *buf, s32 len)
{
        s32 i;
        s32 result = 0;

        for (i = 0; i < len; i++) {
                value = hex_to_bin(*buf++);
                result *= 16;
                if (value > 0)
                        result += value;
        }

        return result;
}

void uuid_uuid_from_string(IN char *pszUuid, OUT struct dsp_uuid *uuid_obj)
{
        s32 j;

        uuid_obj->ul_data1 = uuid_hex_to_bin(pszUuid, 8);
        pszUuid += 8;

        /* Step over underscore */
        pszUuid++;

        uuid_obj->us_data2 = (u16) uuid_hex_to_bin(pszUuid, 4);
        pszUuid += 4;

        /* Step over underscore */
        pszUuid++;

        uuid_obj->us_data3 = (u16) uuid_hex_to_bin(pszUuid, 4);
        pszUuid += 4;

        /* Step over underscore */
        pszUuid++;

        uuid_obj->uc_data4 = (u8) uuid_hex_to_bin(pszUuid, 2);
        pszUuid += 2;

        uuid_obj->uc_data5 = (u8) uuid_hex_to_bin(pszUuid, 2);
        pszUuid += 2;

        /* Step over underscore */
        pszUuid++;

        for (j = 0; j < 6; j++) {
                uuid_obj->uc_data6[j] = (u8) uuid_hex_to_bin(pszUuid, 2);
                pszUuid += 2;
        }
}



-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2010-06-23 15:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 13:01 [PATCH 00/11] staging: add ti dspbridge driver Ohad Ben-Cohen
2010-06-23 13:01 ` [PATCH 01/11] staging: ti dspbridge: add driver documentation Ohad Ben-Cohen
2010-06-23 13:01 ` [PATCH 02/11] staging: ti dspbridge: add core driver sources Ohad Ben-Cohen
2010-06-23 13:01 ` [PATCH 03/11] staging: ti dspbridge: add platform manager code Ohad Ben-Cohen
2010-06-23 13:01 ` [PATCH 04/11] staging: ti dspbridge: add resource manager Ohad Ben-Cohen
2010-06-23 13:01 ` [PATCH 05/11] staging: ti dspbridge: add MMU support Ohad Ben-Cohen
2010-06-23 13:02 ` [PATCH 06/11] staging: ti dspbridge: add generic utilities Ohad Ben-Cohen
2010-06-23 15:43   ` Andy Shevchenko [this message]
2010-06-24  7:09     ` Ohad Ben-Cohen
2010-07-06 15:08       ` [PATCH] staging: tidspbridge: gen: simplify and clean up Andy Shevchenko
2010-06-23 13:02 ` [PATCH 07/11] staging: ti dspbridge: add services Ohad Ben-Cohen
2010-06-23 13:02 ` [PATCH 08/11] staging: ti dspbridge: add DOFF binaries loader Ohad Ben-Cohen
2010-06-23 13:12 ` [PATCH 09/11] staging: ti dspbridge: add header files Ohad Ben-Cohen
2010-06-23 13:13 ` [PATCH 10/11] staging: ti dspbridge: add TODO file Ohad Ben-Cohen
2010-06-23 13:14 ` [PATCH 11/11] staging: ti dspbridge: enable driver building Ohad Ben-Cohen
2010-06-23 22:41   ` Greg KH
2010-06-24 13:40     ` Ohad Ben-Cohen
2010-07-04 10:53     ` Felipe Contreras
2010-07-06 15:52       ` Omar Ramirez Luna
2010-07-07  9:31         ` Felipe Contreras
2010-07-07 10:18           ` Ohad Ben-Cohen
2010-07-07 20:43           ` Ramirez Luna, Omar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinNSUXZkFhEhf5nRzlNGDkm_-OsOGtqfgs32717@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=Hiroshi.DOYU@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=bshah@ti.com \
    --cc=deepak.chitriki@ti.com \
    --cc=ernesto@ti.com \
    --cc=ext-andriy.shevchenko@nokia.com \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=felipe.balbi@nokia.com \
    --cc=felipe.contreras@gmail.com \
    --cc=fernando.lugo@ti.com \
    --cc=gpitney@ti.com \
    --cc=greg@kroah.com \
    --cc=grgupta@ti.com \
    --cc=h-kanigeri2@ti.com \
    --cc=ivan.gomez@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=ohad@wizery.com \
    --cc=omar.ramirez@ti.com \
    --cc=s-anna@ti.com \
    --cc=tony@atomide.com \
    --cc=x0095078@ti.com \
    --cc=x0hebbar@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).