From patchwork Thu Oct 4 09:34:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 10625769 X-Patchwork-Delegate: johannes@sipsolutions.net 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 5C623174A for ; Thu, 4 Oct 2018 09:34:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A4EA285C7 for ; Thu, 4 Oct 2018 09:34:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D99028D01; Thu, 4 Oct 2018 09:34:32 +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 D1103285C7 for ; Thu, 4 Oct 2018 09:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbeJDQ0y (ORCPT ); Thu, 4 Oct 2018 12:26:54 -0400 Received: from mga17.intel.com ([192.55.52.151]:47903 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727046AbeJDQ0y (ORCPT ); Thu, 4 Oct 2018 12:26:54 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Oct 2018 02:34:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,338,1534834800"; d="scan'208";a="262780937" Received: from localhost.jer.intel.com ([10.12.85.45]) by orsmga005.jf.intel.com with ESMTP; 04 Oct 2018 02:34:28 -0700 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH] iw: fix the beacon average signal parsing Date: Thu, 4 Oct 2018 12:34:20 +0300 Message-Id: <1538645660-29849-1-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP NL80211_STA_INFO_BEACON_SIGNAL_AVG is parsed as a u8, but it should be casted to a int8_t before being printed. Change-Id: Ieb6fab3b803d8ea82819a450f07cc4b537d8de8b Signed-off-by: Emmanuel Grumbach --- station.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/station.c b/station.c index 4885dc0..f4e0093 100644 --- a/station.c +++ b/station.c @@ -317,7 +317,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) if (sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG]) printf("\n\tbeacon signal avg:\t%d dBm", - nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG])); + (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG])); if (sinfo[NL80211_STA_INFO_T_OFFSET]) printf("\n\tToffset:\t%llu us", (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));