Author: kib
Date: Wed Aug  2 14:54:54 2017
New Revision: 321930
URL: https://svnweb.freebsd.org/changeset/base/321930

Log:
  For makedev(), cast the minor argument to unsigned type explicitely,
  avoiding possible sign propagation.
  
  Submitted by: hselasky

Modified:
  head/sys/sys/types.h

Modified: head/sys/sys/types.h
==============================================================================
--- head/sys/sys/types.h        Wed Aug  2 14:45:58 2017        (r321929)
+++ head/sys/sys/types.h        Wed Aug  2 14:54:54 2017        (r321930)
@@ -366,7 +366,7 @@ __bitcount64(__uint64_t _x)
 
 #define        major(x)        ((int)((dev_t)(x) >> 32))       /* major number 
*/
 #define        minor(x)        ((int)((x) & 0xffffffff))       /* minor number 
*/
-#define        makedev(x, y)   (((dev_t)(x) << 32) | (y))      /* create dev_t 
*/
+#define        makedev(x, y)   (((dev_t)(x) << 32) | (unsigned)(y)) /* create 
dev_t */
 
 /*
  * These declarations belong elsewhere, but are repeated here and in
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to