From patchwork Mon Jan 31 02:52:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 538472 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1405566imr; Sun, 30 Jan 2022 18:52:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEOZm+e7Gn/RMdM9YNVFMNEOdAEiTnFnNmmOD1qZ2du9N0CLWApnW2Cxc6fNCsoGgQWqqr X-Received: by 2002:a05:6402:2689:: with SMTP id w9mr18860241edd.68.1643597544388; Sun, 30 Jan 2022 18:52:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643597544; cv=none; d=google.com; s=arc-20160816; b=wNpidkYo1gF0gb7QaPRTOU6Yy59zg9LgyXl/ITril3emGKyyxjvuysd+RPSzdKGDRC wnXozf24a1WW969oQyQoVWXltHN/lBQFK35qpSJ5BCo0voX44oO1yRn1pno/OrRZ3LTI n63GBdNDuyTrknhCG5KnIxYFZ4hhuG0MyQE2XEQmteidBFFCzblQ0w+khnlJGNCXwCrd ODYuCyx8En9mDTCr0Uloobp41ms40gd1eOg800ejpg5xs5Co1TRqyk4NZKf/AQqADB4N YaHaItQjCjYXpg6N8ZQ1asJ56hlZOZs8JrO+ZBjJSvA0a86krerJFUA2i+Xk1RROTD4m vxtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:message-id:date:subject:cc:to:from :dkim-signature; bh=YZkXz+Pgf7ptn6PyhHVglqpycrPmoAC47D+DcGh4D5Q=; b=GBKopReoGa0D2eZw3vkdItAwB2nh18wvJFe0uZnoOAZuEe0yzerSsb5zq2qzioSAc3 of/Vzsf99ecv407wUZ++bVx56eg8l6Wr3Dqn5CC/f8FLWyGocWhl7Xk3qXG7CS9x/LiP /pBjTYvHI7P8KgH01fC0uHC5+mbSmx8+TTuUjONmZTmR4VjQHhl6Cyz6E5jjPiFV5iSm y9qatAzvvXgHf8/CJPtfd9iakAbAznqqlOo3v2L3n5iWd0R8e93Ixmmf9ptZYh7uWOVb m9bAUe7VxHr5bPOCQjSttfZCj6ooeC73jfvXBX1z8R3mmEHCSNHOKNo7mYmX0gGZ3wdL Nbtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aBaGyfWq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id b15si6071509edz.11.2022.01.30.18.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 18:52:24 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aBaGyfWq; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 916E480D1C; Mon, 31 Jan 2022 03:52:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="aBaGyfWq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DBA4580A4F; Mon, 31 Jan 2022 03:52:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09EAB82A59 for ; Mon, 31 Jan 2022 03:52:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pg1-x52c.google.com with SMTP id g2so10976888pgo.9 for ; Sun, 30 Jan 2022 18:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=YZkXz+Pgf7ptn6PyhHVglqpycrPmoAC47D+DcGh4D5Q=; b=aBaGyfWqt0t3w36t32J4R8AF1umjgvwTQVBbE9nEtIyzuUQgaq94VtkASo5fcfYCiV tEtaqF4/Ohuem8SMvR1/hKUbmKZeGmEgWydRl3DpLkGBw+ocXJV7/MphToVLt3GCkcqX pbkEw0QRe3KJGz4mEGSbDKfBU7ZVxlwVTAdoL+t17umiHNEB5em4W06EjkZjn6Jskerm 3CpwanZS5+3bTnQdoU6MGOQmaz6O7hTrT0wm+xd3151XIzICCWI+pVnYz+RvOxi8j0w+ sjISUuAb0EXIfqwN9RJaX8RZ5eBJ8qf6oaeQbMQqoRYjV4XqECL32Zyya/X/8OeyQNzr P5TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=YZkXz+Pgf7ptn6PyhHVglqpycrPmoAC47D+DcGh4D5Q=; b=m5yVgzih8NcVWgcYH7S/kRwPhDp3KfIUZTcJpcRfqH/W0uj5tnyY1VfUU9i2S40soU thZFSOQMlKl8j9Ae3+agxpSRMTWthU15oG1gdi3vs112ncehmlED2rU+sj432gXs9+VQ Q81kRYAZozpIvKf6/314yMSaVsnKPAobLx2unYnGgzHcoiHEgvWowRHImVk1+2i9GJPW GVp9qsW5xNPE+SfNOmW72y91/eAKx8mVvOkBbINEkenVLxdJ/Ty6YB5UPj380e2RBXOv 7O6v6UxSfLkbe8MDbmsHFgYp/KCQeWKAiU6/wFEjrdCjKLqxKl3iIv5hV+cKc0sZi2T/ La0A== X-Gm-Message-State: AOAM531dqMNRSY+fUEIwC4DwTL+CJTDNiO3fC6EP3DakJzi/bugINH7e kSQCDHm8IXEKnbTJZiM99jMiK1dSBxpHPA== X-Received: by 2002:a63:88c6:: with SMTP id l189mr15196127pgd.229.1643597535314; Sun, 30 Jan 2022 18:52:15 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id y42sm17022381pfa.5.2022.01.30.18.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 18:52:14 -0800 (PST) From: Masami Hiramatsu To: Tom Rini , Lukasz Majewski Cc: u-boot@lists.denx.de, ilias.apalodimas@linaro.org, sughosh.ganu@linaro.org, jaswinder.singh@linaro.org Subject: [PATCH v2 0/5] DFU: Update dfu_alt_info parser etc. Date: Mon, 31 Jan 2022 11:52:11 +0900 Message-Id: <164359753172.280839.8310577813724924540.stgit@localhost> X-Mailer: git-send-email 2.25.1 User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Hi, Here is the 2nd version of improving DFU subsystem series. This improves dfu_alt_info parser and fixing documents etc. In this version I fixed a build error of cmd/dfu.c so that it can be build without DFU_OVER_USB and DFU_OVER_TFTP (in this case, the platform will use the DFU only for EFI capsule update.) When I was debuging my patch for updating dfu_alt_info on the DeveloperBox platform, I found that dfu_alt_info parser didn't accept redundant spaces and tabs. Also the dfu.rst description seems wrong. Moreover, there is no way to check whether the parser parses the dfu_alt_info correctly. These patches fixes such issues. [1/5] is just for avoiding buffer overrun, [2/5] and [3/5] improves dfu_alt_info parser to accept redundant spaces and tabs, and check the number of arguments strictly so that the parser (and user) can notice any unexpected parameters. [4/5] fixes the documents (there seems some wrong description maybe coming from copy&paste). [5/5] allows user to run 'dfu list' even if the platform doesn't support DFU_OVER_USB nor DFU_OVER_TFTP. Thank you, --- Masami Hiramatsu (5): DFU: Do not copy the entity name over the buffer size DFU: Accept redundant spaces and tabs in dfu_alt_info DFU: Check the number of arguments and argument string strictly doc: usage: DFU: Fix dfu_alt_info document cmd/dfu: Enable 'dfu list' command without DFU_OVER_USB cmd/dfu.c | 8 +++---- doc/usage/dfu.rst | 57 ++++++++++++++++++++++++++++++++++-------------- drivers/dfu/dfu.c | 37 ++++++++++++++++++++++++------- drivers/dfu/dfu_mmc.c | 55 +++++++++++++++++++++++++++------------------- drivers/dfu/dfu_mtd.c | 34 +++++++++++++++++++---------- drivers/dfu/dfu_nand.c | 34 ++++++++++++++++++----------- drivers/dfu/dfu_ram.c | 24 ++++++++++---------- drivers/dfu/dfu_sf.c | 34 ++++++++++++++++++----------- drivers/dfu/dfu_virt.c | 5 +++- include/dfu.h | 33 ++++++++++++++++++---------- 10 files changed, 205 insertions(+), 116 deletions(-) -- Masami Hiramatsu