From patchwork Mon Dec 19 04:18:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 706911 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3thnkf3ttcz9s65 for ; Mon, 19 Dec 2016 15:19:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="SbESXrS3"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3thnkf2sdjzDwHX for ; Mon, 19 Dec 2016 15:19:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="SbESXrS3"; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mendozajonas.com (mendozajonas.com [188.166.185.233]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3thnkJ3WpXzDsxp for ; Mon, 19 Dec 2016 15:19:36 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b="SbESXrS3"; dkim-atps=neutral Received: from skellige.ozlabs.ibm.com (unknown [122.99.82.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: sam@mendozajonas.com) by mendozajonas.com (Postfix) with ESMTPSA id B8B48143FB0; Mon, 19 Dec 2016 12:19:31 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1482121172; bh=28orN+9riLctnDt7DSk1B+ngmF3+5rcs5WRJuY3KXWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SbESXrS3tTg8GuIX4vQeUJS2bZ/FPrZggVrcDqqJ2vY+O1laxZqs3H7nCQZ/XkncV SkF83doF5X1B5giy51vzQBj4uLCZKMYsAIaw4k0A2gptD8zsO+WK4qM+UEMu/geOji 1id/V8HBDej1drfQblQyxCyHvZjvURD/xR72Clls= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH 02/29] types: Remove detail and progress from struct status Date: Mon, 19 Dec 2016 15:18:48 +1100 Message-Id: <20161219041915.30497-3-sam@mendozajonas.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161219041915.30497-1-sam@mendozajonas.com> References: <20161219041915.30497-1-sam@mendozajonas.com> X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" From: Jeremy Kerr Nothing used these, and the serialisation was buggy anyway. Signed-off-by: Jeremy Kerr Signed-off-by: Samuel Mendoza-Jonas --- discover/boot.c | 2 -- discover/device-handler.c | 8 -------- lib/pb-protocol/pb-protocol.c | 20 +------------------- lib/types/types.h | 2 -- ui/test/discover-test.c | 2 -- 5 files changed, 1 insertion(+), 33 deletions(-) diff --git a/discover/boot.c b/discover/boot.c index 70e9d41..056d02d 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -154,8 +154,6 @@ static void __attribute__((format(__printf__, 4, 5))) update_status( va_end(ap); status.type = type; - status.progress = -1; - status.detail = NULL; pb_debug("boot status: [%d] %s\n", type, status.message); diff --git a/discover/device-handler.c b/discover/device-handler.c index 20df8d1..2e96c2b 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -423,8 +423,6 @@ static void countdown_status(struct device_handler *handler, struct status status; status.type = STATUS_INFO; - status.progress = -1; - status.detail = NULL; status.message = talloc_asprintf(handler, _("Booting in %d sec: %s"), sec, opt->option->name); @@ -986,8 +984,6 @@ void device_handler_cancel_default(struct device_handler *handler) handler->default_boot_option = NULL; status.type = STATUS_INFO; - status.progress = -1; - status.detail = NULL; status.message = _("Default boot cancelled"); discover_server_notify_boot_status(handler->server, &status); @@ -1088,11 +1084,7 @@ void device_handler_process_url(struct device_handler *handler, struct param *param; status = talloc(handler, struct status); - status->type = STATUS_ERROR; - status->progress = 0; - status->detail = talloc_asprintf(status, - _("Received config URL %s"), url); if (!handler->network) { status->message = talloc_asprintf(handler, diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index 1e72d19..8bc8820 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -219,7 +219,6 @@ int pb_protocol_boot_status_len(const struct status *status) { return 4 + 4 + optional_strlen(status->message) + - 4 + optional_strlen(status->detail) + 4; } @@ -410,10 +409,6 @@ int pb_protocol_serialise_boot_status(const struct status *status, pos += sizeof(uint32_t); pos += pb_protocol_serialise_string(pos, status->message); - pos += pb_protocol_serialise_string(pos, status->detail); - - *(uint32_t *)pos = __cpu_to_be32(status->type); - pos += sizeof(uint32_t); assert(pos <= buf + buf_len); (void)buf_len; @@ -848,23 +843,10 @@ int pb_protocol_deserialise_boot_status(struct status *status, pos += sizeof(uint32_t); len -= sizeof(uint32_t); - /* message and detail strings */ + /* message string */ if (read_string(status, &pos, &len, &status->message)) goto out; - if (read_string(status, &pos, &len, &status->detail)) - goto out; - - /* and finally, progress */ - if (len < sizeof(uint32_t)) - goto out; - - status->progress = __be32_to_cpu(*(uint32_t *)(pos)); - - /* clamp to 100% */ - if (status->progress > 100) - status->progress = 100; - rc = 0; out: diff --git a/lib/types/types.h b/lib/types/types.h index b22c0b0..506510b 100644 --- a/lib/types/types.h +++ b/lib/types/types.h @@ -76,8 +76,6 @@ struct status { STATUS_ERROR, } type; char *message; - char *detail; - int progress; }; struct interface_info { diff --git a/ui/test/discover-test.c b/ui/test/discover-test.c index ea76764..f3e7dd8 100644 --- a/ui/test/discover-test.c +++ b/ui/test/discover-test.c @@ -81,8 +81,6 @@ static void print_status(struct status *status, printf("status:\n"); printf("\ttype: %d\n", status->type); printf("\tmessage: %s\n", status->message); - printf("\tdetail: %s\n", status->detail); - printf("\tprogress: %d\n", status->progress); }