All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Cc: gregkh@linuxfoundation.org, omar.ramirez@copitl.com,
	pali.rohar@gmail.com, pavel@ucw.cz, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org,
	Ivaylo Dimitrov <freemangordon@abv.bg>
Subject: Re: [PATCH v2] Staging: tidspbridge: Use hashtable implementation
Date: Sun, 5 Jan 2014 22:47:53 +0300	[thread overview]
Message-ID: <20140105194752.GF5443@mwanda> (raw)
In-Reply-To: <1388948292-5084-1-git-send-email-ivo.g.dimitrov.75@gmail.com>

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

  reply	other threads:[~2014-01-05 19:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-25 17:29 [PATCH] Staging: tidspbridge: Use hashtable implementation Ivaylo DImitrov
2013-12-27  9:45 ` Pavel Machek
2013-12-27 15:58   ` [PATCH v2] " Ivaylo Dimitrov
2014-01-02 15:00     ` Dan Carpenter
2014-01-02 13:46 ` [PATCH] " Dan Carpenter
     [not found]   ` <52C9AAB3.6050300@gmail.com>
2014-01-05 18:58     ` [PATCH v2] " Ivaylo Dimitrov
2014-01-05 19:47       ` Dan Carpenter [this message]
2014-01-05 23:14         ` Ivaylo Dimitrov
2014-01-05 23:17         ` [PATCH v3] " Ivaylo Dimitrov
2014-01-05 21:18     ` [PATCH] " Dan Carpenter

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=20140105194752.GF5443@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=freemangordon@abv.bg \
    --cc=gregkh@linuxfoundation.org \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=omar.ramirez@copitl.com \
    --cc=pali.rohar@gmail.com \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.