From patchwork Wed Jan 2 13:13:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10746359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D02791E for ; Wed, 2 Jan 2019 13:14:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E3B328848 for ; Wed, 2 Jan 2019 13:14:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72C0828857; Wed, 2 Jan 2019 13:14:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AC0128848 for ; Wed, 2 Jan 2019 13:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729921AbfABNOw (ORCPT ); Wed, 2 Jan 2019 08:14:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43211 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729901AbfABNOv (ORCPT ); Wed, 2 Jan 2019 08:14:51 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C41CE33BE4; Wed, 2 Jan 2019 13:14:51 +0000 (UTC) Received: from localhost (ovpn-12-97.pek2.redhat.com [10.72.12.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 209201001947; Wed, 2 Jan 2019 13:14:50 +0000 (UTC) From: Honggang Li To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org, Honggang Li Subject: [ibsim patch 19/23] sim_cmd.c: Delete unused value Date: Wed, 2 Jan 2019 21:13:14 +0800 Message-Id: <20190102131318.5765-19-honli@redhat.com> In-Reply-To: <20190102131318.5765-1-honli@redhat.com> References: <20190102131318.5765-1-honli@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 02 Jan 2019 13:14:51 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Issue was detected by Coverity. Error: CLANG_WARNING: [#def3] ibsim-0.7/ibsim/sim_cmd.c:540:3: warning: Value stored to 'n' is never read // n += sprintf(comment+n, "\t# err_attr %d", port->errattr); // ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ibsim-0.7/ibsim/sim_cmd.c:540:3: note: Value stored to 'n' is never read // n += sprintf(comment+n, "\t# err_attr %d", port->errattr); // ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // 538| n += sprintf(comment, "\t# err_rate %d", port->errrate); // 539| if (port->errattr) // 540|-> n += sprintf(comment+n, "\t# err_attr %d", port->errattr); // 541| } // 542| Signed-off-by: Honggang Li --- ibsim/sim_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c index 0a94c68bdf21..325292103caa 100644 --- a/ibsim/sim_cmd.c +++ b/ibsim/sim_cmd.c @@ -537,7 +537,7 @@ static void dump_comment(Port * port, char *comment) if (port->errrate) n += sprintf(comment, "\t# err_rate %d", port->errrate); if (port->errattr) - n += sprintf(comment+n, "\t# err_attr %d", port->errattr); + sprintf(comment+n, "\t# err_attr %d", port->errattr); } static void dump_port(FILE * f, Port * port, int type)