Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 2014 19:17:53 +0000 (UTC)
From:      Jakub Wojciech Klama <jceel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r266710 - user/jceel/soc2014_evdev/head/sys/dev/evdev
Message-ID:  <201405261917.s4QJHr8L018970@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jceel
Date: Mon May 26 19:17:53 2014
New Revision: 266710
URL: http://svnweb.freebsd.org/changeset/base/266710

Log:
  Fix obvious mistake.

Modified:
  user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c

Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c	Mon May 26 19:02:34 2014	(r266709)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c	Mon May 26 19:17:53 2014	(r266710)
@@ -345,24 +345,24 @@ evdev_ioctl(struct cdev *dev, u_long cmd
 		break;
 
 	case EVIOCGKEY(0):
-		limit = MAX(len, howmany(KEY_CNT, 8));
+		limit = MIN(len, howmany(KEY_CNT, 8));
 		memcpy(data, evdev->ev_key_states, limit);
 		break;
 
 	case EVIOCGLED(0):
-		limit = MAX(len, howmany(LED_CNT, 8));
+		limit = MIN(len, howmany(LED_CNT, 8));
 		memcpy(data, evdev->ev_led_states, limit);
 
 		break;
 
 	case EVIOCGSND(0):
-		limit = MAX(len, howmany(SND_CNT, 8));
+		limit = MIN(len, howmany(SND_CNT, 8));
 		memcpy(data, evdev->ev_snd_states, limit);
 
 		break;
 
 	case EVIOCGSW(0):
-		limit = MAX(len, howmany(SW_CNT, 8));
+		limit = MIN(len, howmany(SW_CNT, 8));
 		memcpy(data, evdev->ev_sw_states, limit);
 		break;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405261917.s4QJHr8L018970>