From patchwork Thu Dec 6 20:26:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schmidt X-Patchwork-Id: 10716751 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 9D6D313BF for ; Thu, 6 Dec 2018 20:26:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E9042F037 for ; Thu, 6 Dec 2018 20:26:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8275D2F03B; Thu, 6 Dec 2018 20:26:57 +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 360312F037 for ; Thu, 6 Dec 2018 20:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726138AbeLFU02 (ORCPT ); Thu, 6 Dec 2018 15:26:28 -0500 Received: from proxima.lasnet.de ([78.47.171.185]:53426 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbeLFU0V (ORCPT ); Thu, 6 Dec 2018 15:26:21 -0500 Received: from localhost.localdomain (p200300E9D74E97CB8FE6EC091BFC9735.dip0.t-ipconnect.de [IPv6:2003:e9:d74e:97cb:8fe6:ec09:1bfc:9735]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan@sostec.de) by proxima.lasnet.de (Postfix) with ESMTPSA id 34A91C8AE7; Thu, 6 Dec 2018 21:26:18 +0100 (CET) From: Stefan Schmidt To: linux-wpan@vger.kernel.org Cc: aring@mojatatu.com, Stefan Schmidt Subject: [PATCH 1/2] iwpan: fix clang compiler warning on absolute-value Date: Thu, 6 Dec 2018 21:26:01 +0100 Message-Id: <20181206202602.22176-1-stefan@datenfreihafen.org> X-Mailer: git-send-email 2.17.2 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Our CI found this when building with clang (seems to have the option on by deafult) iwpan.c:469:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] cmd_size = abs((long)&__section_set - (long)&__section_get); ^ iwpan.c:469:13: note: use function 'labs' instead cmd_size = abs((long)&__section_set - (long)&__section_get); ^~~ labs This also follows a change in iw, where we derived from. Signed-off-by: Stefan Schmidt --- src/iwpan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iwpan.c b/src/iwpan.c index e7781fd..fb7bef1 100644 --- a/src/iwpan.c +++ b/src/iwpan.c @@ -466,7 +466,7 @@ int main(int argc, char **argv) int err; /* calculate command size including padding */ - cmd_size = abs((long)&__section_set - (long)&__section_get); + cmd_size = labs((long)&__section_set - (long)&__section_get); /* strip off self */ argc--; argv0 = *argv++;