Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144812404
D54997.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
748 B
Referenced Files
None
Subscribers
None
D54997.diff
View Options
diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c
--- a/sys/x86/cpufreq/hwpstate_amd.c
+++ b/sys/x86/cpufreq/hwpstate_amd.c
@@ -115,9 +115,11 @@
#define HWP_AMD_CLASSNAME "hwpstate_amd"
-#define BITS_VALUE(bits, num) (((num) & (bits)) >> (ffsll((bits)) - 1))
-#define BITS_WITH_VALUE(bits, val) ((uintmax_t)(val) << (ffsll((bits)) - 1))
-#define SET_BITS_VALUE(var, bits, val) \
+#define BITS_VALUE(bits, val) \
+ (((val) & (bits)) >> (ffsll((bits)) - 1))
+#define BITS_WITH_VALUE(bits, val) \
+ (((uintmax_t)(val) << (ffsll((bits)) - 1)) & (bits))
+#define SET_BITS_VALUE(var, bits, val) \
((var) = ((var) & ~(bits)) | BITS_WITH_VALUE((bits), (val)))
#define HWPSTATE_DEBUG(dev, msg...) \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 13, 11:10 PM (7 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28358467
Default Alt Text
D54997.diff (748 B)
Attached To
Mode
D54997: hwpstate_amd(4): Fix BITS_WITH_VALUE()/SET_BITS_VALUE() to obey the mask
Attached
Detach File
Event Timeline
Log In to Comment