Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106148526
D21075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21075.diff
View Options
Index: head/sys/dev/sfxge/common/ef10_rx.c
===================================================================
--- head/sys/dev/sfxge/common/ef10_rx.c
+++ head/sys/dev/sfxge/common/ef10_rx.c
@@ -869,7 +869,7 @@
efx_dword_t dword;
/* Hardware has alignment restriction for WPTR */
- wptr = P2ALIGN(added, EF10_RX_WPTR_ALIGN);
+ wptr = EFX_P2ALIGN(unsigned int, added, EF10_RX_WPTR_ALIGN);
if (pushed == wptr)
return;
Index: head/sys/dev/sfxge/common/efsys.h
===================================================================
--- head/sys/dev/sfxge/common/efsys.h
+++ head/sys/dev/sfxge/common/efsys.h
@@ -88,10 +88,6 @@
#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
#endif
-#ifndef P2ALIGN
-#define P2ALIGN(_x, _a) ((_x) & -(_a))
-#endif
-
#ifndef IS2P
#define ISP2(x) (((x) & ((x) - 1)) == 0)
#endif
Index: head/sys/dev/sfxge/common/efx.h
===================================================================
--- head/sys/dev/sfxge/common/efx.h
+++ head/sys/dev/sfxge/common/efx.h
@@ -60,6 +60,10 @@
#define EFX_P2ROUNDUP(_type, _value, _align) \
(-(-(_type)(_value) & -(_type)(_align)))
+/* Align value down to the nearest power of two. */
+#define EFX_P2ALIGN(_type, _value, _align) \
+ ((_type)(_value) & -(_type)(_align))
+
/* Return codes */
typedef __success(return == 0) int efx_rc_t;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 4:56 AM (11 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15611327
Default Alt Text
D21075.diff (1 KB)
Attached To
Mode
D21075: sfxge(4): fix align to power of 2 when align has smaller type
Attached
Detach File
Event Timeline
Log In to Comment