From patchwork Thu Jan 28 08:52:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 372552 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp1033192jam; Thu, 28 Jan 2021 00:54:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwj/HJwhSfKRlMk/bs4vhBvgnTJOc2fo+xqCgWvaad91aND2/nbbwSGygdh8gY4Qsn4ddj3 X-Received: by 2002:a05:6402:220e:: with SMTP id cq14mr12911286edb.240.1611824072290; Thu, 28 Jan 2021 00:54:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611824072; cv=none; d=google.com; s=arc-20160816; b=MkPA/uBNb84uRM827sgpG5G/0Urw+clw3seKicmoPS5qDXQ0xdQNjRMo6P83QL1Pk4 JKHU7MhzkIrbiibdbDRg+83Ftg1w3OBlBVNQ+vHd1TPqBCwUBQnRcaRVf1JaML63wa3M 6kcRC9u7M5vXRABWSZQvx1WJrYxHXVEPouzmkIvg8XuQQZZiEaRKJpIg9L9Glb5wS0Fe d+1k4cKvq0x/9uqBqy5ALmli75R/cALYj/JbJZaotAm5ko6vyg/mK+pDkl8AZTzwJMRB +Ik4C/TkLcZAfwSa+o/RQ3vXt/S3VamB6Wu4/8/ZwBv3UTcYUjSg3ryRMGlKpozYAJbb Cz2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:to :from:date:dkim-signature; bh=JeE+HbaafVkKfih7p0z7E9ku5YsWbBC+6e08j8tXuz8=; b=o8AmF8m8ochr1iqRqNtIJWQ7rztZEXTofbev8Cpm+JNmBsipnxO+WMas774RQtFhML 6kTnF87Av4FNYs70D+CWFOGAp7ybyn0J/zPGYh0zQaqKMoLoe10FNcIwLhGalLdEs68I FDw8Ab1UFRS6eYZURFTs3pk4s72D6jWAmA6AB/682nDFFZFuUVBe82uMCegWLGg2H2Ft V2AXGEOvnKUvSwkLStRWMGvbxkxQgHF59KV/2/djTSoNpKdEUgDO7w2rbl6ALJ6SoR4L 1Gi/NVQR/VLxRpAJwXiIfxyuWkeOItE88sUVy4wJiNkfyHJWAp2EToMbmECnQw9YGI1P 9+GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=THmBkwHD; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs7si2423387ejc.745.2021.01.28.00.54.32; Thu, 28 Jan 2021 00:54:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=THmBkwHD; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232243AbhA1Iwa (ORCPT + 3 others); Thu, 28 Jan 2021 03:52:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbhA1Ivw (ORCPT ); Thu, 28 Jan 2021 03:51:52 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C66C061573 for ; Thu, 28 Jan 2021 00:52:37 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id o10so4698885wmc.1 for ; Thu, 28 Jan 2021 00:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=JeE+HbaafVkKfih7p0z7E9ku5YsWbBC+6e08j8tXuz8=; b=THmBkwHDpmlIMcIq1MbnoaiuIl9JWr7JizK6c3nmX7xPtQzWP+ibbH/4EO/9bxMvIP HD5ecHLFkBGUTFWXkfDcVtAkazv7l/Dmz05o5HrN4tHjPlpdPU4tsuTGxJgvnhqbLcuk v9ZqK8loP4UB+lOplIwXrzrEASjCDw2ScKBBEGy8hMzPWzIK0UpoV5QF14yejhniHsYE 89BMVovqWUhFvPxUVJ0jqWbSC9Tj118GQtqnQF/ZVHw73SgBoRgTRYfSZND4NRfsGESu yuZaCsxuWw1EIvUTpaEMXDlQdZdSiPjSI93ULKI9e/Mn2mpv77i9NgVuiMf0TYMHUwXz /zhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=JeE+HbaafVkKfih7p0z7E9ku5YsWbBC+6e08j8tXuz8=; b=QiCtEfpnb5CtWdItPa5ZiD9suOW7S7axd9fLojxJnSA82JGb6kDibf+JxMBZ2xXGmJ XBeX2ksqojmCcq6t8tHTVhUq40y23ODYFMtW04YpTZRaCuFIoYKcX2TAlFxAqAedv1/M ZBf5s38mqtzAkQmNhzRNBTWJEJmWWw/lJTEZPY85VXrSfM3Dn1AYFVRdn4fo9WVsxqsb fAGkfpl9A5cLhX0ZYXymGpy4+DGpvVcaqjzD1YvVqOMN7U8x2if9eNP5UvVDZphgZpfF 8wLTjznKcrKb0irJXAxCpVebHXHxMTRy9ueVQRNMWufNNFdJ5E4C9Lc/UfC5iLMHpBYS wczg== X-Gm-Message-State: AOAM531q5pNr9IbU9DvQliXfyNaCfV2bwPT+3s72jsbBw5VbmydZMMQJ 3zW65VLjcUU4VCJftiSB+G/0tA== X-Received: by 2002:a1c:28c2:: with SMTP id o185mr1968277wmo.7.1611823956140; Thu, 28 Jan 2021 00:52:36 -0800 (PST) Received: from dell ([91.110.221.188]) by smtp.gmail.com with ESMTPSA id v126sm5424616wma.22.2021.01.28.00.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 00:52:35 -0800 (PST) Date: Thu, 28 Jan 2021 08:52:33 +0000 From: Lee Jones To: linux-kernel@vger.kernel.org, Andreas Noever , Michael Jamet , Mika Westerberg , Yehezkel Bernat , linux-usb@vger.kernel.org Subject: [PATCH V2 01/12] thunderbolt: dma_port: Check 'dma_port_flash_write_block()'s return value Message-ID: <20210128085233.GE4774@dell> References: <20210127112554.3770172-1-lee.jones@linaro.org> <20210127112554.3770172-2-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210127112554.3770172-2-lee.jones@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org ... and take the error path if it fails. Fixes the following W=1 kernel build warning(s): drivers/thunderbolt/dma_port.c: In function ‘dma_port_flash_write_block’: drivers/thunderbolt/dma_port.c:331:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Andreas Noever Cc: Michael Jamet Cc: Mika Westerberg Cc: Yehezkel Bernat Cc: linux-usb@vger.kernel.org Signed-off-by: Lee Jones --- v2: Different approach: actually handle the error. drivers/thunderbolt/dma_port.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_port.c index 847dd07a7b172..7288aaf01ae6a 100644 --- a/drivers/thunderbolt/dma_port.c +++ b/drivers/thunderbolt/dma_port.c @@ -335,6 +335,8 @@ static int dma_port_flash_write_block(struct tb_dma_port *dma, u32 address, /* Write the block to MAIL_DATA registers */ ret = dma_port_write(sw->tb->ctl, buf, tb_route(sw), dma->port, dma->base + MAIL_DATA, dwords, DMA_PORT_TIMEOUT); + if (ret) + return ret; in = MAIL_IN_CMD_FLASH_WRITE << MAIL_IN_CMD_SHIFT;