From patchwork Mon Aug 12 20:08:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 11090815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF39C112C for ; Mon, 12 Aug 2019 20:10:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C28832856B for ; Mon, 12 Aug 2019 20:10:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B72952857D; Mon, 12 Aug 2019 20:10:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6358E2856B for ; Mon, 12 Aug 2019 20:10:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727845AbfHLUKO (ORCPT ); Mon, 12 Aug 2019 16:10:14 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46181 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727418AbfHLUJf (ORCPT ); Mon, 12 Aug 2019 16:09:35 -0400 Received: by mail-pf1-f194.google.com with SMTP id q139so1955589pfc.13; Mon, 12 Aug 2019 13:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s7wEcXjgtIZl9U3KIuvRTDXiR5VgWVcjPVD+M9dp6i4=; b=E6ti69xyz0TK4JpVeWEr6CXyjvRhB07lnKL4/I45PFYaL3a8HiH+SZ57ZvpsAE+qtx 1A0eUT1sgFvu/N9tMAq13meaumNazIBpESQb1phcAdOVf1sEzZEysjR+7orD4+mEpF9w 1DHu5yOoA2re3ju7D8Rga/bDHj+u+OWCQaYjfZJPNWgysjGC45FfsTrZ5OgYPBWSx8iB bSpKrYb/F6vthPob3VSfrYIn6GJAITN+Kwcps9pwV8iiGE1LSq6ZuIA9CZ6djYxsJjCb bMcqClwv7yHmW42LjDJ6lHSG60ALKeCG8ntYzGvHX3D+W8y//gif/w6iZHkIBhkdUN4w OT/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s7wEcXjgtIZl9U3KIuvRTDXiR5VgWVcjPVD+M9dp6i4=; b=aZesWD8E4tyf+wJ2Qou8MUEOwiQ7ECKfQNXTNOvJbqFXr7wU47w8fltPqSvlxkPeEZ gKQcSvAL7toHba9AAWW+PsntlUJsiNbMEFBV3sJWoFxeOiRdf5PAm38R+kyMbjsk+/x6 b56f/2Hy3QQphv2ET46swmXAvBS4QkmqPDsed0sIOq/7PSSTZXu0QPJP17sgOV1qgOZf czSErxrYOpi4JyL6gDhe5e3i3XONI6H/Q0/B4nS/rdOw9DNnj2trNkXNat5KwRVdag/A KSL6XtDwMn468nNtICV3NjpyJk37H8luVMZ8DU360ssnqDNdWQtgmXtpkknPnM2JyyOi eIDw== X-Gm-Message-State: APjAAAWZddIO4yOgHUb2mMHRCc5Bn2ZDMn9dTKyPa2vfzYqCEZX6inDR kVNdbcA414VSeY2Hs+mztpvyWvfA X-Google-Smtp-Source: APXvYqzqlTRXEnxBDqMPh41b70/Q7WJSsI/vXqI7PIeCKV2dBUmlwQmAphyJFAthzMwA4cKfNlMwQA== X-Received: by 2002:aa7:8218:: with SMTP id k24mr35932001pfi.221.1565640574149; Mon, 12 Aug 2019 13:09:34 -0700 (PDT) Received: from localhost.lan (c-67-185-54-80.hsd1.wa.comcast.net. [67.185.54.80]) by smtp.gmail.com with ESMTPSA id n26sm110286451pfa.83.2019.08.12.13.09.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 13:09:33 -0700 (PDT) From: Andrey Smirnov To: linux-watchdog@vger.kernel.org Cc: Andrey Smirnov , Chris Healy , Guenter Roeck , Rick Ramstetter , linux-kernel@vger.kernel.org Subject: [PATCH v2 12/22] watchdog: ziirave_wdt: Don't check if ihex record length is zero Date: Mon, 12 Aug 2019 13:08:56 -0700 Message-Id: <20190812200906.31344-13-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190812200906.31344-1-andrew.smirnov@gmail.com> References: <20190812200906.31344-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ihex_next_binrec() will return NULL if next record's 'len' is zero, so explicit checks for that in the driver are unnecessary. Drop them. Signed-off-by: Andrey Smirnov Cc: Chris Healy Cc: Guenter Roeck Cc: Rick Ramstetter Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Guenter Roeck --- drivers/watchdog/ziirave_wdt.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/watchdog/ziirave_wdt.c b/drivers/watchdog/ziirave_wdt.c index 38cf3ca329d7..4b95467bf239 100644 --- a/drivers/watchdog/ziirave_wdt.c +++ b/drivers/watchdog/ziirave_wdt.c @@ -318,10 +318,6 @@ static int ziirave_firm_verify(struct watchdog_device *wdd, u16 addr; for (rec = (void *)fw->data; rec; rec = ihex_next_binrec(rec)) { - /* Zero length marks end of records */ - if (!be16_to_cpu(rec->len)) - break; - addr = (be32_to_cpu(rec->addr) & 0xffff) >> 1; if (addr < ZIIRAVE_FIRM_FLASH_MEMORY_START || addr > ZIIRAVE_FIRM_FLASH_MEMORY_END) @@ -381,10 +377,6 @@ static int ziirave_firm_upload(struct watchdog_device *wdd, msleep(500); for (rec = (void *)fw->data; rec; rec = ihex_next_binrec(rec)) { - /* Zero length marks end of records */ - if (!be16_to_cpu(rec->len)) - break; - ret = ziirave_firm_write_pkt(wdd, be32_to_cpu(rec->addr), rec->data, be16_to_cpu(rec->len)); if (ret)