return 0;
}
-static uint64_t checkSupportFeatures(uint64_t f, uint64_t fs, size_t offset)
+static uint64_t checkSupportFeatures(uint64_t requested,
+ uint64_t supported, size_t offset)
{
- if (f != fs) {
- uint64_t diff = f ^ fs;
+ uint64_t unsupported = requested & (~supported);
- for (int i = 0; diff; diff >>= 1, ++i) {
- if (diff & 1)
- LOGW("feature[%d] is not support\n", i + offset);
- }
+ for (int i = 0; unsupported; unsupported >>= 1, ++i) {
+ if (unsupported & 1)
+ LOGW("feature[%d] is not support\n", i + offset);
}
- return f & fs;
+ return requested & supported;
}
extern "C" int fm_set(uint64_t f0, uint64_t f1)