lkml.org 
[lkml]   [2018]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 5/8] vfio: ccw: Suppress unused event parameter
Date
The fsm_func_t function type definition does not need the event
parameter since all functions are in a state/event table.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
drivers/s390/cio/vfio_ccw_fsm.c | 24 ++++++++----------------
drivers/s390/cio/vfio_ccw_private.h | 5 ++---
2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/s390/cio/vfio_ccw_fsm.c b/drivers/s390/cio/vfio_ccw_fsm.c
index e672d14..2d55742 100644
--- a/drivers/s390/cio/vfio_ccw_fsm.c
+++ b/drivers/s390/cio/vfio_ccw_fsm.c
@@ -65,8 +65,7 @@ static int fsm_io_helper(struct vfio_ccw_private *private)
return ret;
}

-static int fsm_notoper(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_notoper(struct vfio_ccw_private *private)
{
struct subchannel *sch = private->sch;

@@ -81,29 +80,25 @@ static int fsm_notoper(struct vfio_ccw_private *private,
/*
* No operation action.
*/
-static int fsm_nop(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_nop(struct vfio_ccw_private *private)
{
return private->state;
}

-static int fsm_io_error(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_io_error(struct vfio_ccw_private *private)
{
pr_err("vfio-ccw: FSM: I/O request from state:%d\n", private->state);
private->io_region.ret_code = -EIO;
return private->state;
}

-static int fsm_io_busy(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_io_busy(struct vfio_ccw_private *private)
{
private->io_region.ret_code = -EBUSY;
return private->state;
}

-static int fsm_disabled_irq(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_disabled_irq(struct vfio_ccw_private *private)
{
struct subchannel *sch = private->sch;

@@ -118,8 +113,7 @@ static int fsm_disabled_irq(struct vfio_ccw_private *private,
/*
* Deal with the ccw command request from the userspace.
*/
-static int fsm_io_request(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_io_request(struct vfio_ccw_private *private)
{
union orb *orb;
struct ccw_io_region *io_region = &private->io_region;
@@ -160,8 +154,7 @@ static int fsm_io_request(struct vfio_ccw_private *private,
/*
* Got an interrupt for a normal io (state busy).
*/
-static int fsm_irq(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_irq(struct vfio_ccw_private *private)
{
struct irb *irb = &private->irb;

@@ -180,8 +173,7 @@ static int fsm_irq(struct vfio_ccw_private *private,
/*
* Got a sub-channel event .
*/
-static int fsm_sch_event(struct vfio_ccw_private *private,
- enum vfio_ccw_event event)
+static int fsm_sch_event(struct vfio_ccw_private *private)
{
unsigned long flags;
int ret = private->state;
diff --git a/drivers/s390/cio/vfio_ccw_private.h b/drivers/s390/cio/vfio_ccw_private.h
index a2be0c9..521ba0b 100644
--- a/drivers/s390/cio/vfio_ccw_private.h
+++ b/drivers/s390/cio/vfio_ccw_private.h
@@ -86,14 +86,13 @@ enum vfio_ccw_event {
/*
* Action called through jumptable.
*/
-typedef int (fsm_func_t)(struct vfio_ccw_private *, enum vfio_ccw_event);
+typedef int (fsm_func_t)(struct vfio_ccw_private *);
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)
{
- private->state = vfio_ccw_jumptable[private->state][event](private,
- event);
+ private->state = vfio_ccw_jumptable[private->state][event](private);
}

extern struct workqueue_struct *vfio_ccw_work_q;
--
2.7.4
\
 
 \ /
  Last update: 2018-06-12 09:58    [W:0.036 / U:2.952 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site