Index: uspace/srv/hid/rfb/main.c
===================================================================
--- uspace/srv/hid/rfb/main.c	(revision 1d6dd2a62370f8442aef510558ad86b6439e6653)
+++ uspace/srv/hid/rfb/main.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -78,10 +78,10 @@
 {
 	fibril_mutex_lock(&rfb.lock);
-	
+
 	if (x0 + width > rfb.width || y0 + height > rfb.height) {
 		fibril_mutex_unlock(&rfb.lock);
 		return EINVAL;
 	}
-	
+
 	/* TODO update surface_t and use it */
 	if (!rfb.damage_valid) {
@@ -112,7 +112,7 @@
 		}
 	}
-	
+
 	pixelmap_t *map = &vs->cells;
-	
+
 	for (sysarg_t y = y0; y < height + y0; ++y) {
 		for (sysarg_t x = x0; x < width + x0; ++x) {
@@ -122,5 +122,5 @@
 		}
 	}
-	
+
 	fibril_mutex_unlock(&rfb.lock);
 	return EOK;
@@ -161,5 +161,5 @@
 
 	const char *rfb_name = argv[1];
-	
+
 	char *endptr;
 	unsigned long width = strtoul(argv[2], &endptr, 0);
@@ -169,5 +169,5 @@
 		return 1;
 	}
-	
+
 	unsigned long height = strtoul(argv[3], &endptr, 0);
 	if (*endptr != 0) {
@@ -176,5 +176,5 @@
 		return 1;
 	}
-	
+
 	unsigned long port = 5900;
 	if (argc > 4) {
@@ -186,7 +186,7 @@
 		}
 	}
-	
+
 	rfb_init(&rfb, width, height, rfb_name);
-	
+
 	vis = malloc(sizeof(visualizer_t));
 	if (vis == NULL) {
@@ -194,7 +194,7 @@
 		return 3;
 	}
-	
+
 	graph_init_visualizer(vis);
-	
+
 	pixel_mode.mode.index = 0;
 	pixel_mode.mode.version = 0;
@@ -207,10 +207,10 @@
 	pixel_mode.mode.cell_aspect.height = 1;
 	pixel_mode.mode.cell_visual.pixel_visual = VISUAL_RGB_8_8_8;
-	
+
 	link_initialize(&pixel_mode.link);
 	list_append(&pixel_mode.link, &vis->modes);
-	
+
 	vis->def_mode_idx = 0;
-	
+
 	vis->ops = rfb_ops;
 	vis->dev_ctx = NULL;
@@ -232,5 +232,5 @@
 
 	service_id_t service_id;
-	
+
 	rc = loc_service_register(service_name, &service_id);
 	if (rc != EOK) {
@@ -238,5 +238,5 @@
 		return rc;
 	}
-	
+
 	free(service_name);
 
@@ -247,5 +247,5 @@
 		return 1;
 	}
-	
+
 	rc = loc_service_add_to_cat(service_id, visualizer_category);
 	if (rc != EOK) {
@@ -253,5 +253,5 @@
 		return 1;
 	}
-	
+
 	rc = rfb_listen(&rfb, port);
 	if (rc != EOK) {
@@ -259,5 +259,5 @@
 		return 2;
 	}
-	
+
 	printf("%s: Accepting connections\n", NAME);
 	task_retval(0);
Index: uspace/srv/hid/rfb/rfb.c
===================================================================
--- uspace/srv/hid/rfb/rfb.c	(revision 1d6dd2a62370f8442aef510558ad86b6439e6653)
+++ uspace/srv/hid/rfb/rfb.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -70,12 +70,12 @@
 		rbuf_out = 0;
 		rbuf_in = 0;
-		
+
 		rc = tcp_conn_recv_wait(conn, rbuf, BUFFER_SIZE, &nrecv);
 		if (rc != EOK)
 			return rc;
-		
+
 		rbuf_in = nrecv;
 	}
-	
+
 	*c = rbuf[rbuf_out++];
 	return EOK;
@@ -177,5 +177,5 @@
 	memset(rfb, 0, sizeof(rfb_t));
 	fibril_mutex_initialize(&rfb->lock);
-	
+
 	rfb_pixel_format_t *pf = &rfb->pixel_format;
 	pf->bpp = 32;
@@ -189,8 +189,8 @@
 	pf->g_shift = 8;
 	pf->b_shift = 16;
-	
+
 	rfb->name = str_dup(name);
 	rfb->supports_trle = false;
-	
+
 	return rfb_set_size(rfb, width, height);
 }
@@ -209,8 +209,8 @@
 	rfb->width = width;
 	rfb->height = height;
-	
+
 	/* Fill with white */
 	memset(rfb->framebuffer.data, 255, new_size);
-	
+
 	return EOK;
 }
@@ -242,5 +242,5 @@
 		}
 	}
-	
+
 	if (first_free_index != -1) {
 		rfb->palette[first_free_index] = PIXEL(255, RED(pixel), GREEN(pixel),
@@ -250,5 +250,5 @@
 		return;
 	}
-	
+
 	/* TODO find nearest color index. We are lazy so return index 0 for now */
 	*buf = 0;
@@ -262,5 +262,5 @@
 	pix |= rfb_scale_channel(GREEN(pixel), pf->g_max) << pf->g_shift;
 	pix |= rfb_scale_channel(BLUE(pixel), pf->b_max) << pf->b_shift;
-	
+
 	if (pf->bpp == 8) {
 		uint8_t pix8 = pix;
@@ -317,11 +317,11 @@
 	size_t size = sizeof(rfb_set_color_map_entries_t) +
 	    rfb->palette_used * sizeof(rfb_color_map_entry_t);
-	
+
 	void *buf = malloc(size);
 	if (buf == NULL)
 		return NULL;
-	
+
 	void *pos = buf;
-	
+
 	rfb_set_color_map_entries_t *scme = pos;
 	scme->message_type = RFB_SMSG_SET_COLOR_MAP_ENTRIES;
@@ -330,5 +330,5 @@
 	rfb_set_color_map_entries_to_be(scme, scme);
 	pos += sizeof(rfb_set_color_map_entries_t);
-	
+
 	rfb_color_map_entry_t *entries = pos;
 	for (unsigned i = 0; i < rfb->palette_used; i++) {
@@ -338,5 +338,5 @@
 		rfb_color_map_entry_to_be(&entries[i], &entries[i]);
 	}
-	
+
 	*psize = size;
 	return buf;
@@ -347,8 +347,8 @@
 	size_t pixel_size = rfb->pixel_format.bpp / 8;
 	size_t size = (rect->width * rect->height * pixel_size);
-	
+
 	if (buf == NULL)
 		return size;
-	
+
 	for (uint16_t y = 0; y < rect->height; y++) {
 		for (uint16_t x = 0; x < rect->width; x++) {
@@ -359,5 +359,5 @@
 		}
 	}
-	
+
 	return size;
 }
@@ -376,5 +376,5 @@
 	ctx->size = pixel_format->bpp / 8;
 	ctx->compress_type = COMP_NONE;
-	
+
 	if (pixel_format->bpp == 32 && pixel_format->depth <= 24) {
 		uint32_t mask = 0;
@@ -382,5 +382,5 @@
 		mask |= pixel_format->g_max << pixel_format->g_shift;
 		mask |= pixel_format->b_max << pixel_format->b_shift;
-		
+
 		if (pixel_format->big_endian) {
 			mask = host2uint32_t_be(mask);
@@ -389,5 +389,5 @@
 			mask = host2uint32_t_le(mask);
 		}
-		
+
 		uint8_t *mask_data = (uint8_t *) &mask;
 		if (mask_data[0] == 0) {
@@ -407,5 +407,5 @@
 	uint8_t data[4];
 	rfb_encode_pixel(rfb, data, pixel);
-	
+
 	switch (cpixel->compress_type) {
 	case COMP_NONE:
@@ -424,5 +424,5 @@
 	if (buf == NULL)
 		return size;
-	
+
 	for (uint16_t y = tile->y; y < tile->y + tile->height; y++) {
 		for (uint16_t x = tile->x; x < tile->x + tile->width; x++) {
@@ -431,5 +431,5 @@
 		}
 	}
-	
+
 	return size;
 }
@@ -446,5 +446,5 @@
 		}
 	}
-	
+
 	/* OK, encode it */
 	if (buf)
@@ -458,5 +458,5 @@
 	cpixel_ctx_t cpixel;
 	cpixel_context_init(&cpixel, &rfb->pixel_format);
-	
+
 	size_t size = 0;
 	for (uint16_t y = 0; y < rect->height; y += 16) {
@@ -468,10 +468,10 @@
 				.height = (y + 16 <= rect->height ? 16 : rect->height - y)
 			};
-			
+
 			size += 1;
 			uint8_t *tile_enctype_ptr = buf;
 			if (buf)
 				buf +=  1;
-			
+
 			uint8_t tile_enctype = RFB_TILE_ENCODING_SOLID;
 			size_t tile_size;
@@ -482,5 +482,5 @@
 				tile_enctype = RFB_TILE_ENCODING_RAW;
 			}
-			
+
 			if (buf) {
 				*tile_enctype_ptr = tile_enctype;
@@ -502,5 +502,5 @@
 		rfb->damage_rect.height = rfb->height;
 	}
-	
+
 
 	/* We send only single raw rectangle right now */
@@ -509,5 +509,5 @@
 	    rfb_rect_encode_raw(rfb, &rfb->damage_rect, NULL)
 	    ;
-	
+
 	void *buf = malloc(buf_size);
 	if (buf == NULL) {
@@ -516,5 +516,5 @@
 	}
 	memset(buf, 0, buf_size);
-	
+
 	void *pos = buf;
 	rfb_framebuffer_update_t *fbu = buf;
@@ -523,10 +523,10 @@
 	rfb_framebuffer_update_to_be(fbu, fbu);
 	pos += sizeof(rfb_framebuffer_update_t);
-	
+
 	rfb_rectangle_t *rect = pos;
 	pos += sizeof(rfb_rectangle_t);
-	
+
 	*rect = rfb->damage_rect;
-	
+
 	if (rfb->supports_trle) {
 		rect->enctype = RFB_ENCODING_TRLE;
@@ -538,10 +538,10 @@
 	}
 	rfb_rectangle_to_be(rect, rect);
-	
+
 	rfb->damage_valid = false;
-	
+
 	size_t send_palette_size = 0;
 	void *send_palette = NULL;
-	
+
 	if (!rfb->pixel_format.true_color) {
 		send_palette = rfb_send_palette_message(rfb, &send_palette_size);
@@ -552,7 +552,7 @@
 		}
 	}
-	
+
 	fibril_mutex_unlock(&rfb->lock);
-	
+
 	if (!rfb->pixel_format.true_color) {
 		errno_t rc = tcp_conn_send(conn, send_palette, send_palette_size);
@@ -562,8 +562,8 @@
 		}
 	}
-	
+
 	errno_t rc = tcp_conn_send(conn, buf, buf_size);
 	free(buf);
-	
+
 	return rc;
 }
@@ -605,5 +605,5 @@
 		return;
 	}
-	
+
 	char client_version[12];
 	rc = recv_chars(conn, client_version, 12);
@@ -613,10 +613,10 @@
 		return;
 	}
-	
+
 	if (memcmp(client_version, "RFB 003.008\n", 12) != 0) {
 		log_msg(LOG_DEFAULT, LVL_WARN, "Client version is not RFB 3.8");
 		return;
 	}
-	
+
 	/* Security handshake
 	 * 1 security type supported, which is 1 - None
@@ -631,5 +631,5 @@
 		return;
 	}
-	
+
 	char selected_sec_type = 0;
 	rc = recv_char(conn, &selected_sec_type);
@@ -651,5 +651,5 @@
 		return;
 	}
-	
+
 	/* Client init */
 	char shared_flag;
@@ -660,5 +660,5 @@
 		return;
 	}
-	
+
 	/* Server init */
 	fibril_mutex_lock(&rfb->lock);
@@ -684,5 +684,5 @@
 		return;
 	}
-	
+
 	while (true) {
 		char message_type = 0;
@@ -693,5 +693,5 @@
 			return;
 		}
-		
+
 		rfb_set_pixel_format_t spf;
 		rfb_set_encodings_t se;
@@ -765,5 +765,5 @@
 	inet_ep_t ep;
 	errno_t rc;
-	
+
 	rc = tcp_create(&tcp);
 	if (rc != EOK) {
@@ -771,8 +771,8 @@
 		goto error;
 	}
-	
+
 	inet_ep_init(&ep);
 	ep.port = port;
-	
+
 	rc = tcp_listener_create(tcp, &ep, &listen_cb, rfb, &conn_cb, rfb,
 	    &lst);
@@ -781,8 +781,8 @@
 		goto error;
 	}
-	
+
 	rfb->tcp = tcp;
 	rfb->lst = lst;
-	
+
 	return EOK;
 error:
