From patchwork Tue Feb 22 04:29:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Johnston X-Patchwork-Id: 12754515 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FEBEC433EF for ; Tue, 22 Feb 2022 04:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbiBVEaP (ORCPT ); Mon, 21 Feb 2022 23:30:15 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:34286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229669AbiBVEaN (ORCPT ); Mon, 21 Feb 2022 23:30:13 -0500 Received: from codeconstruct.com.au (pi.codeconstruct.com.au [203.29.241.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CBB117078 for ; Mon, 21 Feb 2022 20:29:45 -0800 (PST) Received: by codeconstruct.com.au (Postfix, from userid 10001) id 61C8B202A4; Tue, 22 Feb 2022 12:29:43 +0800 (AWST) From: Matt Johnston To: netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Jeremy Kerr Subject: [PATCH net-next] mctp: Fix warnings reported by clang-analyzer Date: Tue, 22 Feb 2022 12:29:36 +0800 Message-Id: <20220222042936.516874-1-matt@codeconstruct.com.au> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org net/mctp/device.c:140:11: warning: Assigned value is garbage or undefined [clang-analyzer-core.uninitialized.Assign] mcb->idx = idx; - Not a real problem due to how the callback runs, fix the warning. net/mctp/route.c:458:4: warning: Value stored to 'msk' is never read [clang-analyzer-deadcode.DeadStores] msk = container_of(key->sk, struct mctp_sock, sk); - 'msk' dead assignment can be removed here. Signed-off-by: Matt Johnston --- net/mctp/device.c | 2 +- net/mctp/route.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/net/mctp/device.c b/net/mctp/device.c index 9e097e61f23a..224f067e9d4c 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -107,7 +107,7 @@ static int mctp_dump_addrinfo(struct sk_buff *skb, struct netlink_callback *cb) struct ifaddrmsg *hdr; struct mctp_dev *mdev; int ifindex; - int idx, rc; + int idx = 0, rc; hdr = nlmsg_data(cb->nlh); // filter by ifindex if requested diff --git a/net/mctp/route.c b/net/mctp/route.c index fe6c8bf1ec2c..85acfcbabd9c 100644 --- a/net/mctp/route.c +++ b/net/mctp/route.c @@ -456,7 +456,6 @@ static int mctp_route_input(struct mctp_route *route, struct sk_buff *skb) * the reassembly/response key */ if (!rc && flags & MCTP_HDR_FLAG_EOM) { - msk = container_of(key->sk, struct mctp_sock, sk); sock_queue_rcv_skb(key->sk, key->reasm_head); key->reasm_head = NULL; __mctp_key_done_in(key, net, f, MCTP_TRACE_KEY_REPLIED);