From patchwork Wed Nov 11 12:03:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1398190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::238; helo=mail-lj1-x238.google.com; envelope-from=swupdate+bncbcxploxj6ikrbingv76qkgqezllc33y@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=kl9Hglkg; dkim-atps=neutral Received: from mail-lj1-x238.google.com (mail-lj1-x238.google.com [IPv6:2a00:1450:4864:20::238]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CWNg96XN1z9sSf for ; Wed, 11 Nov 2020 23:03:49 +1100 (AEDT) Received: by mail-lj1-x238.google.com with SMTP id s22sf733229ljs.10 for ; Wed, 11 Nov 2020 04:03:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605096226; cv=pass; d=google.com; s=arc-20160816; b=ziWrfy95mNOunV1/Dgs/4ZigbkwOOjEkz495RsAEkSa/qRJb+jPLhlxoQSxCDgtjPY hj2sQcOKAEw4L4ToXbVHr3MMPcmADQ9zjJQkP46XuB+A3LBQlWpXdpQJLPiWiWihGzir eyWSKCnK7f3CknQd67qMj99/jwWUKuJBw6hXr5SVqUgSvDXA4wCIKA9MA5CHYPDHkvd+ 0NNuIdSjXa3t5g+Of7wjZ9b48mDyv1DPZjhHAYDWx+vtiOVRLqxoYorTJZ39y5RcLnT/ xxuYge1jNoZAK4PSLU2HuJo4gdVjC0JcATxLUcx5RWN1KAWpRJDYSzbt0jPchxhRzgML NmpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=O8wFfol2H0ociidb0uaxs9RXOx5pxMSfgxC4WfGnOv4=; b=z0ByCAwhQfE/FOc7ez00kljpQTU8aYGV44Bl7D9j9XCrJeZlFss7/6tRYpgtC7SY9B yMs0KM2ms4h6PWbWfqY/osITbcKGqfX6L54mdGMREeKcGAn+OeAA7wcu/Nr6fxg2UOpe yQ3Qu1U0mwapgoMNtzB/Ir1u7LFMPeMytd8GhS8w5atbEbAAV/VPlGHVDI139l7DGB+j 6yFGkvg0AFfU0iaaoYCyJDLKZqS7R76rsk0/lvsUhX0qoaOBZPH7ub4wGkF92gaZPXLQ jQIjSN2zFjhMPKmg8BSl9RM2b753KBu0H7LIHctthl6RsuBZWwjDzdN2TIrWQ5+qaIU9 mitA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=O8wFfol2H0ociidb0uaxs9RXOx5pxMSfgxC4WfGnOv4=; b=kl9Hglkgk3qkVVvmoFreMLE4J/eClZg4lNhwpoPUB9im40BPbBg8oKUdOxGeJNg74o g7gseqx4Z9aGSBQH3CfJfoTRxq3xyzJ79zGNBJuNV/OE2ltcj0eo/j9CyXcdpfV+kFAM 4xDJTHCDQjjxUcw+9ujsxQrv9pyt6uEVIz4+5wJE+A0dTQzErxqg22GfP3MZ8cp+5X9v 0lLBWWRZKaRAPYYJvhBgEfVLX+Er/GafHKrc97U7IdgsP6E82cVzHzGiysnmNndUupBK CWEPH6edr6aFw85ZCyM3KbroYSjPcRP4ygcaZgEkevV2SdmKNEgeWfY+DCGec3EN1nce aClQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=O8wFfol2H0ociidb0uaxs9RXOx5pxMSfgxC4WfGnOv4=; b=gTUz497RgWEdoQkWTCwsJaAj3scins9q7t7lou8IzoS2Y4Kp2aQzJAYt9zUTn0RuQS ZwgFtUNaArOQhhu6FIb1xd7Us+zrcfonzqYNvfTOTCvgw7hgZR0zOCIulmkZXpi9io1V EijHxxUDJO2SE/tDsWeeCZsZwI0WGIljDlBONrrPwuAC4MnwnW49z/t1ySMKFxERuooT oXuPq52DgAw1Sxqy0lKpQnJ3Z8PwqcrsU81hJPz6aKjLC8JRBiiAyv/rGsWMvR+h9yWD elr/jgz827JK7bx3qJ6QKnNVEu3zLY65oXCKQsWOxI3jAnwaDXnQKT30AVZMITEKHQE/ tAJw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM530vKscMZzUhCLd1yGhh1eqq6e0ZIhaMKrdz0ED4BKwRiQsUdSUj H3HZJ3+VV8+VRdqDM8ipq0E= X-Google-Smtp-Source: ABdhPJzMpkgCsH6LfzUuNZALD3ULMPTnKMJeopCm2VVB8Pf3ifY1hPat0LmQG6AsWg4zHW425+RcsQ== X-Received: by 2002:a2e:9510:: with SMTP id f16mr9355975ljh.408.1605096225847; Wed, 11 Nov 2020 04:03:45 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a19:480e:: with SMTP id v14ls2490555lfa.2.gmail; Wed, 11 Nov 2020 04:03:44 -0800 (PST) X-Received: by 2002:a19:a419:: with SMTP id q25mr6852912lfc.410.1605096224629; Wed, 11 Nov 2020 04:03:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605096224; cv=none; d=google.com; s=arc-20160816; b=UOw1No8ABtuy9sFsnka0cPTs//m9u5NEW/oWJIjBTsyzKx9JQj8yv7d5byGGbEbIaU Yt6rkaUNGZViyJt4jOZhGuvzjfjuQN8F+3P4kRgHARmSjse9FlPEGXiPoCH4x0cu34AN N1rbk/Z7+KX8T/SC0aVIVBE4EFOm2mmfDiBQdqnx+73B/AsVx+eqUJv/P+ZJHgs0CWq1 1sJEblPPk76mRNeB7Jdt0afRakweAqXMgiMlonAsusEM5n2vzBScfYrTZIKRwKSfrfFn oCcitVsstPuYb3iheEyY1/9e1n4+7WgfmYsEdYwwHE4O4pfTP9Z+GgOS3htFtJp2sW57 RW8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=KSN/9Kel+n/1pLs9wnnSS0cx6pDtMckCRl9ZdxqeNkk=; b=aPM4sUDHdPv9yZnAR/CFhCWr7nG2jLhGgFm80kdKD0RaKgR+doEm3WESg+68y/cWK6 rBpCTs1jw9lQgTETNnzHj/POUnVZlTaLElAoA+yC9sAajgbonFasabn1/JKJAICGa6RM 0LUp53eEcDK7ovD0QksuNgFmDYv5tem6UylronUlmHugdoeUC/gu4tuPmehbNtTN3s1j 7TTjYJrDQmwDaK3fMXx3fGNjJr37GiLvlhh0NJxnhH49PRco4zMuu4gXxjR5BXUmByqb ZXXpShG9a7Btn8/sRBKm1QxlR33k/y9wYAlONMbSzUSsbrhZ98pUyNDO6kfS5emBUcEn 9uEA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id m18si71935lfr.11.2020.11.11.04.03.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Nov 2020 04:03:44 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CWNg419V9z1qs3d; Wed, 11 Nov 2020 13:03:44 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CWNg40yyzz1qwTp; Wed, 11 Nov 2020 13:03:44 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id j-Pbsl6kJbgv; Wed, 11 Nov 2020 13:03:43 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Wed, 11 Nov 2020 13:03:43 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 38DA645427E5; Wed, 11 Nov 2020 13:03:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yB6mcfDycnL1; Wed, 11 Nov 2020 13:03:36 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id F16B2454277B; Wed, 11 Nov 2020 13:03:30 +0100 (CET) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 2/6] IPC: drop unused parameter and change name Date: Wed, 11 Nov 2020 13:03:23 +0100 Message-Id: <20201111120327.607444-3-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201111120327.607444-1-sbabic@denx.de> References: <20201111120327.607444-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , The "info" buffer used to trigger an update is quite unused. The name of the original SWU is pushed in case of local update, but it is not used. Drop the filename and change the name to a more generic data, as this will be used to pass a request structure with several fields instead of pure formatted strings. Signed-off-by: Stefano Babic --- core/network_thread.c | 4 ---- core/stream_interface.c | 3 +-- include/installer_priv.h | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/network_thread.c b/core/network_thread.c index 698c139..2c383b7 100644 --- a/core/network_thread.c +++ b/core/network_thread.c @@ -350,7 +350,6 @@ void *network_thread (void *data) if (instp->status == IDLE) { instp->fd = ctrlconnfd; instp->source = msg.data.instmsg.source; - instp->len = min(msg.data.instmsg.len, sizeof(instp->info)); /* * Communicate if a dry run is asked and set it @@ -360,9 +359,6 @@ void *network_thread (void *data) else instp->dry_run = 0; - memcpy(instp->info, msg.data.instmsg.buf, - instp->len); - /* * Prepare answer */ diff --git a/core/stream_interface.c b/core/stream_interface.c index 8285c72..633116d 100644 --- a/core/stream_interface.c +++ b/core/stream_interface.c @@ -607,8 +607,7 @@ void *network_initializer(void *data) int get_install_info(sourcetype *source, char *buf, size_t len) { len = min(len, inst.len); - - memcpy(buf, inst.info, len); + memcpy(buf, inst.data, len); *source = inst.source; return len; diff --git a/include/installer_priv.h b/include/installer_priv.h index a84143d..9322a68 100644 --- a/include/installer_priv.h +++ b/include/installer_priv.h @@ -19,7 +19,7 @@ struct installer { sourcetype source; /* Who triggered the update */ int dry_run; /* set it if no changes in hardware must be done */ unsigned int len; /* Len of data valid in info, data is optional */ - char info[2048]; /* info */ + char data[2048]; /* This is a placeholder for installation request */ }; #endif