search for: __y

Displaying 19 results from an estimated 19 matches for "__y".

Did you mean: __
2019 May 23
4
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...at linux-foundation.org> wrote: > On Thu, May 23, 2019 at 7:00 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > > > +# define roundup_64(x, y) ( \ > > +{ \ > > + typeof(y) __y = y; \ > > + typeof(x) __x = (x) + (__y - 1); \ > > + do_div(__x, __y); \ > > + __x * __y; \ > > +}...
2019 May 23
2
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
..._div(x, y); - return x * y; -} - static inline uint64_t howmany_64(uint64_t x, uint32_t y) { x += y - 1; diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 74b1ee9027f5..cd0063629357 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -115,6 +115,20 @@ (((x) + (__y - 1)) / __y) * __y; \ } \ ) + +#if BITS_PER_LONG == 32 +# define roundup_64(x, y) ( \ +{ \ + typeof(y) __y = y; \ + typeof(x) __x = (x) + (__y - 1); \ + do_div(__x, __y); \ + __x * __y; \ +} \ +) +#else +# define roundup_64(x, y) roundup(x, y) +#endif + /** * r...
2019 May 24
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On 23/05/2019 16:27, Steven Rostedt wrote: > > I haven't yet tested this, but what about something like the following: > > ...perhaps forget about the constant check, and just force > the power of two check: > > \ > if (!(__y & (__y >> 1))) { \ > __x = round_up(x, y); \ > } else { \ You probably want            if (!(__y & (__y - 1)) -- Roger
2019 May 24
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...; On 23/05/2019 16:27, Steven Rostedt wrote: > > > > I haven't yet tested this, but what about something like the following: > > > > ...perhaps forget about the constant check, and just force > > the power of two check: > > > > \ > > if (!(__y & (__y >> 1))) { \ > > __x = round_up(x, y); \ > > } else { \ > > You probably want > >            if (!(__y & (__y - 1)) > > -- Yes I do. I corrected it in my next email. http://lkml.kernel.org/r/20190523133648.591f9e78 at gandalf.loc...
2019 May 24
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...teven Rostedt wrote: >>> >>> I haven't yet tested this, but what about something like the following: >>> >>> ...perhaps forget about the constant check, and just force >>> the power of two check: >>> >>> \ >>> if (!(__y & (__y >> 1))) { \ >>> __x = round_up(x, y); \ >>> } else { \ >> >> You probably want >> >>            if (!(__y & (__y - 1)) >> >> -- > > Yes I do. I corrected it in my next email. > > http://lkml.kern...
2019 May 23
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
...more robust if we keep the char and short cases. I'm fine with adding something like this for round_up(), but do we want to have a generic roundup_64() as well? I'm also thinking that we perhaps should test for power of two on roundup(): #define roundup(x, y) ( \ { \ typeof(y) __y = y; \ typeof(x) __x; \ \ if (__y & (__y - 1)) \ __x = round_up(x, __y); \ else \ __x = (((x) + (__y - 1)) / __y) * __y; \ __x; \ }) -- Steve
2019 May 23
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, May 23, 2019 at 7:00 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > +# define roundup_64(x, y) ( \ > +{ \ > + typeof(y) __y = y; \ > + typeof(x) __x = (x) + (__y - 1); \ > + do_div(__x, __y); \ > + __x * __y; \ > +} \ The thing...
2010 Sep 10
0
Virtualization Digest, Vol 60, Issue 17
...nclude/common.h index 01746ea..ab07dc2 100644 --- a/include/common.h +++ b/include/common.h @@ -387,4 +387,18 @@ typedef int socklen_t; const char * wpa_ssid_txt(u8 *ssid, size_t ssid_len); +#define MIN(x,y) \ + ({ \ + typeof (x) __x = (x); \ + typeof (y) __y = (y); \ + __x < __y ? __x : __y; \ + }) + +#define MAX(x,y) \ + ({ \ + typeof (x) __x = (x); \ + typeof (y) __y = (y); \ + __x > __y ? __x : __y; \ + }) + #endif /* COMMON_H */ diff --git a/include/dcb_...
2010 Sep 10
0
Virtualization Digest, Vol 60, Issue 17
...nclude/common.h index 01746ea..ab07dc2 100644 --- a/include/common.h +++ b/include/common.h @@ -387,4 +387,18 @@ typedef int socklen_t; const char * wpa_ssid_txt(u8 *ssid, size_t ssid_len); +#define MIN(x,y) \ + ({ \ + typeof (x) __x = (x); \ + typeof (y) __y = (y); \ + __x < __y ? __x : __y; \ + }) + +#define MAX(x,y) \ + ({ \ + typeof (x) __x = (x); \ + typeof (y) __y = (y); \ + __x > __y ? __x : __y; \ + }) + #endif /* COMMON_H */ diff --git a/include/dcb_...
2012 Mar 20
13
[PATCH 0 of 3 v2] PV-GRUB: add support for ext4 and btrfs
Hi, The following patches add support for ext4 and btrfs to PV-GRUB. These patches are taken nearly verbatim from those provided by Fedora and Gentoo. We''ve been using these patches for the PV-GRUB images available in EC2 for some time now with no problems. Changes from v1: - Makefile has been changed to check the exit code from patch - The btrfs patch has been rebased to apply
2010 Nov 08
18
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Nov 08
18
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Sep 28
19
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Sep 28
19
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Jul 23
19
implementation of IEEE 802.1Qbg in lldpad
Hi, This set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Jul 23
19
implementation of IEEE 802.1Qbg in lldpad
Hi, This set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Aug 25
12
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2010 Aug 25
12
implementation of IEEE 802.1Qbg in lldpad
Hi, this set of patches contains the initial implementation of the IEEE 802.1Qbg standard: code for the exchange of EVB TLVs in LLDP frames to negotiate VSI capabalities as well as VDP VSI TLVs between a host with virtual machines and an adjacent switch. It supports setting the parameters of the TLV exchange from the command line using lldptool. VDP profiles consisting of
2012 Sep 03
1
[GIT-PULL] XFS filesystem driver
...+ +/** + * rol32 - rotate a 32-bit value left + * @word: value to rotate + * @shift: bits to roll + */ +static inline uint32_t rol32(uint32_t word, signed int shift) +{ + return (word << shift) | (word >> (32 - shift)); +} + +#define roundup(x, y) ( \ +{ \ + const typeof(y) __y = y; \ + (((x) + (__y - 1)) / __y) * __y; \ +} \ +) + +static inline int xfs_dir2_data_entsize(int n) +{ + return (int)roundup(offsetof(struct xfs_dir2_data_entry, name[0]) + n + + (unsigned int)sizeof(uint16_t), XFS_DIR2_DATA_ALIGN); +} + +static inline uint16_t * +xfs_dir2_data_ent...