Received: by 10.192.165.156 with SMTP id m28csp803270imm; Thu, 19 Apr 2018 07:50:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/VPNek3XWvYoGMy78jhShDPUOU6jXBoQZ6L8V3dRqalPSP733+lhehDOdbM2CpDjooyMsH X-Received: by 10.99.103.6 with SMTP id b6mr5419072pgc.214.1524149413410; Thu, 19 Apr 2018 07:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524149413; cv=none; d=google.com; s=arc-20160816; b=EY0yYSXk4SreeAv6ew8A+9ZQ2ivy1rtI7p3jSQVy0G9AeuhJ3T93k4RmgDtLfP33Uk /hWtQ8X2d8nU0WFGeNqh6KUWlMhotC6ZtM4zPvoTgfEpNkXQyPmqju//FuwR12yNpuLR FiYpg5QJyp1fFKEl8WEjyWJ57ygTc7STKTBzubF1Jr/TiOHuAFsu/MnPy8S44vkUKoLf Qc4Zvxsh0CS4esoxzR6InwuM9DUB7k0aTY/I/Ivr2nZtP5Ky0Cfw2d1EbXVWK6S4m5Gn esMM70Z524JA5k4dPGPadW+l1IRyayBqTMCoDSpC78gj5QlvAuwCgbxUv5RE/hsxkdFK lTlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=Jkkb/EYBO1nQqJunWDDa5GSc9BuaT1vHjurZ6qD/pJ4=; b=Y36yenjoDm+5++L/kP8QFU+lA6Z/FENOaTWIHrXMjoFp1UmKfuJ6kbskrBHAWGSmu7 TQar5D/b5KI4CSxxHNK71IQUQMeDK0TwqBq66+MUajShSlBqFdHMqRzG7v/LNddPsPbv Nz/nDPu+8U9Ktb1uKWh0pRQJLBIZHnQN53AFWtuFnudOmxSHCdrX8Cd7b591q1fSXbw8 JGfb6rwcwL3hXi4nasjDCtDeARL9LX+cjIjGKUWwxJH8dhpAWBMitItYiCiC241Dnh0J A3WXjMMRz2oZVTi54mgp61dQQ5iOS8dlBPkjuKnpP05pwqoHmw6N3L8OD2di4lTCiNOT QCSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12-v6si3755182plr.131.2018.04.19.07.49.59; Thu, 19 Apr 2018 07:50:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753470AbeDSOss (ORCPT + 99 others); Thu, 19 Apr 2018 10:48:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45952 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752291AbeDSOsq (ORCPT ); Thu, 19 Apr 2018 10:48:46 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3JEmIaB072246 for ; Thu, 19 Apr 2018 10:48:45 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hev8gb6um-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 19 Apr 2018 10:48:44 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Apr 2018 15:48:22 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 19 Apr 2018 15:48:20 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3JEmKEO57540696; Thu, 19 Apr 2018 14:48:20 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8494552049; Thu, 19 Apr 2018 14:39:06 +0100 (BST) Received: from morel-ThinkPad-W530.boeblingen.de.ibm.com (unknown [9.152.224.146]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3EDDB52045; Thu, 19 Apr 2018 14:39:06 +0100 (BST) From: Pierre Morel To: pasic@linux.vnet.ibm.com, bjsdjshi@linux.vnet.ibm.com Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, cohuck@redhat.com Subject: [PATCH 05/10] vfio: ccw: Suppress unused event parameter Date: Thu, 19 Apr 2018 16:48:08 +0200 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524149293-12658-1-git-send-email-pmorel@linux.vnet.ibm.com> References: <1524149293-12658-1-git-send-email-pmorel@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18041914-0020-0000-0000-00000413BD36 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18041914-0021-0000-0000-000042A80A47 Message-Id: <1524149293-12658-6-git-send-email-pmorel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-19_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804190131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/s390/cio/vfio_ccw_fsm.c | 34 +++++++++++----------------------- drivers/s390/cio/vfio_ccw_private.h | 5 ++--- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/drivers/s390/cio/vfio_ccw_fsm.c b/drivers/s390/cio/vfio_ccw_fsm.c index f9855cd..f8ded70 100644 --- a/drivers/s390/cio/vfio_ccw_fsm.c +++ b/drivers/s390/cio/vfio_ccw_fsm.c @@ -55,8 +55,7 @@ static int fsm_io_helper(struct vfio_ccw_private *private) } } -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; @@ -65,36 +64,31 @@ static int fsm_notoper(struct vfio_ccw_private *private, * Probably we should send the machine check to the guest. */ css_sched_sch_todo(sch, SCH_TODO_UNREG); - private->state = VFIO_CCW_STATE_NOT_OPER; - return private->state; + return VFIO_CCW_STATE_NOT_OPER; } /* * 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; @@ -109,17 +103,14 @@ 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; + union orb *orb = (union orb *)io_region->orb_area; struct mdev_device *mdev = private->mdev; private->state = VFIO_CCW_STATE_BOXED; - orb = (union orb *)io_region->orb_area; - io_region->ret_code = cp_init(&private->cp, mdev_dev(mdev), orb); if (io_region->ret_code) goto err_out; @@ -139,15 +130,13 @@ static int fsm_io_request(struct vfio_ccw_private *private, return VFIO_CCW_STATE_BUSY; err_out: - private->state = VFIO_CCW_STATE_IDLE; - return private->state; + return VFIO_CCW_STATE_IDLE; } /* * 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; @@ -166,8 +155,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 93aab87..823e46c 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