From patchwork Wed Aug 4 12:15:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 492767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A668AC4338F for ; Wed, 4 Aug 2021 12:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C8C060F22 for ; Wed, 4 Aug 2021 12:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238023AbhHDMPo (ORCPT ); Wed, 4 Aug 2021 08:15:44 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:46956 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236350AbhHDMPo (ORCPT ); Wed, 4 Aug 2021 08:15:44 -0400 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 7DFA63F0FF; Wed, 4 Aug 2021 12:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1628079330; bh=Vupsdv0RPAeK1I9qqidHNj9oHtZHv80qP1aQFhD3ryw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=wExr9J9Km7F5akPcRZABV8xo1GbwAdFdvbo6hG088WyXhyxey2bnGSFNZMCL4iZts 5H13NcAt4YEgR4OlTlxaCfYaxkRChQwvsKKj1POEQvbEalEM9xhQ1eveK6y3HztMw9 6iLUI8H8YWjSIUJZS9HU6uDlMSL3RzSHXtRtO/zSPfK/zMMtWEjL6Wxp3RAIfP2yf8 pHrWnAoxr3V7yA5RmXtfybfJA3fbPJwZMzYcCv+1YfzqSwfCnuGH0+ZdQb6DgFiq2h JW3hnKMgGLCDyFnZT+pmmnD3zS9TlgzqXPWN5ZHq67eju8euxVConPy7+TcI3kcMVM pomKHDbA4c3WA== From: Colin King To: Jeremy Kerr , Matt Johnston , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] mctp: remove duplicated assignment of pointer hdr Date: Wed, 4 Aug 2021 13:15:30 +0100 Message-Id: <20210804121530.110521-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Colin Ian King The pointer hdr is being initialized and also re-assigned with the same value from the call to function mctp_hdr. Static analysis reports that the initializated value is unused. The second assignment is duplicated and can be removed. Addresses-Coverity: ("Unused value"). Signed-off-by: Colin Ian King --- net/mctp/af_mctp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c index 84f722d31fd7..a9526ac29dff 100644 --- a/net/mctp/af_mctp.c +++ b/net/mctp/af_mctp.c @@ -170,7 +170,6 @@ static int mctp_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, /* TODO: expand mctp_skb_cb for header fields? */ struct mctp_hdr *hdr = mctp_hdr(skb); - hdr = mctp_hdr(skb); addr = msg->msg_name; addr->smctp_family = AF_MCTP; addr->smctp_network = cb->net;