From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: [PATCH net-next v2 2/2] ethtool.h: define INT_MAX for userland Date: Tue, 1 Mar 2016 17:41:04 +0100 Message-ID: <1456850464-23003-2-git-send-email-nicolas.dichtel@6wind.com> References: <1456846141.3098.155.camel@decadent.org.uk> <1456850464-23003-1-git-send-email-nicolas.dichtel@6wind.com> Cc: netdev@vger.kernel.org, ben@decadent.org.uk, Nicolas Dichtel , Nikolay Aleksandrov To: davem@davemloft.net Return-path: Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:42420 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750859AbcCAQlV (ORCPT ); Tue, 1 Mar 2016 11:41:21 -0500 In-Reply-To: <1456850464-23003-1-git-send-email-nicolas.dichtel@6wind.com> Sender: netdev-owner@vger.kernel.org List-ID: INT_MAX needs limits.h in userland. When ethtool.h is included by a userland app, we got the following error: .../usr/include/linux/ethtool.h: In function 'ethtool_validate_speed': .../usr/include/linux/ethtool.h:1471:18: error: 'INT_MAX' undeclared (first use in this function) return speed <= INT_MAX || speed == SPEED_UNKNOWN ^ Fixes: e02564ee334a ("ethtool: make validate_speed accept all speeds between 0 and INT_MAX") CC: Nikolay Aleksandrov Signed-off-by: Nicolas Dichtel --- v2: split the patch define DIV_ROUND_UP in uapi include/uapi/linux/ethtool.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 9c22249ebf35..2835b07416b7 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -17,6 +17,10 @@ #include #include +#ifndef __KERNEL__ +#include /* for INT_MAX */ +#endif + /* All structures exposed to userland should be defined such that they * have the same layout for 32-bit and 64-bit userland. */ -- 2.4.2