Re: [PATCH v1 06/18] vfio/ccw: Pass enum to FSM event jumptable

Matthew Rosato
2022-06-02T19:22:22Z

On 6/2/22 1:19 PM, Eric Farman wrote:
> The FSM has an enumerated list of events defined.
> Use that as the argument passed to the jump table,
> instead of a regular int.
>
> Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
> Fixes: bbe37e4cb8970 ("vfio: ccw: introduce a finite state machine")

Not sure if this change really merits a fixes tag

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

> Signed-off-by: Eric Farman <farman@linux.ibm.com>
> ---
> drivers/s390/cio/vfio_ccw_private.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h
> index 12b5537d478f..5c128eec596b 100644
> --- a/drivers/s390/cio/vfio_ccw_private.h
> +++ b/drivers/s390/cio/vfio_ccw_private.h
> @@ -156,7 +156,7 @@ typedef void (fsm_func_t)(struct vfio_ccw_private *, enum vfio_ccw_event);
> extern fsm_func_t *vfio_ccw_jumptable[NR_VFIO_CCW_STATES][NR_VFIO_CCW_EVENTS];
>
> static inline void vfio_ccw_fsm_event(struct vfio_ccw_private *private,
> - int event)
> + enum vfio_ccw_event event)
> {
> trace_vfio_ccw_fsm_event(private->sch->schid, private->state, event);
> vfio_ccw_jumptable[private->state][event](private, event);