/* Double disarming on the other hand is allowed, and may occur when a fault and mmiotrace shutdown happen simultaneously.  */
static int arm_kmmio_fault_page(struct kmmio_fault_page *f)
/* Double disarming on the other hand is allowed, and may occur when a fault and mmiotrace shutdown happen simultaneously.  */
static int arm_kmmio_fault_page(struct kmmio_fault_page *f)
{
	int ret;
	WARN_ONCE(f->armed, KERN_ERR pr_fmt("kmmio page already armed.\n"));
	if (f->armed) {
		pr_warning("double-arm: page 0x%08lx, ref %d, old %d\n",
			   f->page, f->count, !!f->old_presence);
	}
	ret = clear_page_presence(f, true);
	WARN_ONCE(ret < 0, KERN_ERR pr_fmt("arming 0x%08lx failed.\n"),
		  f->page);
	f->armed = true;
	return ret;
}