svn commit: r213725 - head/sys/fs/devfs

Bruce Evans brde at optusnet.com.au
Wed Oct 13 00:56:26 UTC 2010


On Tue, 12 Oct 2010, Jaakko Heinonen wrote:

> Log:
>  Format prototypes to follow style(9) more closely.
>
>  Discussed with:	kib, phk

Thanks, but style(9) says "The kernel has a name associated with
parameter types [sic]", and the old prototypes mostly used named
parameters.  [The reason for this rule is that it is normal to name
parameters in prototypes, and this was done in about half the cases
in the kernel, while in userland some programmers don't like and/or
understand the underscores necessary to keep parameter names in the
implementation namespace, and named parameters were used in less than
half the cases outside of the kernel and many of those were broken,
so the rule was that "Only the kernel has a name associated with the
types", and although I changed style(9) to say to prefer names in the
implementation namespace in userland, style(9) is rarely read and more
rarely followed, so no one noticed my change :-).]

> Modified: head/sys/fs/devfs/devfs.h
> ==============================================================================
> --- head/sys/fs/devfs/devfs.h	Tue Oct 12 15:48:27 2010	(r213724)
> +++ head/sys/fs/devfs/devfs.h	Tue Oct 12 15:58:52 2010	(r213725)
> @@ -178,22 +178,25 @@ extern unsigned devfs_rule_depth;
> #define	DEVFS_DEL_VNLOCKED	0x01
> #define	DEVFS_DEL_NORECURSE	0x02
>
> -void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de);
> -void devfs_rules_cleanup (struct devfs_mount *dm);
> -int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td);
> -int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode,
> -    struct vnode **vpp);
> -char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *,
> -    struct componentname *);
> ...
> +void	devfs_rules_apply(struct devfs_mount *, struct devfs_dirent *);
> +void	devfs_rules_cleanup(struct devfs_mount *);
> +int	devfs_rules_ioctl(struct devfs_mount *, u_long, caddr_t,
> +	    struct thread *);
> +int	devfs_allocv(struct devfs_dirent *, struct mount *, int,
> +	    struct vnode **);
> +char	*devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *,
> +	    struct componentname *);

It was just ugly to use parameter names in some places but not others.
They were missing mainly for the last function quoted above.

Bruce


More information about the svn-src-head mailing list