summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d893c3e)
There's no need for it because we have the equivalent (actually more
convenient) function raw_ctz(), which works with any integer type.
Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Alin Serdean <aserdean@cloudbasesolutions.com>
CC: Gurucharan Shetty <shettyg@nicira.com>
size_t n_bundles, struct hmapx *mbundles);
static int mirror_scan(struct mbridge *);
static void mirror_update_dups(struct mbridge *);
size_t n_bundles, struct hmapx *mbundles);
static int mirror_scan(struct mbridge *);
static void mirror_update_dups(struct mbridge *);
-static int mirror_mask_ffs(mirror_mask_t);
struct mbridge *
mbridge_create(void)
struct mbridge *
mbridge_create(void)
for (; mirrors; mirrors = zero_rightmost_1bit(mirrors)) {
struct mirror *m;
for (; mirrors; mirrors = zero_rightmost_1bit(mirrors)) {
struct mirror *m;
- m = mbridge->mirrors[mirror_mask_ffs(mirrors) - 1];
+ m = mbridge->mirrors[raw_ctz(mirrors)];
if (!m) {
/* In normal circumstances 'm' will not be NULL. However,
if (!m) {
/* In normal circumstances 'm' will not be NULL. However,
mirror_mask_t *dup_mirrors, struct ofbundle **out,
int *out_vlan);
mirror_mask_t *dup_mirrors, struct ofbundle **out,
int *out_vlan);
-static inline int
-mirror_mask_ffs(mirror_mask_t mask)
-{
- BUILD_ASSERT_DECL(sizeof(unsigned int) >= sizeof(mask));
- return ffs(mask);
-}
#endif /* ofproto-dpif-mirror.h */
#endif /* ofproto-dpif-mirror.h */
bool has_mirror;
int out_vlan;
bool has_mirror;
int out_vlan;
- has_mirror = mirror_get(xbridge->mbridge, mirror_mask_ffs(mirrors) - 1,
+ has_mirror = mirror_get(xbridge->mbridge, raw_ctz(mirrors),
&vlans, &dup_mirrors, &out, &out_vlan);
ovs_assert(has_mirror);
&vlans, &dup_mirrors, &out, &out_vlan);
ovs_assert(has_mirror);