From: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
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: Mon, 06 Jan 2014 01:14:59 +0200 [thread overview]
Message-ID: <52C9E773.5080207@gmail.com> (raw)
In-Reply-To: <20140105194752.GF5443@mwanda>
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
next prev parent reply other threads:[~2014-01-05 23:15 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
2014-01-05 23:14 ` Ivaylo Dimitrov [this message]
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=52C9E773.5080207@gmail.com \
--to=ivo.g.dimitrov.75@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=freemangordon@abv.bg \
--cc=gregkh@linuxfoundation.org \
--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 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).