Re: [PATCH v1 2/7] vfio/ccw: remove private->sch

Matthew Rosato
2022-10-28T18:43:54Z

On 10/19/22 12:21 PM, Eric Farman wrote:
> These places all rely on the ability to jump from a private
> struct back to the subchannel struct. Rather than keeping a
> copy in our back pocket, let's use the relationship provided
> by the vfio_device embedded within the private.
>
> Signed-off-by: Eric Farman <farman@linux.ibm.com>
> ---
> drivers/s390/cio/vfio_ccw_chp.c | 5 +++--
> drivers/s390/cio/vfio_ccw_drv.c | 3 +--
> drivers/s390/cio/vfio_ccw_fsm.c | 27 ++++++++++++---------------
> drivers/s390/cio/vfio_ccw_ops.c | 12 ++++++------
> drivers/s390/cio/vfio_ccw_private.h | 7 ++++---
> 5 files changed, 26 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/s390/cio/vfio_ccw_chp.c b/drivers/s390/cio/vfio_ccw_chp.c
> index 13b26a1c7988..d3f3a611f95b 100644
> --- a/drivers/s390/cio/vfio_ccw_chp.c
> +++ b/drivers/s390/cio/vfio_ccw_chp.c
> @@ -16,6 +16,7 @@ static ssize_t vfio_ccw_schib_region_read(struct vfio_ccw_private *private,
> char __user *buf, size_t count,
> loff_t *ppos)
> {
> + struct subchannel *sch = to_subchannel(private->vdev.dev->parent);

I'm not a big fan of the amount of indirection there, but I prefer this over back-pocketing the subchannel in vfio_ccw_private anyway

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>