Sun Aug 18 02:42:40 2019 UTC ()
Use unsigned to avoid undefined behavior. Found by kUBSan.


(msaitoh)
diff -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/radeon/sid.h

cvs diff -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/radeon/sid.h (expand / switch to unified diff)

--- src/sys/external/bsd/drm2/dist/drm/radeon/sid.h 2019/08/09 06:27:21 1.3
+++ src/sys/external/bsd/drm2/dist/drm/radeon/sid.h 2019/08/18 02:42:40 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sid.h,v 1.3 2019/08/09 06:27:21 msaitoh Exp $ */ 1/* $NetBSD: sid.h,v 1.4 2019/08/18 02:42:40 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright 2011 Advanced Micro Devices, Inc. 4 * Copyright 2011 Advanced Micro Devices, Inc.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation 8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the 10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions: 11 * Software is furnished to do so, subject to the following conditions:
12 * 12 *
13 * The above copyright notice and this permission notice shall be included in 13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software. 14 * all copies or substantial portions of the Software.
@@ -771,30 +771,30 @@ @@ -771,30 +771,30 @@
771# define DESCRIPTION9(x) (((x) & 0xff) << 8) 771# define DESCRIPTION9(x) (((x) & 0xff) << 8)
772# define DESCRIPTION10(x) (((x) & 0xff) << 16) 772# define DESCRIPTION10(x) (((x) & 0xff) << 16)
773# define DESCRIPTION11(x) (((x) & 0xff) << 24) 773# define DESCRIPTION11(x) (((x) & 0xff) << 24)
774#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO7 0x41 774#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO7 0x41
775# define DESCRIPTION12(x) (((x) & 0xff) << 0) 775# define DESCRIPTION12(x) (((x) & 0xff) << 0)
776# define DESCRIPTION13(x) (((x) & 0xff) << 8) 776# define DESCRIPTION13(x) (((x) & 0xff) << 8)
777# define DESCRIPTION14(x) (((x) & 0xff) << 16) 777# define DESCRIPTION14(x) (((x) & 0xff) << 16)
778# define DESCRIPTION15(x) (((x) & 0xff) << 24) 778# define DESCRIPTION15(x) (((x) & 0xff) << 24)
779#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO8 0x42 779#define AZ_F0_CODEC_PIN_CONTROL_SINK_INFO8 0x42
780# define DESCRIPTION16(x) (((x) & 0xff) << 0) 780# define DESCRIPTION16(x) (((x) & 0xff) << 0)
781# define DESCRIPTION17(x) (((x) & 0xff) << 8) 781# define DESCRIPTION17(x) (((x) & 0xff) << 8)
782 782
783#define AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL 0x54 783#define AZ_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL 0x54
784# define AUDIO_ENABLED (1 << 31) 784# define AUDIO_ENABLED (1U << 31)
785 785
786#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_CONFIGURATION_DEFAULT 0x56 786#define AZ_F0_CODEC_PIN_CONTROL_RESPONSE_CONFIGURATION_DEFAULT 0x56
787#define PORT_CONNECTIVITY_MASK (3 << 30) 787#define PORT_CONNECTIVITY_MASK (3U << 30)
788#define PORT_CONNECTIVITY_SHIFT 30 788#define PORT_CONNECTIVITY_SHIFT 30
789 789
790#define DC_LB_MEMORY_SPLIT 0x6b0c 790#define DC_LB_MEMORY_SPLIT 0x6b0c
791#define DC_LB_MEMORY_CONFIG(x) ((x) << 20) 791#define DC_LB_MEMORY_CONFIG(x) ((x) << 20)
792 792
793#define PRIORITY_A_CNT 0x6b18 793#define PRIORITY_A_CNT 0x6b18
794#define PRIORITY_MARK_MASK 0x7fff 794#define PRIORITY_MARK_MASK 0x7fff
795#define PRIORITY_OFF (1 << 16) 795#define PRIORITY_OFF (1 << 16)
796#define PRIORITY_ALWAYS_ON (1 << 20) 796#define PRIORITY_ALWAYS_ON (1 << 20)
797#define PRIORITY_B_CNT 0x6b1c 797#define PRIORITY_B_CNT 0x6b1c
798 798
799#define DPG_PIPE_ARBITRATION_CONTROL3 0x6cc8 799#define DPG_PIPE_ARBITRATION_CONTROL3 0x6cc8
800# define LATENCY_WATERMARK_MASK(x) ((x) << 16) 800# define LATENCY_WATERMARK_MASK(x) ((x) << 16)