lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinNSUXZkFhEhf5nRzlNGDkm_-OsOGtqfgs32717@mail.gmail.com>
Date:	Wed, 23 Jun 2010 18:43:31 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	Ohad Ben-Cohen <ohad@...ery.com>
Cc:	Greg KH <greg@...ah.com>, linux-kernel@...r.kernel.org,
	linux-omap@...r.kernel.org, Hebbar Shivananda <x0hebbar@...com>,
	Ramos Falcon Ernesto <ernesto@...com>,
	Anna Suman <s-anna@...com>, Kanigeri Hari <h-kanigeri2@...com>,
	Felipe Contreras <felipe.contreras@...il.com>,
	Felipe Balbi <felipe.balbi@...ia.com>,
	Hiroshi DOYU <Hiroshi.DOYU@...ia.com>,
	Gupta Ramesh <grgupta@...com>,
	Guzman Lugo Fernando <fernando.lugo@...com>,
	Tony Lindgren <tony@...mide.com>,
	Ameya Palande <ameya.palande@...ia.com>,
	Gomez Castellanos Ivan <ivan.gomez@...com>,
	Andy Shevchenko <ext-andriy.shevchenko@...ia.com>,
	Armando Uribe De Leon <x0095078@...com>,
	Deepak Chitriki <deepak.chitriki@...com>,
	Menon Nishanth <nm@...com>,
	Phil Carmody <ext-phil.2.carmody@...ia.com>,
	Pitney Gilbert <gpitney@...com>, Bhavin Shah <bshah@...com>,
	Omar Ramirez Luna <omar.ramirez@...com>
Subject: Re: [PATCH 06/11] staging: ti dspbridge: add generic utilities

On Wed, Jun 23, 2010 at 4:02 PM, Ohad Ben-Cohen <ohad@...ery.com> wrote:
> Add TI's DSP Bridge generic utilities driver sources
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@...ia.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ