Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752458AbdGCEmP (ORCPT ); Mon, 3 Jul 2017 00:42:15 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32860 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752374AbdGCEmN (ORCPT ); Mon, 3 Jul 2017 00:42:13 -0400 From: Janusz Lisiecki To: Wolfram Sang Cc: Greg Kroah-Hartman , Linux Driver Project Developer List , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Janusz Lisiecki Subject: [PATCH 1/1] staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.c Date: Mon, 3 Jul 2017 06:41:39 +0200 Message-Id: <1499056899-1249-2-git-send-email-janusz.lisiecki@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499056899-1249-1-git-send-email-janusz.lisiecki@gmail.com> References: <1499005648-28914-1-git-send-email-janusz.lisiecki@gmail.com> <1499056899-1249-1-git-send-email-janusz.lisiecki@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1090 Lines: 26 This patch fixes the following Sparse warnings in ks_wlan_net.c: drivers/staging/ks7010/ks_wlan_net.c:1359:24: warning: cast to restricted __le16 link_ap_info_t structure field 'capability' has native order and is used everywhere in the code in such way (i.e get_ap_information, get_current_ap). Both sides of assignment are u16 (native order) so 'le16_to_cpu' is not needed and wrong. Signed-off-by: Janusz Lisiecki --- drivers/staging/ks7010/ks_wlan_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c index 0c778aa..9a7fbe2 100644 --- a/drivers/staging/ks7010/ks_wlan_net.c +++ b/drivers/staging/ks7010/ks_wlan_net.c @@ -1356,7 +1356,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev, /* Add mode */ iwe.cmd = SIOCGIWMODE; - capabilities = le16_to_cpu(ap->capability); + capabilities = ap->capability; if (capabilities & (BSS_CAP_ESS | BSS_CAP_IBSS)) { if (capabilities & BSS_CAP_ESS) iwe.u.mode = IW_MODE_INFRA; -- 1.9.1