Message ID | 20231012230235.219861-1-limings@nvidia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp1547189vqb; Thu, 12 Oct 2023 16:04:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWaWQFOzhC26TmzKcifXWopKgqZpink0ObkUJmBwgVZVlyPJgsdqKsy4qjO0DFJieeamoo X-Received: by 2002:a05:6a20:c18f:b0:16e:26fd:7c02 with SMTP id bg15-20020a056a20c18f00b0016e26fd7c02mr16897414pzb.2.1697151858275; Thu, 12 Oct 2023 16:04:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697151858; cv=pass; d=google.com; s=arc-20160816; b=vSq1z3rJOQb9KUx/3vPOk9zwB5D/N9U5tQupzz0VKlYaWnbwOezVnMuLATcps53UYV H5pVT7FkA7W2QT+J5ohaMWa3+arcypM5kbAkR7Af6PBljO5Vqf7TQE7bxQpddA2aLAlR XQefXHTvJcaRTKpNLoeetdMSfMIFFEDmU6wZ5pTVnnyIcOHYKpM2vyd4JooqVek8RHEs ADN03iq6h1D2nZeyYTmkWs+3W1Ln97gPflYLi2FJnD8EOiLlx2joV8qFKSqC5qkpt8GR MR/cT0nubKd4biL2Fjn8M6jKy8D0yHGUQiLGOneHiXoYIH7Vvg1SzGgpSdSN7lp1U3RP oVmg== ARC-Message-Signature: i=2; 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=fjkzFype70iW0b9GFHLXH8amblyeWcr+4vuVvmjUEYU=; fh=mlCa8NrV6+BLn8HFaaP4kCx628w3pMmHWveKleIlcsc=; b=b0DLNFMdpxzjKZRtUdd/jW+tBbIU4hf+9RsZNH/O6vo5DIx1CqsPsMx5u9ZX9dJc7E BGtECTGjywrkkZfNVSt0v9VYqdgd+DTXkStObvggk0O+QbpFaZQAmOvIqGhkFxoPNpg3 sR2bDkxp9jxhKrBWI3MbwKuT/287yFSwB/QAW1oQ+cgxKyAXNWAYXIrM99B5E1gZGr37 mJ0ZIk3CC2O6yImfmpd2VxNdAP4ANUhBYimWe2MH1I5kOI1TpNOLcyBRvnj9Z9IfecJE 7WjcR21Fp6u/2sQGJQh+KpJGun3dwd0v9SxTPSGpT3zt543v+lLcJ7JdTXQCz+gACTsv vU9w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=NVyALjhL; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bw15-20020a056a02048f00b005a9e9481a6csi807373pgb.174.2023.10.12.16.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 16:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=NVyALjhL; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 38D0781A059B; Thu, 12 Oct 2023 16:04:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443137AbjJLXDT (ORCPT <rfc822;rua109.linux@gmail.com> + 19 others); Thu, 12 Oct 2023 19:03:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443114AbjJLXDP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Oct 2023 19:03:15 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2081.outbound.protection.outlook.com [40.107.102.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CEEDD7; Thu, 12 Oct 2023 16:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cqYaAj1v34RBKJJ77Pkm9dleoQzBDCFpNmun2gU0968UljZvszR8BP8poizOzzqHcJOy85iZIJEqide4bMkSqfZWe4LGb8uaD6G+tl1Pvusbd0G+88K/q0i9dOTuiZQJwwHLA1nVzqsM95cOhLZyXNcCbT316T7wA5CrhaF+Bs+HwnTSVujekzAZy2R8wBmEVgG0rwpRvNw0Y1GJPDn+pCZN4YX4WWmgwrqyTJoEBz28bP92LeOArnU9nfspcmLJvY3lOUOv8CF0623+n3ORFRxcBizfuY2ol+K3ljWgvv3QV9kALWaTXXwNHyUbJ4W+Hf1jH4zjPY2MCYLU9pnBRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fjkzFype70iW0b9GFHLXH8amblyeWcr+4vuVvmjUEYU=; b=T32uOaQttJg22UbkOP9rVYMIC5dOQsOb/PbXI+eVncEVWCLTktzYKHB6TKEBBxg/p1VflBg6YO6XxsjtzujBlBmpdGKliGITc7fBk8HAn4fxvMP39eOHLDiv1VCxIpGp9vzMNY1RVxeono3j4nsHX6OjEanmFs6s6F8Njp8BTQLagYFSsphrJ54dpRp7LDO6Zlf74qtdRahZW9oDrMEVRn8udytGJkOJkgLTTwim8QjjAiKaqYrY2KUtPeKzEFmHyPNokKwfZIO5/nmmCXkPv7iEGORa/EropFmBknnDvqkRcqXh23a7U8Ei+RPlYtoOJURIEm6FqWMmq4zssQrbDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fjkzFype70iW0b9GFHLXH8amblyeWcr+4vuVvmjUEYU=; b=NVyALjhLLVsllt1lBg7//VFIcFmFOvrpnr9TfWQj+FD1dg3ZJWasyl22xPbxkwbQbZUNhCn2hmddLHDcPf+hoszhjUZ3ss7j3MGpwaP3IcAUnrtv88IHFsoT+CTLIwJhom/gdSHfRLvsRLrXL5tPpmBIy4H6nY8zF5DPb3t3FpNDmO3pDdg0Dy9X2puDWLrUio/KI88PMdkFa1V7IscBLErrRUJ6iQVDbC2TcApZpsd6r0ZYzUQjUSdlOZnT6olH8HX5UaJaSJtQBfQSgBXyNqQC99SlKaIAZWE2ZfYPXA1S+qDfG/PdCxvXdXh7gqq21Y98xdntTF67UyrQTkrz1w== Received: from MW4P223CA0030.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::35) by CH3PR12MB8331.namprd12.prod.outlook.com (2603:10b6:610:12f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Thu, 12 Oct 2023 23:03:02 +0000 Received: from CO1PEPF000044F1.namprd05.prod.outlook.com (2603:10b6:303:80:cafe::87) by MW4P223CA0030.outlook.office365.com (2603:10b6:303:80::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38 via Frontend Transport; Thu, 12 Oct 2023 23:03:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000044F1.mail.protection.outlook.com (10.167.241.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Thu, 12 Oct 2023 23:03:01 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 12 Oct 2023 16:02:39 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 12 Oct 2023 16:02:39 -0700 Received: from vdi.nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Thu, 12 Oct 2023 16:02:38 -0700 From: Liming Sun <limings@nvidia.com> To: Vadim Pasternak <vadimp@nvidia.com>, David Thompson <davthompson@nvidia.com>, Hans de Goede <hdegoede@redhat.com>, Mark Gross <markgross@kernel.org>, Dan Carpenter <dan.carpenter@linaro.org> CC: Liming Sun <limings@nvidia.com>, <platform-driver-x86@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v2] platform/mellanox: mlxbf-tmfifo: Fix a warning message Date: Thu, 12 Oct 2023 19:02:35 -0400 Message-ID: <20231012230235.219861-1-limings@nvidia.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <bb8bc77e6ecc2287fc9110cfa08caa48eb2a0385.1696508228.git.limings@nvidia.com> References: <bb8bc77e6ecc2287fc9110cfa08caa48eb2a0385.1696508228.git.limings@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F1:EE_|CH3PR12MB8331:EE_ X-MS-Office365-Filtering-Correlation-Id: e513000d-718a-4ed9-338f-08dbcb7762a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5QKujscur9SY2RPsOdDZ4/qUME5/O+qcjPkkOWDgJKqsritg2Ho31B0BfiPN2h6nfewUcu2zWxjsJVfXKh2oMlNHldMQDIxB8va2a+GnFuESGlqhsC3eLh1lQg5gsqbtoDkNfNWB0rLEiqy3bGt0J3qTfUxUU6SKqBxjpXF4ldo8tIVFrKr7J1O/hLz9mortuxhAZzILiwhXKNtf0q1mUYdfCD3uwaTPkfW0Cym8npZS8gANRJiRPbcUwXkeV1evSbyfGo5/O7NT1Z0gR6rxwvYeTuAds5l8zU5TnIXFmmUxxrRnft6pbwDTo2BKhQsuI4tOyV8UpvNtLIBNOIpfYA6NBNqxXm4HxJYroXkNF0k7ONFIjIimQFAGW9qVsDHvRxfhn+BE/el8Uuibco04uMCg3/l6F+w05G9z3r3kIiE8n0MemUG5Lr+vx0C8OOIuzwJfLT2Xkh1zhL7I8Gcquo7D/V7rzMKHa0NHF5+UTX9e4UgB7A5yT67m2w4L7uvkU9Q9sRE5F+Omw1e7symJxjlCXq4t2Va9GWvuW6hhNYNn1gTgyjVo0UYfxbSTbT6MpMGu7DNcNHpt4WxazP66u8lRuV46x76ZrnmmfrDLWRgZAJp58fo8Ih97Zlf+fM4HHddWNQGLXCoN6zX/3E+Ml5ZQSaZICoYQsx1ICWNrhlhSot90Yr2CS+QB3NAC9N+7T94ZJRAoQxhyLitfzSablfsRulVofKjBPvUU1m62sGafJ555SjYQMkTwV6ZCFwLh X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(82310400011)(36840700001)(40470700004)(46966006)(40460700003)(478600001)(36756003)(2616005)(1076003)(26005)(426003)(2906002)(336012)(356005)(7636003)(82740400003)(6666004)(83380400001)(86362001)(40480700001)(47076005)(36860700001)(7696005)(110136005)(8936002)(8676002)(4326008)(70206006)(70586007)(54906003)(41300700001)(5660300002)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 23:03:01.8750 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e513000d-718a-4ed9-338f-08dbcb7762a4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8331 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 16:04:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778924120272420229 X-GMAIL-MSGID: 1779592707215709350 |
Series |
[v2] platform/mellanox: mlxbf-tmfifo: Fix a warning message
|
|
Commit Message
Liming Sun
Oct. 12, 2023, 11:02 p.m. UTC
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 <limings@nvidia.com>
---
v1->v2: Logic adjustment for Hans's comment
- Adjust the logic to avoid confusion.
v1: Initial version.
---
drivers/platform/mellanox/mlxbf-tmfifo.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
Comments
Hi, On 10/13/23 01:02, Liming Sun wrote: > 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 <limings@nvidia.com> > --- > v1->v2: Logic adjustment for Hans's comment > - Adjust the logic to avoid confusion. Thank you for your patch/series, I've applied this patch (series) to the pdx86 fixes branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes I will include this patch in my next fixes pull-req to Linus for the current kernel development cycle. Regards, Hans > v1: Initial version. > --- > 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 f3696a54a2bd..d9615ad60012 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; > }
diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c index f3696a54a2bd..d9615ad60012 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; }