linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: thomas <thomas@net.t-labs.tu-berlin.de>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net,
	nbd@openwrt.org
Subject: Re: [PATCH] mac80211: correct size the argument to kzalloc in minstrel_ht
Date: Thu, 28 Jun 2012 22:00:41 -0700	[thread overview]
Message-ID: <4FED3679.4080107@net.t-labs.tu-berlin.de> (raw)
In-Reply-To: <CAGRGNgXCoQNYbs7MVtEsDdoPUgvV+JDP28tCbKWG2cBHcJ60kQ@mail.gmail.com>

Hi Julian,

Compiler wise both of our suggestions will lead to the same machine code.
So beside the matter of taste, I just followed the other overall usage
pattern of kzalloc in minstrel_ht.
And it seems to be explicitly using the struct type.

Bye Thomas

Julian Calaby schrieb:
> Hi Thomas,
>
> On Fri, Jun 29, 2012 at 9:28 AM, Thomas Huehn
> <thomas@net.t-labs.tu-berlin.de> wrote:
>> msp has type struct minstrel_ht_sta_priv not struct minstrel_ht_sta.
>>
>> Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
>> ---
>>  net/mac80211/rc80211_minstrel_ht.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
>> index 2d1acc6..dc2b801 100644
>> --- a/net/mac80211/rc80211_minstrel_ht.c
>> +++ b/net/mac80211/rc80211_minstrel_ht.c
>> @@ -809,7 +809,7 @@ minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
>>                        max_rates = sband->n_bitrates;
>>        }
>>
>> -       msp = kzalloc(sizeof(struct minstrel_ht_sta), gfp);
>> +       msp = kzalloc(sizeof(struct minstrel_ht_sta_priv), gfp);
>
> Why not use sizeof(*msp)?
>
> Thanks,
>

  reply	other threads:[~2012-06-29  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28 23:28 [PATCH] mac80211: correct size the argument to kzalloc in minstrel_ht Thomas Huehn
2012-06-29  1:04 ` Julian Calaby
2012-06-29  5:00   ` thomas [this message]
2012-06-29  7:50     ` Schrober
2012-06-29 13:15       ` thomas

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=4FED3679.4080107@net.t-labs.tu-berlin.de \
    --to=thomas@net.t-labs.tu-berlin.de \
    --cc=johannes@sipsolutions.net \
    --cc=julian.calaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@openwrt.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).