/* Copies all entries where the keycode is not KEY_UNKNOWN/KEY_RESERVED  */
int ir_copy_table(struct ir_scancode_table *destin, const struct ir_scancode_table *origin)
/* Copies all entries where the keycode is not KEY_UNKNOWN/KEY_RESERVED  */
int ir_copy_table(struct ir_scancode_table *destin, const struct ir_scancode_table *origin)
{
	int i, j = 0;
	for (i = 0; i < origin->size; i++) {
		if (origin->scan[i].keycode == KEY_UNKNOWN ||
		   origin->scan[i].keycode == KEY_RESERVED)
			continue;
		memcpy(&destin->scan[j], &origin->scan[i], sizeof(struct ir_scancode));
		j++;
	}
	destin->size = j;
	IR_dprintk(1, "Copied %d scancodes to the new keycode table\n", destin->size);
	return 0;
}