From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id F326D8D3C for ; Mon, 16 May 2016 14:17:35 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id v200so14804232wmv.1 for ; Mon, 16 May 2016 05:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=Jea7f5c/B93LUWl32OsCBvQG0lIDCqzCzdg2gMgLtPU=; b=o1r9PKUdYLuQEhAkupG3pDRfY1uNqn/bdku3H0/ZMn5kc2G/6Zlt2WodVt2jGslhR4 wrUsZtqaYLicxpsmRM/VE0w1kz1Iw7SEgJ2pDuycDG7uM4sAtqV6NKrHzNmQ29iCxXad mniWnWo7QxwYbJCTTeMI1zyozrFN1MtR1TXw1DaGOpvCnuD0XYODpRuiTzFBMMGLwCTN FVzvzmDop3abINTXfkNxwoxigcjHBfAEk+5sX7hEX2uZQolfWchnCcuoJEO/EpKBcD1S VYInPhIxU5cIJw9GATFj8LLnr7eryskvoE2GviTT6o0d4sXXTfx9XNZABKnVbux1aN5M wTLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=Jea7f5c/B93LUWl32OsCBvQG0lIDCqzCzdg2gMgLtPU=; b=D5DFSK2ImrS5B2nGY5R4dv2sCSDcbyHntBunc3rD/QG5bDsFEvWfg7EObl6N/+yi+C eJwiX2ZvgIJsiXSg0572J/uLgnUrAEAODKzY5OgcRrgKW9r9aDONHvYcyUV/nxCUMi2q eou3pNMQlfyzu/DOCd/KYKX/urkdd7gAIfWzITYN/AVjh1M5TfY8UEXtcbqEmgJycHxH Rqi+5V1JIc95zEAXwXR06ARsVKy2Yumod511ArfgWBvsDFGIvyYlma3VGfV3rbNPwv61 2p1mSiEeTyT/IwlTZmskrEymObAEGkuC4mwPLLWfI4C1Vq/iuEjx5BN0eBK23FpvBr6e apvw== X-Gm-Message-State: AOPr4FXlR6nWZsF57Jl2S8+8XC03JM8Rni5vQmpTRWA7pE8YXCz2bpDGnVvST9lhhNtyjmlt X-Received: by 10.194.95.104 with SMTP id dj8mr28886213wjb.138.1463401055810; Mon, 16 May 2016 05:17:35 -0700 (PDT) Received: from xps13.localnet (239.202.154.77.rev.sfr.net. [77.154.202.239]) by smtp.gmail.com with ESMTPSA id gk6sm33477870wjc.31.2016.05.16.05.17.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 May 2016 05:17:34 -0700 (PDT) From: Thomas Monjalon To: Daniel Mrzyglod Cc: dev@dpdk.org, alan.carew@intel.com Date: Mon, 16 May 2016 14:16:53 +0200 Message-ID: <1965626.9JUMUNfzfm@xps13> User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1461163170-237505-1-git-send-email-danielx.t.mrzyglod@intel.com> References: <1461163170-237505-1-git-send-email-danielx.t.mrzyglod@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] power: fix argument cannot be negative X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 12:17:36 -0000 The title do not convey the real issue. We should be more concerned by an issue of "wrong error message" rather than an "argument" which "cannot be negative". 2016-04-20 16:39, Daniel Mrzyglod: > Fix issue reported by Coverity. > Coverity ID 13269 & 13266: It is better to put these references below and start with the explanation of the issue. > Function strerror(errno) has built strings only for non-negative errno values. > for negative values of errno it describe error as "Unknown error -errno" > to be more descriptive i put string "channel not found" taken from header. > > The negative argument will be interpreted as a very large unsigned value. OK. The next statement is probably a useless copy paste of the coverity report. > In send_msg: Negative value used as argument to a function expecting > a positive value (for example, size of buffer or allocation) Coverity issue: 13266 Coverity issue: 13269 > Fixes: 445c6528b55f ("power: common interface for guest and host") > > Signed-off-by: Daniel Mrzyglod [...] > RTE_LOG(ERR, GUEST_CHANNEL, "Error on channel '%s' communications " > - "test: %s\n", fd_path, strerror(ret)); > + "test: %s\n", fd_path, ret > 0 ? strerror(ret) : > + "channel not connected"); The indent is messy. I sugest this: + RTE_LOG(ERR, GUEST_CHANNEL, + "Error on channel '%s' communications test: %s\n", + fd_path, ret > 0 ? strerror(ret) : + "channel not connected"); > - RTE_LOG(DEBUG, POWER, "Error sending message: %s\n", strerror(ret)); > + RTE_LOG(DEBUG, POWER, "Error sending message: %s\n", ret > 0 ? strerror(ret) > + : "channel not connected"); + RTE_LOG(DEBUG, POWER, "Error sending message: %s\n", + ret > 0 ? strerror(ret) : "channel not connected"); Applied with above changes, thanks.