Re: [PATCH v4 wpan-tools] info: update CCA mode and CCA options output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux