All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Alejandro Lucero
	<alejandro.lucero-wFxRvT7yatFl57MIdRCFDg@public.gmane.org>,
	dev <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: ret_pktmbuf_pool_init problem with opaque_arg
Date: Fri, 09 Jan 2015 15:28:30 +0100	[thread overview]
Message-ID: <54AFE58E.50009@6wind.com> (raw)
In-Reply-To: <CAD+H9911EO_0J_GRt34j-ugOSqeJo-QobNYc_cMe+52kvXLEfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Alejandro,

On 01/09/2015 03:12 PM, Alejandro Lucero wrote:
> Inside this function mbuf_data_room_size is set to a default value if
> opaque_arg is null and it should be set to the value pointed by opaque_arg
> if not null. Current implementation is using not the value but with the
> pointer itself. I think this:
> 
>         roomsz = (uint16_t)(uintptr_t)opaque_arg;
> 
> should be something like this:
> 
>         roomsz = *(uint16_t *)opaque_arg;
> 

In this particular case, the integer value is stored in the pointer
value: the pointer is not used as a pointer but as an integer. I agree
it can be surprising, but I think the code is correct.

Regards,
Olivier

  parent reply	other threads:[~2015-01-09 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 14:12 ret_pktmbuf_pool_init problem with opaque_arg Alejandro Lucero
     [not found] ` <CAD+H9911EO_0J_GRt34j-ugOSqeJo-QobNYc_cMe+52kvXLEfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-09 14:28   ` Olivier MATZ [this message]
     [not found]     ` <54AFE58E.50009-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2015-01-09 14:38       ` Alejandro Lucero
2015-01-09 22:42   ` Stephen Hemminger

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=54AFE58E.50009@6wind.com \
    --to=olivier.matz-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=alejandro.lucero-wFxRvT7yatFl57MIdRCFDg@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.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 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.