Re: [PATCH v2] Staging: tidspbridge: Use hashtable implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux