chattr-util: use BIT_FOREACH where appropriate
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <linux/fs.h>
|
||||
|
||||
#include "bitfield.h"
|
||||
#include "chattr-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
@@ -93,11 +94,9 @@ int chattr_full(
|
||||
* supported, and we can ignore it too */
|
||||
|
||||
unsigned current_attr = old_attr;
|
||||
for (unsigned i = 0; i < sizeof(unsigned) * 8; i++) {
|
||||
unsigned new_one, mask_one = 1u << i;
|
||||
|
||||
if (!FLAGS_SET(mask, mask_one))
|
||||
continue;
|
||||
BIT_FOREACH(i, mask) {
|
||||
unsigned new_one, mask_one = 1u << i;
|
||||
|
||||
new_one = UPDATE_FLAG(current_attr, mask_one, FLAGS_SET(value, mask_one));
|
||||
if (new_one == current_attr)
|
||||
|
||||
Reference in New Issue
Block a user