#endif
#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+#define FAULT_AROUND_BYTES_4K 4096
static hal_backend_power_funcs *g_power_funcs = NULL;
static unsigned int g_power_funcs_count = 0;
if (ret < 0)
return ret;
+ /*
+ * fault_around_bytes should be multiply of page size in order to
+ * prevent the confusion of user. Even if user uses any integer value,
+ * the entered fauled_around_bytes value is rounded by kernel and then
+ * use it. In order to clarify the usage of fauld_around_bytes,
+ * limit the range of value.
+ */
+ if (fault_around_bytes == 0 || (fault_around_bytes % FAULT_AROUND_BYTES_4K))
+ return -EINVAL;
+
switch (res_type) {
case PASS_RESOURCE_MEMORY_ID:
memory = g_power_funcs->memory;