From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web09.1482.1579201643182993957 for ; Thu, 16 Jan 2020 11:07:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XchGfsVR; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579201642; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IYrtwNUx8NHzeaJk0jPT0M6OoRKX3viGKUVU+tKbHY8=; b=XchGfsVRbKC3j8TfDExyXxdY6rmnhYV+ShD8TCKEhAW4a8K/fcYSISU5OytK2mHaIeMI57 ISKNwRADIyDjqfA/ZpELqq2Xj7DMpvWENK2cvdRpMiLUEZ6xXH1Z+CAHkt2D91Mo1h3rL7 75deOOjSohdUl3HT6QjWeHyKldgNGes= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-52-X6nAwjf8P5Kyj9T6T04nGw-1; Thu, 16 Jan 2020 14:07:18 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6583183B532; Thu, 16 Jan 2020 19:07:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-120.ams2.redhat.com [10.36.116.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96FDC80890; Thu, 16 Jan 2020 19:07:16 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Chao Zhang , Jian J Wang , Jiewen Yao Subject: [PATCH 06/11] SecurityPkg/DxeImageVerificationHandler: remove superfluous Status setting Date: Thu, 16 Jan 2020 20:07:00 +0100 Message-Id: <20200116190705.18816-7-lersek@redhat.com> In-Reply-To: <20200116190705.18816-1-lersek@redhat.com> References: <20200116190705.18816-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: X6nAwjf8P5Kyj9T6T04nGw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: base64 QWZ0ZXIgdGhlIGZpbmFsICJJc1ZlcmlmaWVkIiBjaGVjaywgd2Ugc2V0ICJTdGF0dXMiIHRvIEVG SV9BQ0NFU1NfREVOSUVELgpUaGlzIGlzIHN1cGVyZmx1b3VzLCBhcyAiU3RhdHVzIiBhbHJlYWR5 IGNhcnJpZXMgRUZJX0FDQ0VTU19ERU5JRUQgdmFsdWUKdGhlcmUsIGZyb20gdGhlIHRvcCBvZiB0 aGUgZnVuY3Rpb24uIFJlbW92ZSB0aGUgYXNzaWdubWVudC4KCkZ1bmN0aW9uYWxseSwgdGhpcyBj aGFuZ2UgaXMgYSBuby1vcC4KCkNjOiBDaGFvIFpoYW5nIDxjaGFvLmIuemhhbmdAaW50ZWwuY29t PgpDYzogSmlhbiBKIFdhbmcgPGppYW4uai53YW5nQGludGVsLmNvbT4KQ2M6IEppZXdlbiBZYW8g PGppZXdlbi55YW9AaW50ZWwuY29tPgpSZWY6IGh0dHBzOi8vYnVnemlsbGEudGlhbm9jb3JlLm9y Zy9zaG93X2J1Zy5jZ2k/aWQ9MjEyOQpTaWduZWQtb2ZmLWJ5OiBMYXN6bG8gRXJzZWsgPGxlcnNl a0ByZWRoYXQuY29tPgotLS0KIFNlY3VyaXR5UGtnL0xpYnJhcnkvRHhlSW1hZ2VWZXJpZmljYXRp b25MaWIvRHhlSW1hZ2VWZXJp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ICAgICAgKkRvc0hk cjsNCiAgIEJPT0xFQU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJc1ZlcmlmaWVkOw0K ICAgRUZJX1NJR05BVFVSRV9MSVNUICAgICAgICAgICAgICAgICAgICpTaWduYXR1cmVMaXN0Ow0K ICAgVUlOVE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNpZ25hdHVyZUxpc3RTaXpl Ow0KICAgRUZJX1NJR05BVFVSRV9EQVRBICAgICAgICAgICAgICAgICAgICpTaWduYXR1cmU7DQog ICBFRklfSU1BR0VfRVhFQ1VUSU9OX0FDVElPTiAgICAgICAgICAgQWN0aW9uOw0KICAgV0lOX0NF UlRJRklDQVRFICAgICAgICAgICAgICAgICAgICAgICpXaW5DZXJ0aWZpY2F0ZTsNCiAgIFVJTlQz MiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQb2xpY3k7DQogICBVSU5UOCAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKlNlY3VyZUJvb3Q7DQogICBQRV9DT0ZGX0xPQURFUl9J TUFHRV9DT05URVhUICAgICAgICAgSW1hZ2VDb250ZXh0Ow0KICAgVUlOVDMyICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIE51bWJlck9mUnZhQW5kU2l6ZXM7DQogICBXSU5fQ0VSVElGSUNB VEVfRUZJX1BLQ1MgICAgICAgICAgICAgKlBrY3NDZXJ0RGF0YTsNCiAgIFdJTl9DRVJUSUZJQ0FU RV9VRUZJX0dVSUQgICAgICAgICAgICAqV2luQ2VydFVlZmlHdWlkOw0KICAgVUlOVDggICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICpBdXRoRGF0YTsNCiAgIFVJTlROICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBBdXRoRGF0YVNpemU7DQogICBFRklfSU1BR0VfREFUQV9ESVJF Q1RPUlkgICAgICAgICAgICAgKlNlY0RhdGFEaXI7DQogICBVSU5UMzIgICAgICAgICAgICAgICAg IC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