Source-Changes-D archive

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

Re: CVS commit: src/sys/kern



On Wed, Aug 19, 2015 at 5:31 AM, matthew green <mrg%eterna.com.au@localhost> wrote:
> "Masao Uebayashi" writes:
>> Module Name:  src
>> Committed By: uebayasi
>> Date:         Tue Aug 18 13:46:20 UTC 2015
>>
>> Modified Files:
>>       src/sys/kern: kern_cpu.c kern_drvctl.c
>>
>> Log Message:
>> Convert pseudo attach functions to take no arguments, as some functions
>> (pppattach(), putterattach(), etc.) already do.  This means that pseudo
>> attach function will be able to become a constructor.
>
> how does this work?
>
> these functions are called by ioconf.c that generated by config(1),
> so i'm not sure how this can not be a build break, or at least a
> confusing and inconsistent.
>
> ioconf.c:void drvctlattach(int);
> ioconf.c:const struct pdevinit pdevinit[] = {
> ...
> ioconf.c:       { drvctlattach, 1 },
>
> subr_autoconf.c:     for (pdev = pdevinit; pdev->pdev_attach != NULL; pdev++)
> subr_autoconf.c:             (*pdev->pdev_attach)(pdev->pdev_count);
>
> what's the plan here?  this reduction won't work for a number of
> basic pdevs (like raid(4)) without updating it to not use the
> count argument.

o I admit I did not check all, but 95% of pseudo attach functions do
not use `int n'.

o I assume that passing an `int' that is ignored by the callee
(func(void)) has proven to be harmless on all CPUs, because it has
worked.

o Killing `int n' is good for reducing kernel build complexity, and
reducing combinations of kernel configs.

o I am (too) optimistic that those pseudo attach functions that use
`int n' can be converted rather easily.

o For the first step, make it clear which functions use `int n' and not.

o If you are really unhappy of the `(void)', I can use `int n __unused'.


Home | Main Index | Thread Index | Old Index