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: <52C9E773.5080207@gmail.com>
Date:	Mon, 06 Jan 2014 01:14:59 +0200
From:	Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>,
	Ivaylo Dimitrov <ivo.g.dimitrov.75@...il.com>
CC:	gregkh@...uxfoundation.org, omar.ramirez@...itl.com,
	pali.rohar@...il.com, pavel@....cz, linux-kernel@...r.kernel.org,
	devel@...verdev.osuosl.org, Ivaylo Dimitrov <freemangordon@....bg>
Subject: Re: [PATCH v2] Staging: tidspbridge: Use hashtable implementation


On 05.01.2014 21:47, Dan Carpenter wrote:
> Looks much nicer.  I had a few tiny comments, but those could be
> addressed in later patches.  (There is a lot of work to be done on this
> driver).
>
> On Sun, Jan 05, 2014 at 08:58:12PM +0200, Ivaylo Dimitrov wrote:
>> -static u16 name_hash(void *key, u16 max_bucket)
>> +static u32 name_hash(const void *key)
>>   {
>> -	u16 ret;
>> -	u16 hash;
>> -	char *name = (char *)key;
>> +	u32 hash;
>> +	const char *name = (const char *)key;
>                             ^^^^^^^^^^^^^^
>
> I can't compile this driver, but I'm pretty sure this cast is not
> needed.
>
>> -static bool name_match(void *key, void *sp)
>> +static bool name_match(const void *key, const void *sp)
>>   {
>>   	if ((key != NULL) && (sp != NULL)) {
>> -		if (strcmp((char *)key, ((struct dbll_symbol *)sp)->name) ==
>> -		    0)
>> +		if (strcmp((const char *)key,
>> +			   ((const struct dbll_symbol *)sp)->name) == 0)
>>   			return true;
> Unneeded casting.
>
> 		if (strcmp(key, ((struct dbll_symbol *)sp)->name) == 0)
> 			return true;
>
> regards,
> dan carpenter
Yeah, both are not needed (I am thinking C++ most of the time and have 
forgotten that C is much relaxed than C++ :) ). However, I will send a 
new version which fixes that, IMO it is better to fix it while I am on it.

Thanks,
Ivo
--
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