Re: [PATCH 7/7] [v4] drivers/virt: introduce Freescale hypervisor management driver

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

 



On Thursday 09 June 2011 00:45:54 Timur Tabi wrote:
> +struct fsl_hv_ioctl_memcpy {
> +       __u32 ret;
> +       __u32 source;
> +       __u32 target;
> +       __u64 local_vaddr;
> +       __u64 remote_paddr;
> +       __u64 count;
> +};

> +struct fsl_hv_ioctl_prop {
> +       __u32 ret;
> +       __u32 handle;
> +       __u64 path;
> +       __u64 propname;
> +       __u64 propval;
> +       __u32 proplen;
> +};

These structures have implied padding. Better make it explicit by
adding the appropriate __u32 __pad1 members or similar.

> +/*
> + * ioctl commands.
> + */
> +enum {
> +       FSL_HV_IOCTL_PARTITION_RESTART = 1, /* Boot another partition */
> +       FSL_HV_IOCTL_PARTITION_GET_STATUS = 2, /* Boot another partition */
> +       FSL_HV_IOCTL_PARTITION_START = 3, /* Boot another partition */
> +       FSL_HV_IOCTL_PARTITION_STOP = 4, /* Stop this or another partition */
> +       FSL_HV_IOCTL_MEMCPY = 5, /* Copy data from one partition to another */
> +       FSL_HV_IOCTL_DOORBELL = 6, /* Ring a doorbell */
> +
> +       /* Get a property from another guest's device tree */
> +       FSL_HV_IOCTL_GETPROP = 7,
> +
> +       /* Set a property in another guest's device tree */
> +       FSL_HV_IOCTL_SETPROP = 8,
> +};

As discussed before, this one should really be using the _IOC macros to define
the commands that you use based on the structure definitions above, e.g.

#define FSL_HV_IOCTL_GETPROP _IORW(FSL_HV, 8, struct fsl_hv_ioctl_prop)

Then get rid of all the code that takes apart the ioctl command numbers
again and just do a switch/case based on the command.

	Arnd

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-console" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Fedora Users]

  Powered by Linux