From: Ivan Vecera <ivecera@redhat.com>
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, rasesh.mody@qlogic.com
Subject: Re: [PATCH net-next 01/19] bna: use ether_addr_copy instead of memcpy
Date: Thu, 11 Jun 2015 15:31:11 +0200 [thread overview]
Message-ID: <55798D9F.8020309@redhat.com> (raw)
In-Reply-To: <1433959033.32331.16.camel@perches.com>
On 06/10/2015 07:57 PM, Joe Perches wrote:
> On Wed, 2015-06-10 at 18:43 +0200, Ivan Vecera wrote:
>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>
> Have you verified that all of these are __aligned(2)?
>
> I haven't, but you should verify that you have in the
> commit log.
I have checked an alignment of all instances and they are all aligned
properly... An exception is global variable bnad_bcast_addr, its
alignment is 1 according __alignof__ but according generated assembly it
is aligned to 2. Anyway I'm going to put __aligned directive for sure.
> btw: this use looks odd to me:
>
> static int
> bnad_set_mac_address(struct net_device *netdev, void *mac_addr)
> {
> int err;
> struct bnad *bnad = netdev_priv(netdev);
> struct sockaddr *sa = (struct sockaddr *)mac_addr;
> unsigned long flags;
>
> spin_lock_irqsave(&bnad->bna_lock, flags);
>
> err = bnad_mac_addr_set_locked(bnad, sa->sa_data);
>
> as it casts what seems to be a mac address to a
> sockaddr and uses a different offset for sa->sa_data
> than the mac_addr passed.
>
> and the mac_addr as it's void doesn't need a cast.
No, bnad_set_mac_address() is an implementation of
.ndo_set_mac_address() and this is called with pointer to struct
sockaddr. The mac_addr name is a little bit confusing.
Will post v2.
Ivan
next prev parent reply other threads:[~2015-06-11 13:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 16:43 [PATCH net-next 00/19] bna: clean-up Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 01/19] bna: use ether_addr_copy instead of memcpy Ivan Vecera
2015-06-10 17:57 ` Joe Perches
2015-06-11 13:31 ` Ivan Vecera [this message]
2015-06-10 16:43 ` [PATCH net-next 02/19] bna: get rid of mac_t Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 03/19] bna: replace pragma(pack) with attribute __packed Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 04/19] bna: get rid of duplicate and unused macros Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 05/19] bna: use BIT(x) instead of (1 << x) Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 06/19] bna: remove unused cbfn parameter Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 07/19] bna: remove pause_cbfn from struct bna_enet Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 08/19] bna: remove oper_state_cbfn from struct bna_rxf Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 09/19] bna: remove prio_change_cbfn oper_state_cbfn from struct bna_tx Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 10/19] bna: remove RXF_E_PAUSE and RXF_E_RESUME events Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 11/19] bna: remove paused from bna_rx_config and flags from bna_rxf Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 12/19] bna: remove TX_E_PRIO_CHANGE event and BNA_TX_F_PRIO_CHANGED flag Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 13/19] bna: correct comparisons/assignments to bool Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 14/19] bna: use memdup_user to copy userspace buffers Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 15/19] bna: remove useless pointer assignment Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 16/19] bna: get rid of private macros for manipulation with lists Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 17/19] bna: use list_for_each_entry where appropriate Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 18/19] bna: fix timeout API argument type Ivan Vecera
2015-06-10 16:43 ` [PATCH net-next 19/19] bna: use netdev_* and dev_* instead of printk and pr_* Ivan Vecera
2015-06-10 20:29 ` Joe Perches
2015-06-11 9:43 ` Ivan Vecera
2015-06-11 16:36 ` Joe Perches
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=55798D9F.8020309@redhat.com \
--to=ivecera@redhat.com \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=rasesh.mody@qlogic.com \
/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).