Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9129575pxu; Mon, 28 Dec 2020 07:20:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKsqdKSIcm16YxauaHGPwQzcVULqk3MNI1mdhTUt/aTIzUQJm4OzIPEQHZoGfBWA0/fHoK X-Received: by 2002:a17:906:971a:: with SMTP id k26mr42903225ejx.515.1609168836692; Mon, 28 Dec 2020 07:20:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168836; cv=none; d=google.com; s=arc-20160816; b=jJ6KYDLPBugjaWHTYJvgdHqptJkftBLNJYrQVt2crL1dfwkwLfs9Q1k9Et+lIMijaV IAwibgmqb8oJq9y2GZQuHJfJb3unifxUUJZidObGetgOOprFsm8X8VS5fR4/fP5UA/vt 4God1HMsUm3VHQYXpxEyY5feKoKYWFOfwC/pIQoLoreB7ZaAcbu6l1Jv9lewHJAEelHV nNVdVw41vJqV5B+reF66632mD4xXhptQ0qS48sq4a5nO2HA203EbJy50S3bDx+AfyU06 dsRgy9G0cCnEwQU4WYNmBxc6VFZw8Bamr/MHIFwMhgoLwiwUW0O1kR0EVJvfUibUN7i1 kuQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=heguVAZ6+17V9q4yn/+QFBYHWjzb+z/b/bZyFstND7Q=; b=ScOBD/8PKxKXMjqu/PsleuvON15HwOi/1w2ZGfXAJkTgw3ACiNCH2kNUJ19Z8V8BdM eRDchOCOeJ9P8l/8o2KkTNm30AJSUofgO+5YNShSc0OgAhC9NGDkRVqoHC7J1Ll9y3ZL iwwLrc40GG+RAWKvnB2/Za0NTg8JDM61lRxJyCaaSCqEEW6HwCg7OlNUl3Uq+H7I5/Am dLhvqeqh9TgzKSGUp3So/+ILZTHbk0botjCL/hDBasRaKUXHodk4SWnoRmZLhc+Rvo2B tQ+/cnhCu5Thj3Q8RmojrMPmydxGacIy9Nvvj0FFfgS7VJo8dG/g3Cq1KuWUIKqY2q/H t82A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVtaddPV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z5si19974856ejj.425.2020.12.28.07.20.13; Mon, 28 Dec 2020 07:20:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=DVtaddPV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437079AbgL1ODK (ORCPT + 99 others); Mon, 28 Dec 2020 09:03:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:35002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408173AbgL1OBH (ORCPT ); Mon, 28 Dec 2020 09:01:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7292822D00; Mon, 28 Dec 2020 14:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164027; bh=1WMjNZBFhbo/9anFrqb4NAA6D1BrrnXWGMGbP+Jftoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVtaddPVJIUQPeC9ejRAtyglLEfV82eNvQKIhUINxE1Y2W3egWyjFKHcoOnn2RR/w i9GXmpJ0U6Dv4ZE5TUDmkjA12lBEDPsycqnDFZS8RHoa/4xL8NzHwTYCNfTkvQnEbQ Fg8T84/uFv2l8sTd22R32p+owu6FIZqzQe9TgJis= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Herbert Xu , Sasha Levin Subject: [PATCH 5.10 034/717] crypto: talitos - Endianess in current_desc_hdr() Date: Mon, 28 Dec 2020 13:40:32 +0100 Message-Id: <20201228125022.625771962@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy [ Upstream commit 195404db27f9533c71fdcb78d32a77075c2cb4a2 ] current_desc_hdr() compares the value of the current descriptor with the next_desc member of the talitos_desc struct. While the current descriptor is obtained from in_be32() which return CPU ordered bytes, next_desc member is in big endian order. Convert the current descriptor into big endian before comparing it with next_desc. This fixes a sparse warning. Fixes: 37b5e8897eb5 ("crypto: talitos - chain in buffered data for ahash on SEC1") Signed-off-by: Christophe Leroy Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/talitos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 66773892f665d..1de6b01381268 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -478,7 +478,7 @@ static u32 current_desc_hdr(struct device *dev, int ch) iter = tail; while (priv->chan[ch].fifo[iter].dma_desc != cur_desc && - priv->chan[ch].fifo[iter].desc->next_desc != cur_desc) { + priv->chan[ch].fifo[iter].desc->next_desc != cpu_to_be32(cur_desc)) { iter = (iter + 1) & (priv->fifo_len - 1); if (iter == tail) { dev_err(dev, "couldn't locate current descriptor\n"); @@ -486,7 +486,7 @@ static u32 current_desc_hdr(struct device *dev, int ch) } } - if (priv->chan[ch].fifo[iter].desc->next_desc == cur_desc) { + if (priv->chan[ch].fifo[iter].desc->next_desc == cpu_to_be32(cur_desc)) { struct talitos_edesc *edesc; edesc = container_of(priv->chan[ch].fifo[iter].desc, -- 2.27.0