From nobody Sat Feb 7 22:54:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1589459950; cv=none; d=zohomail.com; s=zohoarc; b=JxdFS/ABWOOqmMgCr1oCKRW8HZ+492ihn66+G+ByBJIzH2TcPBc8pD9ij9c97uOwpqKGEDFD04tqLwuXQUgdiwOsfUKS0aee4kXheaKG8J/6lCCZ3K+CyBUvh5LJNWspyBlTjHwwykMJrEGBxUl4oeYRIsbTqUQ7Jjmna6mlciE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589459950; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/MS6Q7aNYgCHZXSXnhPRBPv767Ql7xcvPqoF9e35T+g=; b=P6oU04KtUUtrkCjlez/SOhXHeZuGv2Rg+U23I5K5hEtyo0aN4gtQNHOqbMika+wpF+2UOp3IF+vBIzIg3T+X8R4NylOSXHt7TPDLnKsDNLsnhvd/yqfP4zWPzBvZtaHLYWUJYJ4Z3YIstabknsfGAD3G8S8HcWqTKwNpKJWYwlM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589459950215849.1546599519922; Thu, 14 May 2020 05:39:10 -0700 (PDT) Received: from localhost ([::1]:37054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZD8m-0004x6-OO for importer@patchew.org; Thu, 14 May 2020 08:39:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7O-0003Dm-Mq; Thu, 14 May 2020 08:37:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZD7N-0006UU-CA; Thu, 14 May 2020 08:37:42 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04ECW3GX065832; Thu, 14 May 2020 08:37:39 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 310syx24t7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:39 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04ECWo50072201; Thu, 14 May 2020 08:37:38 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 310syx24sd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 08:37:38 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04ECZN5R007631; Thu, 14 May 2020 12:37:36 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03ams.nl.ibm.com with ESMTP id 3100ubbn7s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 12:37:36 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04ECaM5b58720522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 12:36:22 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EFA2BA4054; Thu, 14 May 2020 12:37:33 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DAD3A4060; Thu, 14 May 2020 12:37:33 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 12:37:33 +0000 (GMT) From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 1/9] pc-bios: s390x: cio.c cleanup and compile fix Date: Thu, 14 May 2020 08:37:21 -0400 Message-Id: <20200514123729.156283-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200514123729.156283-1-frankja@linux.ibm.com> References: <20200514123729.156283-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-14_02:2020-05-14, 2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=1 spamscore=0 bulkscore=0 impostorscore=0 cotscore=-2147483648 phishscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=602 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140109 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.156.1; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 07:20:14 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, KHOP_DYNAMIC=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: borntraeger@de.ibm.com, qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Let's initialize the structs at the beginning to ease reading and also zeroing all other fields. This also makes the compiler stop compalining about sense_id_ccw.flags being ored into when it's not initialized. Signed-off-by: Janosch Frank Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- pc-bios/s390-ccw/cio.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c index 339ec5fbe7..63301ebb58 100644 --- a/pc-bios/s390-ccw/cio.c +++ b/pc-bios/s390-ccw/cio.c @@ -49,13 +49,13 @@ void enable_subchannel(SubChannelId schid) =20 uint16_t cu_type(SubChannelId schid) { - Ccw1 sense_id_ccw; SenseId sense_data; - - sense_id_ccw.cmd_code =3D CCW_CMD_SENSE_ID; - sense_id_ccw.cda =3D ptr2u32(&sense_data); - sense_id_ccw.count =3D sizeof(sense_data); - sense_id_ccw.flags |=3D CCW_FLAG_SLI; + Ccw1 sense_id_ccw =3D { + .cmd_code =3D CCW_CMD_SENSE_ID, + .count =3D sizeof(sense_data), + .flags =3D CCW_FLAG_SLI, + .cda =3D ptr2u32(&sense_data), + }; =20 if (do_cio(schid, CU_TYPE_UNKNOWN, ptr2u32(&sense_id_ccw), CCW_FMT1)) { panic("Failed to run SenseID CCw\n"); @@ -67,13 +67,13 @@ uint16_t cu_type(SubChannelId schid) int basic_sense(SubChannelId schid, uint16_t cutype, void *sense_data, uint16_t data_size) { - Ccw1 senseCcw; + Ccw1 senseCcw =3D { + .cmd_code =3D CCW_CMD_BASIC_SENSE, + .count =3D data_size, + .cda =3D ptr2u32(sense_data), + }; Irb irb; =20 - senseCcw.cmd_code =3D CCW_CMD_BASIC_SENSE; - senseCcw.cda =3D ptr2u32(sense_data); - senseCcw.count =3D data_size; - return __do_cio(schid, ptr2u32(&senseCcw), CCW_FMT1, &irb); } =20 @@ -314,7 +314,13 @@ static void print_irb_err(Irb *irb) */ static int __do_cio(SubChannelId schid, uint32_t ccw_addr, int fmt, Irb *i= rb) { - CmdOrb orb =3D {}; + CmdOrb orb =3D { + .fmt =3D fmt, + .pfch =3D 1, /* QEMU's cio implementation requires prefetch */ + .c64 =3D 1, /* QEMU's cio implementation requires 64-bit idaws */ + .lpm =3D 0xFF, /* All paths allowed */ + .cpa =3D ccw_addr, + }; int rc; =20 IPL_assert(fmt =3D=3D 0 || fmt =3D=3D 1, "Invalid ccw format"); @@ -324,12 +330,6 @@ static int __do_cio(SubChannelId schid, uint32_t ccw_a= ddr, int fmt, Irb *irb) IPL_assert(ccw_addr <=3D 0xFFFFFF - 8, "Invalid ccw address"); } =20 - orb.fmt =3D fmt; - orb.pfch =3D 1; /* QEMU's cio implementation requires prefetch */ - orb.c64 =3D 1; /* QEMU's cio implementation requires 64-bit idaws */ - orb.lpm =3D 0xFF; /* All paths allowed */ - orb.cpa =3D ccw_addr; - rc =3D ssch(schid, &orb); if (rc =3D=3D 1 || rc =3D=3D 2) { /* Subchannel status pending or busy. Eat status and ask for retry= . */ --=20 2.25.1