Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2422907rdh; Sun, 29 Oct 2023 15:58:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeRvrfzSpZjkRxmpNafg1VGR+uhieyhLw9ZGaGGuOGX6pxM6QBfUpPq8ETBsR6wE/+3G9/ X-Received: by 2002:a9d:6ac3:0:b0:6b8:9483:35ba with SMTP id m3-20020a9d6ac3000000b006b8948335bamr9461435otq.24.1698620323497; Sun, 29 Oct 2023 15:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698620323; cv=none; d=google.com; s=arc-20160816; b=xkb8tx5oD6TFWoxTI9oFsJFQrdXybuhl68fpZ0v5ce8IOArcxzx/hJx9dksKUdTMjJ cUlIpNt5yFTYRmWZX/YRnsasBz4wv/RyiephZeT+0RhZ7aTqJjgmzyPVdytp9n6z25La NnM4Pp6YvCDhiLUXyii8cysxN9+uuG/19p+JI4Kx7p8vyd2MZfcmNjyoEzteL3kHF5rq 9PfF2wtEf/Q/YAKIi2uCfYCt98v4Ev/9JBo9LkjRs9ZZae6+ehqizJ+g5VVDcdnCbSr8 GW0/mNxmzm5ttvMgymtUG2EdDfiAJ+pGBhSZCrepKf0YUV2rH3DSCAxzK7PiT2/HYGVf gcoQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PO4m12wdPhX3Y2m1bVxwFE86dql/EGYUMDI5mjPCqAo=; fh=FkAzDSCKpe94R6qaIqJ7BfrtKv4iiO19XGQ1wHL811I=; b=QY6AUcw1Tjxhz1ML/JcQQXypCPJB1KtNlu7MWlC1DfVMdkTp2jocGNuxbHnyfpuXrQ HlXePG4q19wU6ox8nrW87n60tCKWral1XhblDUxZLVWVGpC1kGohiLfrv3eT88At/LxS lAi1gKvg68e2x/FBNv560Ey3Z6GJ22VecVAHsHW01doq7QvsPnLGs0HG+UiFE5YQTFLj frvPIl9h0nPWEkm5mV8pnYM/xcaYN2C88st6NrTH2rpyspEMMi84g7odWE5ESy9OSivn MeVaTwVCfp6YaItI/70LgvvRWjnyqCs3lEL9YznwwepVfhVosFk4HYyK7qXbZ1OtoPp0 2ZKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C+oQD12c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id me11-20020a17090b17cb00b002684bc84493si4199039pjb.131.2023.10.29.15.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 15:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C+oQD12c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BCB238087F23; Sun, 29 Oct 2023 15:58:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbjJ2W6c (ORCPT + 99 others); Sun, 29 Oct 2023 18:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231376AbjJ2W6X (ORCPT ); Sun, 29 Oct 2023 18:58:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95D413251; Sun, 29 Oct 2023 15:57:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48590C433C9; Sun, 29 Oct 2023 22:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698620221; bh=M6xpNn+t/cZnaseKl9ZdXbq9WpVQdINcyPmzY2CJYL4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C+oQD12c0DeXTHxheF2pkBbc1ZL6kfzK6d4+hKfmnmg5dfdrksHWTpCxeoMcTTt5l 1UQAlR3/M+vGq3y05GjEa+sczMUJFhOwkOpkFT+ndRq3GjcUeWeWgw2pGGb0+9z1O2 ig5RhtqGK3n+Y5hZY2QeU0SA6Dtt0XfcOMmLdBZPlMuG/mhTm3Fnxz1oa2eC8hDlEz /8WTda/5qRlx7UbQrjY+rnvkuT+sFPQl7tbY6Krnee08/0qQw2DJetILotp4D5bYJt Q3G7nx/a+zdP0Eh7OsVrf/3UNxUcQAPmg0s/lMFxhVpnoaiTBaoVGUK85XAduK5VgL nGdVlrPxOZhkg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Liming Sun , Hans de Goede , Sasha Levin , ilpo.jarvinen@linux.intel.com, markgross@kernel.org, vadimp@nvidia.com, platform-driver-x86@vger.kernel.org Subject: [PATCH AUTOSEL 6.5 48/52] platform/mellanox: mlxbf-tmfifo: Fix a warning message Date: Sun, 29 Oct 2023 18:53:35 -0400 Message-ID: <20231029225441.789781-48-sashal@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029225441.789781-1-sashal@kernel.org> References: <20231029225441.789781-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.5.9 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 29 Oct 2023 15:58:41 -0700 (PDT) X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email From: Liming Sun [ Upstream commit 99c09c985e5973c8f0ad976ebae069548dd86f12 ] This commit fixes the smatch static checker warning in function mlxbf_tmfifo_rxtx_word() which complains data not initialized at line 634 when IS_VRING_DROP() is TRUE. Signed-off-by: Liming Sun Link: https://lore.kernel.org/r/20231012230235.219861-1-limings@nvidia.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/mellanox/mlxbf-tmfifo.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c index f3696a54a2bd7..d9615ad600123 100644 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -607,24 +607,25 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring, if (vring->cur_len + sizeof(u64) <= len) { /* The whole word. */ - if (!IS_VRING_DROP(vring)) { - if (is_rx) + if (is_rx) { + if (!IS_VRING_DROP(vring)) memcpy(addr + vring->cur_len, &data, sizeof(u64)); - else - memcpy(&data, addr + vring->cur_len, - sizeof(u64)); + } else { + memcpy(&data, addr + vring->cur_len, + sizeof(u64)); } vring->cur_len += sizeof(u64); } else { /* Leftover bytes. */ - if (!IS_VRING_DROP(vring)) { - if (is_rx) + if (is_rx) { + if (!IS_VRING_DROP(vring)) memcpy(addr + vring->cur_len, &data, len - vring->cur_len); - else - memcpy(&data, addr + vring->cur_len, - len - vring->cur_len); + } else { + data = 0; + memcpy(&data, addr + vring->cur_len, + len - vring->cur_len); } vring->cur_len = len; } -- 2.42.0