linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: Pavel Roskin <proski@gnu.org>
Cc: lrodriguez@atheros.com, linux-wireless@vger.kernel.org,
	mcgrof@infradead.org
Subject: Re: [PATCH 1/3] compat-wireless: backport convert multicast list to list_head.
Date: Mon, 19 Apr 2010 20:32:57 +0200	[thread overview]
Message-ID: <4BCCA1D9.30208@hauke-m.de> (raw)
In-Reply-To: <20100418101514.q7rwgz9zwgk8sg0k-cebfxv@webmail.spamcop.net>

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

Hi Pavel,

thank you for your comments on this.
Pavel Roskin wrote:
> Hello, Hauke!
> 
> Thank you for doing this effort!  I would prefer that we avoid patching
> as much as possible.  Patches tend to break as the code changes.  I
> think there are several cases where patching can be eliminated.
> 
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +     struct netdev_hw_addr *ha;
>> ++#else
>> ++    struct dev_mc_list *ha;
>> ++#endif
> 
> We could simply use this in some header:
> 
> #define dev_mc_list netdev_hw_addr
This will be possible, but as I see, only in some easy parts where the
patch looks like the quote above.
I will change that and resend this patch.
> 
>> +     /* comoute mc addresses' hash value ,and put it into hash table */
> 
> Someone had a bout of dyslexia, and it will be fixed, breaking the patch
> :-)
> 
>> +     netdev_for_each_mc_addr(ha, netdev) {
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +         hash_value = atl1c_hash_mc_addr(hw, ha->addr);
>> ++#else
>> ++        hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
>> ++#endif
> 
> #define addr dmi_addr
> 
> OK, this is likely to break if done in a header, but maybe it could be
> done in the C code away from the rest of the code.
I think the if defs are better than a conditional define in every file
that needs it. It will result in strange compile errors if someone uses
addr for an other addresses.
> 
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +     __hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
>> ++#else
>> ++    __dev_addr_unsync(&local->mc_list, &local->mc_count,
>> ++              &dev->mc_list, &dev->mc_count);
>> ++#endif
> 
> Cannot we reimplement __hw_addr_unsync()?
This change depends on some changes structs in
net/mac80211/ieee80211_i.h I do not see a way to reimplement this.
> 
>> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
>> +
>> +     __hw_addr_init(&local->mc_list);
>> +
>> ++#endif
> 
> That could be an empty function.
Yes that could be done, but I think it is much more clear to use this
patch here, because we do not need __hw_addr_init, because
local->mc_list is of a completely different type.

Hauke


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 898 bytes --]

  reply	other threads:[~2010-04-19 18:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-18 13:36 [PATCH 0/3] compat-wireless: compile fixes Hauke Mehrtens
2010-04-18 13:36 ` [PATCH 1/3] compat-wireless: backport convert multicast list to list_head Hauke Mehrtens
2010-04-18 14:15   ` Pavel Roskin
2010-04-19 18:32     ` Hauke Mehrtens [this message]
2010-04-19 20:06       ` [PATCH v2] compat: " Hauke Mehrtens
2010-04-20  0:25         ` Luis R. Rodriguez
2010-04-19 20:06       ` [PATCH v2 1/3] compat-wireless: " Hauke Mehrtens
2010-04-18 13:36 ` [PATCH 2/3] compat-wireless: Remove use of sdio quirks attribute Hauke Mehrtens
2010-04-18 13:36 ` [PATCH 3/3] compat-wireless: include net and trace includes form compat Hauke Mehrtens

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=4BCCA1D9.30208@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    --cc=mcgrof@infradead.org \
    --cc=proski@gnu.org \
    /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).