From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679AbbIYGmm (ORCPT ); Fri, 25 Sep 2015 02:42:42 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:15244 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbbIYGmk (ORCPT ); Fri, 25 Sep 2015 02:42:40 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-15-5604ecdcee11 From: Andrzej Hajda To: linux-kernel@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , Johannes Berg , "David S. Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 18/19] mac80211: make ieee80211_new_mesh_header return unsigned Date: Fri, 25 Sep 2015 08:42:00 +0200 Message-id: <1443163320-25593-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1443103799.1869.6.camel@sipsolutions.net> References: <1443103799.1869.6.camel@sipsolutions.net> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprELMWRmVeSWpSXmKPExsVy+t/xy7p33rCEGXycYGZxa905VouNM9az Wsw538Ji8XHDJxaLy7vmsFm8WXGH3WLtkbvsFscWiDlweGxZeZPJo2/LKkaP/t5tLB6fN8kF sERx2aSk5mSWpRbp2yVwZTw5sIGt4CR/xb62zYwNjM94uhg5OCQETCQ+/tXsYuQEMsUkLtxb z9bFyMUhJLCUUeLi6m4WCKeJSeLSs2mMIFVsApoSfzffZAOxRQQUJDb3PmMFKWIWWMAk8fbZ QVaQqcICIRJPenhAalgEVCWm9B9hArF5BZwl9nzbxwSxTU7i5LHJrCA2p4C5xNU7f1lAbCEB M4kjjdOYJzDyLmBkWMUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kRElJfdjAuPmZ1iFGAg1GJ h1ehlSVMiDWxrLgy9xCjBAezkgiv1n6gEG9KYmVValF+fFFpTmrxIUZpDhYlcd65u96HCAmk J5akZqemFqQWwWSZODilGhh1nePX3zx05ZXUau65++d8YBc05G+Zw7c0omljxW0rHY99m+t1 L5Wm3ktUOuS2OKBrhuD00u40/7ktAssX7Wmeb2nD9k/Myn2jvE7DkdqVLrfesCr+3mg9Oc/1 RjPflqnOIpvkStYddT8/Pf127O/4D0WO+iftdAyWHJr8b6sj89Pmy9IHpf4rsRRnJBpqMRcV JwIA5Dg+KiUCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function returns always non-negative values. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda --- v2: added missing declaration change, fixed indentation --- net/mac80211/mesh.c | 6 +++--- net/mac80211/mesh.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index e06a5ca..90567fc 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -540,9 +540,9 @@ int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc, * * Return the header length. */ -int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, - struct ieee80211s_hdr *meshhdr, - const char *addr4or5, const char *addr6) +unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, + struct ieee80211s_hdr *meshhdr, + const char *addr4or5, const char *addr6) { if (WARN_ON(!addr4or5 && addr6)) return 0; diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 50c8473..029e41d 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h @@ -207,9 +207,9 @@ struct mesh_rmc { /* Various */ int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc, const u8 *da, const u8 *sa); -int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, - struct ieee80211s_hdr *meshhdr, - const char *addr4or5, const char *addr6); +unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata, + struct ieee80211s_hdr *meshhdr, + const char *addr4or5, const char *addr6); int mesh_rmc_check(struct ieee80211_sub_if_data *sdata, const u8 *addr, struct ieee80211s_hdr *mesh_hdr); bool mesh_matches_local(struct ieee80211_sub_if_data *sdata, -- 1.9.1