Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754447AbcCDK6w (ORCPT ); Fri, 4 Mar 2016 05:58:52 -0500 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:49101 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbcCDK6k (ORCPT ); Fri, 4 Mar 2016 05:58:40 -0500 X-Greylist: delayed 353 seconds by postgrey-1.27 at vger.kernel.org; Fri, 04 Mar 2016 05:58:40 EST From: Nicolas Dichtel To: davem@davemloft.net Cc: netdev@vger.kernel.org, ben@decadent.org.uk, Karen Xie , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, Nicolas Dichtel , Nikolay Aleksandrov Subject: [PATCH net-next v3 4/4] ethtool.h: define INT_MAX for userland Date: Fri, 4 Mar 2016 11:52:19 +0100 Message-Id: <1457088739-1065-5-git-send-email-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1457088739-1065-1-git-send-email-nicolas.dichtel@6wind.com> References: <20160303.170804.2300821465150459193.davem@davemloft.net> <1457088739-1065-1-git-send-email-nicolas.dichtel@6wind.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1108 Lines: 32 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 --- 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