diff --git a/miscutils/crond.c b/miscutils/crond.c
index 0b2d558..6db4df4 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -423,7 +423,7 @@
 
 static void FixDayDow(CronLine *line)
 {
-	size_t i;
+	unsigned i;
 	int weekUsed = 0;
 	int daysUsed = 0;
 
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index ec5ede6..7afa9ff 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -1486,7 +1486,8 @@
 
 static int translate_xfermode(const char *name)
 {
-	int val, i;
+	int val;
+	unsigned i;
 
 	for (i = 0; i < ARRAY_SIZE(xfermode_val); i++) {
 		if (!strncmp(name, xfermode_name[i], 5))
diff --git a/miscutils/less.c b/miscutils/less.c
index 065bf6f..25b91c0 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -297,7 +297,7 @@
 					new_linepos += 7;
 					new_linepos &= (~7);
 				}
-				if (new_linepos >= w)
+				if ((int)new_linepos >= w)
 					break;
 				linepos = new_linepos;
 			}
@@ -415,7 +415,7 @@
 	printf(" lines %i-%i/%i ",
 			cur_fline + 1, cur_fline + max_displayed_line + 1,
 			max_fline + 1);
-	if (cur_fline >= max_fline - max_displayed_line) {
+	if (cur_fline >= (int)(max_fline - max_displayed_line)) {
 		printf("(END)"NORMAL);
 		if (num_files > 1 && current_file != num_files)
 			printf(HIGHLIGHT" - next: %s"NORMAL, files[current_file]);
@@ -444,7 +444,7 @@
 #endif
 
 	clear_line();
-	if (cur_fline && cur_fline < max_fline - max_displayed_line) {
+	if (cur_fline && cur_fline < (int)(max_fline - max_displayed_line)) {
 		bb_putchar(':');
 		return;
 	}
@@ -587,7 +587,7 @@
 /* Print the buffer */
 static void buffer_print(void)
 {
-	int i;
+	unsigned i;
 
 	move_cursor(0, 0);
 	for (i = 0; i <= max_displayed_line; i++)
@@ -600,7 +600,7 @@
 
 static void buffer_fill_and_print(void)
 {
-	int i;
+	unsigned i;
 	for (i = 0; i <= max_displayed_line && cur_fline + i <= max_fline; i++) {
 		buffer[i] = flines[cur_fline + i];
 	}
@@ -662,7 +662,7 @@
 /* Reinitialize everything for a new file - free the memory and start over */
 static void reinitialize(void)
 {
-	int i;
+	unsigned i;
 
 	if (flines) {
 		for (i = 0; i <= max_fline; i++)
@@ -763,7 +763,7 @@
 static char* less_gets(int sz)
 {
 	char c;
-	int i = 0;
+	unsigned i = 0;
 	char *result = xzalloc(1);
 
 	while (1) {
@@ -836,7 +836,7 @@
 
 static void remove_current_file(void)
 {
-	int i;
+	unsigned i;
 
 	if (num_files < 2)
 		return;
@@ -974,7 +974,7 @@
 	match_pos = 0;
 	fill_match_lines(0);
 	while (match_pos < num_matches) {
-		if (match_lines[match_pos] > cur_fline)
+		if ((int)match_lines[match_pos] > cur_fline)
 			break;
 		match_pos++;
 	}
@@ -990,7 +990,7 @@
 
 static void number_process(int first_digit)
 {
-	int i;
+	unsigned i;
 	int num;
 	char num_input[sizeof(int)*4]; /* more than enough */
 	char keypress;
@@ -1120,7 +1120,7 @@
 {
 	const char *msg = "";
 	char *current_line;
-	int i;
+	unsigned i;
 	FILE *fp;
 
 	print_statusline("Log file: ");
@@ -1204,7 +1204,7 @@
 
 static void match_right_bracket(char bracket)
 {
-	int i;
+	unsigned i;
 
 	if (strchr(flines[cur_fline], bracket) == NULL) {
 		print_statusline("No bracket in top line");
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index 43e4b8c..3b45d70 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -99,12 +99,12 @@
 
 	while ((line = xmalloc_fgetline(table)) != NULL) {
 		char type;
-		unsigned int mode = 0755;
-		unsigned int major = 0;
-		unsigned int minor = 0;
-		unsigned int count = 0;
-		unsigned int increment = 0;
-		unsigned int start = 0;
+		unsigned mode = 0755;
+		unsigned major = 0;
+		unsigned minor = 0;
+		unsigned count = 0;
+		unsigned increment = 0;
+		unsigned start = 0;
 		char name[41];
 		char user[41];
 		char group[41];
@@ -121,7 +121,7 @@
 		{
 			if (*line=='\0' || *line=='#' || isspace(*line))
 				continue;
-			bb_error_msg("line %d invalid: '%s'", linenum, line);
+			bb_error_msg("invalid line %d: '%s'", linenum, line);
 			ret = EXIT_FAILURE;
 			continue;
 		}
@@ -140,7 +140,7 @@
 				ret = EXIT_FAILURE;
 				goto loop;
 			}
-			if ((mode != -1) && (chmod(full_name, mode) < 0)){
+			if (chmod(full_name, mode) < 0) {
 				bb_perror_msg("line %d: chmod failed for %s", linenum, full_name);
 				ret = EXIT_FAILURE;
 				goto loop;
@@ -157,7 +157,7 @@
 				ret = EXIT_FAILURE;
 				goto loop;
 			}
-			if ((mode != -1) && (chmod(full_name, mode) < 0)){
+			if (chmod(full_name, mode) < 0) {
 				bb_perror_msg("line %d: chmod failed for %s", linenum, full_name);
 				ret = EXIT_FAILURE;
 				goto loop;
@@ -180,7 +180,7 @@
 			}
 
 			if (count > 0) {
-				int i;
+				unsigned i;
 				char *full_name_inc;
 
 				full_name_inc = xmalloc(strlen(full_name) + 4);
@@ -195,7 +195,7 @@
 						bb_perror_msg("line %d: chown failed for %s", linenum, full_name_inc);
 						ret = EXIT_FAILURE;
 					}
-					if ((mode != -1) && (chmod(full_name_inc, mode) < 0)){
+					if (chmod(full_name_inc, mode) < 0) {
 						bb_perror_msg("line %d: chmod failed for %s", linenum, full_name_inc);
 						ret = EXIT_FAILURE;
 					}
@@ -211,7 +211,7 @@
 					bb_perror_msg("line %d: chown failed for %s", linenum, full_name);
 					ret = EXIT_FAILURE;
 				}
-				if ((mode != -1) && (chmod(full_name, mode) < 0)){
+				if (chmod(full_name, mode) < 0) {
 					bb_perror_msg("line %d: chmod failed for %s", linenum, full_name);
 					ret = EXIT_FAILURE;
 				}
