From nobody Tue Nov 26 12:47:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1707909487; cv=none; d=zohomail.com; s=zohoarc; b=KZ+e5py/+Rgl5pYR0srooxv7Wep2dpAJRcOMifih+USh5Nw4h2MTrLAXFPTDMVpcFn7hOLzVCWoeXNibohPSy25FexstWSBq4crI76wON9HmPpoDaHMG07mex8hDNRVIbq7YRZ9V0mf4bUi1wXRdv5FJfg7XQ5jJn1vUneLXngs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707909487; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ny9ujC/q8Uoo9V1VXsX5vJYsw7EaDLr3xTeRBTEHjis=; b=BbO89LcZb9ejSQABlE7IxKRcpA3w7ezr7PXMihadmscj+ySfCWjMavEe93Dn1rSQbhL8Oq3qcU8EegvbBXh9nFOBeaNkr9IKZ0keULZJ3xBmZTjfFs6md9cd+fjPnU61gm6eyZ4SiH8tD9wcxDCpZYO3wof7LG268vatHHXQmy8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707909487827789.2032333044742; Wed, 14 Feb 2024 03:18:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raDFQ-0005gz-OG; Wed, 14 Feb 2024 06:16:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDEl-0004JE-8J for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:15:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raDEj-0007FY-Cm for qemu-devel@nongnu.org; Wed, 14 Feb 2024 06:15:34 -0500 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-NdPGabwQN2uSuwmIDfQ60Q-1; Wed, 14 Feb 2024 06:15:31 -0500 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a2bc664528fso403759766b.3 for ; Wed, 14 Feb 2024 03:15:30 -0800 (PST) Received: from redhat.com ([2.52.26.67]) by smtp.gmail.com with ESMTPSA id ca23-20020a170906a3d700b00a3caccb8f66sm2209113ejb.44.2024.02.14.03.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707909332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ny9ujC/q8Uoo9V1VXsX5vJYsw7EaDLr3xTeRBTEHjis=; b=GAj8Yx7i2rOBXX8LrhA6zcmw4aLKSqCngindw/HAw7/zxK3VtfryOuIoX+KPN+6D3LqGm6 zHxxRHwG077GxMw1eR1+UHvVRpBYlCwQnQlWTDJyrhW3JtMaantpDhqhEdxBqTr/c/FyKj QvRz+9kqCxdImGh6dp9nDk1q71cmB50= X-MC-Unique: NdPGabwQN2uSuwmIDfQ60Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707909329; x=1708514129; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ny9ujC/q8Uoo9V1VXsX5vJYsw7EaDLr3xTeRBTEHjis=; b=WpFxN63NTneTiYZ6u70pUZffslnkjwYrDA4cWKtcIb7DZGBoH4s6lsSsXrqGaO6Zko JiBBE3ZvbAf3zV6KtBY8YoPe/6SbJS6qsu2sYq5RjJX2bbr7BquLmSTDkTtcA3lsh8Nq EAJfHO0+8PSdw4Mw0BSpsi7YS+Y6mF0KA6lpacC4N6W/+QPAdRZekKYGcXJN7y/g1Fvf aPixpAZsJHaB5jkRsm7SmWdMvHyUbdAwo7bWcDj3jLFYskM2d1Zt2Fvk8XPKfKC7HNvc SfQNgR6GG0Gg9Ib5CK7NAf2TgXNY38jpj8Q4yhig7FlbcAmDnpfleDwusXbnxb+b1u6l 2hSg== X-Gm-Message-State: AOJu0YwG07rkJCiXlDaBjIYkxE2q/vFOxvsla3G+YyMWh89IXDBoDYM9 9ypjg+1wiB8+t92OWnwQeooB8ZmEd9K6D3oQroFSmmQKseKJ2kKOf0hjWQtN3tOkUxie08zupUv ObcIc+LIK266+4EdEZvcgcj8vDZO00gPGiEqoDuJJeFL9hhoV00J3LueXQd/l47BwL8057DO9I2 B1RPIGiFNN4/DJnl+r8ZcFFKHfHiqySw== X-Received: by 2002:a17:906:b7c4:b0:a3c:11a0:8d10 with SMTP id fy4-20020a170906b7c400b00a3c11a08d10mr1682393ejb.3.1707909329399; Wed, 14 Feb 2024 03:15:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbHOQkf1nKWKnALpSek5ac4lF2Ksm3qtzz7OVRyTMTV94rSMtOpkxPhaPMdCN0wP9mnm0T0Q== X-Received: by 2002:a17:906:b7c4:b0:a3c:11a0:8d10 with SMTP id fy4-20020a170906b7c400b00a3c11a08d10mr1682378ejb.3.1707909329060; Wed, 14 Feb 2024 03:15:29 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVuI4MvfH9478Gs+zR4LA/EvNdOYlJiH2pVjomgC419sSLx4kvBa9Dq3Xho4e+Bcg2VCr11ehLVHbbxgPRpUMdWWB9671RqzXkAPgQE+WDpy3dO0/VLF4N5+PX09D94Vhx166InFtbQLdWz/3y97M+ARrc= Date: Wed, 14 Feb 2024 06:15:24 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Davidlohr Bueso , Fan Ni , Jonathan Cameron Subject: [PULL 41/60] hw/cxl/mbox: Remove dead code Message-ID: <7031ee540b7e25a8f38d7b855ed99c7c5f68200d.1707909001.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.504, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1707909489982100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Davidlohr Bueso Two functions were reported to have dead code, remove the bogus branches altogether, as well as a misplaced qemu_log call. Reported-by: Peter Maydell Reviewed-by: Fan Ni Signed-off-by: Davidlohr Bueso Signed-off-by: Jonathan Cameron Message-Id: <20240126120132.24248-6-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/cxl/cxl-mailbox-utils.c | 43 +++++++++++++------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c index 6eff56fb1b..dc42850767 100644 --- a/hw/cxl/cxl-mailbox-utils.c +++ b/hw/cxl/cxl-mailbox-utils.c @@ -1001,15 +1001,8 @@ static CXLRetCode cmd_sanitize_overwrite(const struc= t cxl_cmd *cmd, =20 cxl_dev_disable_media(&ct3d->cxl_dstate); =20 - if (secs > 2) { - /* sanitize when done */ - return CXL_MBOX_BG_STARTED; - } else { - __do_sanitization(ct3d); - cxl_dev_enable_media(&ct3d->cxl_dstate); - - return CXL_MBOX_SUCCESS; - } + /* sanitize when done */ + return CXL_MBOX_BG_STARTED; } =20 static CXLRetCode cmd_get_security_state(const struct cxl_cmd *cmd, @@ -1387,27 +1380,21 @@ static void bg_timercb(void *opaque) =20 cci->bg.complete_pct =3D 100; cci->bg.ret_code =3D ret; - if (ret =3D=3D CXL_MBOX_SUCCESS) { - switch (cci->bg.opcode) { - case 0x4400: /* sanitize */ - { - CXLType3Dev *ct3d =3D CXL_TYPE3(cci->d); + switch (cci->bg.opcode) { + case 0x4400: /* sanitize */ + { + CXLType3Dev *ct3d =3D CXL_TYPE3(cci->d); =20 - __do_sanitization(ct3d); - cxl_dev_enable_media(&ct3d->cxl_dstate); - } - break; - case 0x4304: /* TODO: scan media */ - break; - default: - __builtin_unreachable(); - break; - } + __do_sanitization(ct3d); + cxl_dev_enable_media(&ct3d->cxl_dstate); + } + break; + case 0x4304: /* TODO: scan media */ + break; + default: + __builtin_unreachable(); + break; } - - qemu_log("Background command %04xh finished: %s\n", - cci->bg.opcode, - ret =3D=3D CXL_MBOX_SUCCESS ? "success" : "aborted"); } else { /* estimate only */ cci->bg.complete_pct =3D 100 * now / total_time; --=20 MST