Re: CVS commit: src/sbin/atactl

2011-10-24 Thread Jukka Ruohonen
On Mon, Oct 24, 2011 at 07:13:04PM +, Jonathan A. Kollasch wrote:
> Module Name:  src
> Committed By: jakllsch
> Date: Mon Oct 24 19:13:04 UTC 2011
> 
> Modified Files:
>   src/sbin/atactl: atactl.c
> 
> Log Message:
> constify

Can you follow common style guidelines and wrap longs line to 80 characters?
Those long lines are painful to read with many editors.

- Jukka.



Re: CVS commit: src/sys/kern

2011-10-24 Thread Jean-Yves Migeon

On 24.10.2011 03:53, YAMAMOTO Takashi wrote:

Log Message:
Turn a workqueue(9) name into an array in the struct workqueue, rather
than a const char *. This avoids keeping a reference to a string
owned by caller (string could be allocated on stack).


what needs it?


Me, in a not-so-distant future. The purpose of this change is to allow 
passing strings that could be constructed that way:


char name[16];
...
snprintf(name, sizeof(name), "xbdback%d.%d", domid, instance);
workqueue_create(&foo, name, funcfoo, NULL, PRI_NONE, SPL_BIO, 0);

I'd like to construct workqueues based on a context; the old code does 
not permit that, unless you build and store the string somewhere, 
forcing the caller to *know* that it only keeps a pointer and does not 
copy the content. This will get misused, sooner or later.


--
Jean-Yves Migeon
jeanyves.mig...@free.fr