All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Holmstedt <christoffer@christofferholmstedt.se>
To: Alexander Aring <alex.aring@gmail.com>
Cc: linux-wpan@vger.kernel.org
Subject: Re: [PATCH v4 wpan-tools] info: update CCA mode and CCA options output
Date: Thu, 11 Jun 2015 10:13:50 +0200	[thread overview]
Message-ID: <20150611081350.GA5265@arazu> (raw)
In-Reply-To: <20150611074206.GA972@omega>

On Thu, Jun 11, 2015 at 09:42:10AM +0200, Alexander Aring wrote:
> On Thu, Jun 11, 2015 at 08:16:33AM +0200, Christoffer Holmstedt wrote:
> > On Wed, Jun 10, 2015 at 03:45:31PM +0200, Alexander Aring wrote:
...cut...
> > > 
> > > The function print_cca_mode_handler should be a helper function only to
> > > place the cca description inside the cca_mode_buf and it can be used
> > > until the next call of print_cca_mode_handler by printf or something
> > > else.
> > > 
> > > - Alex
> > 
> > This new solution makes much more sense to me. The first implementation was
> > inspired by *iftype_name() from interface.c, perhaps that should be refactored
> > as well.
> > 
> 
> then better maybe would be to leave the return value as "const char *"
> there and returning the buffer. Just if you need to "bake" some string
> with an format string, then use the temp buffer and build your string and
> return the buffer.
> 
> If it's just a "const char *" then just 'return "foobar";'  but this
> isn't your case here because you want to put some numbers in there, for
> cca handling.
> 
> It's just:
> The return of the temporary buffer allows us to use the helper printout
> functionality also from another c-file when the buffer is declared as
> static buffer.
> 
> - Alex

aah, yes accessing the value from other files.

Not sure about the first two paragraphs though...a patch is coming up (separate
email) for info.c and if needed interface.c can be discussed yet in another
thread.

-- 
Christoffer Holmstedt

  reply	other threads:[~2015-06-11  8:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04  9:20 [PATCH wpan-tools 0/2] Update cca mode and options output Christoffer Holmstedt
2015-06-04 11:02 ` Alexander Aring
2015-06-04 11:24   ` Christoffer Holmstedt
2015-06-04 11:51 ` Varka Bhadram
2015-06-04 12:12   ` Christoffer Holmstedt
2015-06-09 14:05 ` [PATCH v2 wpan-tools 0/2] Update CCA mode and CCA " christoffer
2015-06-09 14:05   ` [PATCH v2 wpan-tools 1/2] info: add cca mode descriptive text to output christoffer
2015-06-09 14:05   ` [PATCH v2 wpan-tools 2/2] info: remove old cca options capabilities output christoffer
2015-06-10 11:18 ` [PATCH v3 wpan-tools 0/3] Update CCA mode and CCA options output Christoffer Holmstedt
2015-06-10 11:18   ` [PATCH v3 wpan-tools 1/3] info: add cca mode descriptive text to output Christoffer Holmstedt
2015-06-10 12:17     ` Alexander Aring
2015-06-10 12:29       ` Christoffer Holmstedt
2015-06-10 12:39       ` [PATCH wpan-tools] nl802154: fix misspelled enum Christoffer Holmstedt
2015-06-10 12:42         ` Alexander Aring
2015-06-10 13:07       ` [PATCH v4 wpan-tools] info: update CCA mode and CCA options output Christoffer Holmstedt
2015-06-10 13:45         ` Alexander Aring
2015-06-11  6:16           ` Christoffer Holmstedt
2015-06-11  7:42             ` Alexander Aring
2015-06-11  8:13               ` Christoffer Holmstedt [this message]
2015-06-11  8:16         ` [PATCH v5 " Christoffer Holmstedt
2015-06-11 10:14         ` [PATCH v4 " Alexander Aring
2015-06-11 11:14           ` Christoffer Holmstedt
2015-06-11 12:25           ` [PATCH v6 " Christoffer Holmstedt
2015-06-11 13:28             ` Alexander Aring
2015-06-10 11:18   ` [PATCH v3 wpan-tools 2/3] info: remove old cca options capabilities output Christoffer Holmstedt
2015-06-10 11:18   ` [PATCH v3 wpan-tools 3/3] nl802154: fix misspelled enum Christoffer Holmstedt

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=20150611081350.GA5265@arazu \
    --to=christoffer@christofferholmstedt.se \
    --cc=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.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.