Przeglądaj źródła

PM / Hibernate: Use bool for boolean fields of struct snapshot_data

The snapshot_data structure used internally by the hibernate user
space interface code in user.c has three char fields that are used
to store boolean values.  Change their data type to bool and use
true and false instead of 1 and 0, respectively, in assignments
involving those fields.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Rafael J. Wysocki 12 lat temu
rodzic
commit
7bc9b1cffc
1 zmienionych plików z 10 dodań i 10 usunięć
  1. 10 10
      kernel/power/user.c

+ 10 - 10
kernel/power/user.c

@@ -36,9 +36,9 @@ static struct snapshot_data {
 	struct snapshot_handle handle;
 	struct snapshot_handle handle;
 	int swap;
 	int swap;
 	int mode;
 	int mode;
-	char frozen;
-	char ready;
-	char platform_support;
+	bool frozen;
+	bool ready;
+	bool platform_support;
 	bool free_bitmaps;
 	bool free_bitmaps;
 } snapshot_state;
 } snapshot_state;
 
 
@@ -93,9 +93,9 @@ static int snapshot_open(struct inode *inode, struct file *filp)
 	if (error)
 	if (error)
 		atomic_inc(&snapshot_device_available);
 		atomic_inc(&snapshot_device_available);
 
 
-	data->frozen = 0;
-	data->ready = 0;
-	data->platform_support = 0;
+	data->frozen = false;
+	data->ready = false;
+	data->platform_support = false;
 
 
  Unlock:
  Unlock:
 	unlock_system_sleep();
 	unlock_system_sleep();
@@ -229,7 +229,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
 		if (error)
 		if (error)
 			thaw_processes();
 			thaw_processes();
 		else
 		else
-			data->frozen = 1;
+			data->frozen = true;
 
 
 		break;
 		break;
 
 
@@ -240,7 +240,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
 		free_basic_memory_bitmaps();
 		free_basic_memory_bitmaps();
 		data->free_bitmaps = false;
 		data->free_bitmaps = false;
 		thaw_processes();
 		thaw_processes();
-		data->frozen = 0;
+		data->frozen = false;
 		break;
 		break;
 
 
 	case SNAPSHOT_CREATE_IMAGE:
 	case SNAPSHOT_CREATE_IMAGE:
@@ -270,7 +270,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
 	case SNAPSHOT_FREE:
 	case SNAPSHOT_FREE:
 		swsusp_free();
 		swsusp_free();
 		memset(&data->handle, 0, sizeof(struct snapshot_handle));
 		memset(&data->handle, 0, sizeof(struct snapshot_handle));
-		data->ready = 0;
+		data->ready = false;
 		/*
 		/*
 		 * It is necessary to thaw kernel threads here, because
 		 * It is necessary to thaw kernel threads here, because
 		 * SNAPSHOT_CREATE_IMAGE may be invoked directly after
 		 * SNAPSHOT_CREATE_IMAGE may be invoked directly after
@@ -334,7 +334,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
 		 * PM_HIBERNATION_PREPARE
 		 * PM_HIBERNATION_PREPARE
 		 */
 		 */
 		error = suspend_devices_and_enter(PM_SUSPEND_MEM);
 		error = suspend_devices_and_enter(PM_SUSPEND_MEM);
-		data->ready = 0;
+		data->ready = false;
 		break;
 		break;
 
 
 	case SNAPSHOT_PLATFORM_SUPPORT:
 	case SNAPSHOT_PLATFORM_SUPPORT: