From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Subject: Re: [PATCH] genetlink: fix unsigned int comparison with less than zero Date: Sun, 13 Nov 2016 08:31:44 +0100 Message-ID: <1479022304.4897.0.camel@sipsolutions.net> References: <20161110155758.26996-1-colin.king@canonical.com> <1478986636.4226.4.camel@sipsolutions.net> (sfid-20161113_062527_710881_19064851) Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Colin King , "David S . Miller" , pravin shelar , Wei Yongjun , Florian Westphal , Tycho Andersen , Tom Herbert , Linux Kernel Network Developers , LKML To: Cong Wang Return-path: In-Reply-To: (sfid-20161113_062527_710881_19064851) Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org > > I suppose it could be, since family IDs are allocated in a 16-bit > > range > > anyway. But family IDs can also never actually be negative, so > > having > > an unsigned int in the struct makes sense too. > > All idr_* API's accept int, rather than unsigned int. This is my > point. Sure, but that's an internal implementation detail. The struct genl_family is also an external API towards its users, and there negative numbers make no sense whatsoever. johannes