diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-18 16:20:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-18 16:20:40 -0400 |
commit | 7bc9b1cffc95675a957e870d258e95d43dcbba0b (patch) | |
tree | 4a751a9741cb4c111b94c088bb8afd2ba78a472e /kernel/power | |
parent | 70fea60d888d472ac044910fd0dc46b304419705 (diff) |
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>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/user.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 957f06164ad1..24850270c802 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -36,9 +36,9 @@ static struct snapshot_data { | |||
36 | struct snapshot_handle handle; | 36 | struct snapshot_handle handle; |
37 | int swap; | 37 | int swap; |
38 | int mode; | 38 | int mode; |
39 | char frozen; | 39 | bool frozen; |
40 | char ready; | 40 | bool ready; |
41 | char platform_support; | 41 | bool platform_support; |
42 | bool free_bitmaps; | 42 | bool free_bitmaps; |
43 | } snapshot_state; | 43 | } snapshot_state; |
44 | 44 | ||
@@ -93,9 +93,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) | |||
93 | if (error) | 93 | if (error) |
94 | atomic_inc(&snapshot_device_available); | 94 | atomic_inc(&snapshot_device_available); |
95 | 95 | ||
96 | data->frozen = 0; | 96 | data->frozen = false; |
97 | data->ready = 0; | 97 | data->ready = false; |
98 | data->platform_support = 0; | 98 | data->platform_support = false; |
99 | 99 | ||
100 | Unlock: | 100 | Unlock: |
101 | unlock_system_sleep(); | 101 | unlock_system_sleep(); |
@@ -229,7 +229,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
229 | if (error) | 229 | if (error) |
230 | thaw_processes(); | 230 | thaw_processes(); |
231 | else | 231 | else |
232 | data->frozen = 1; | 232 | data->frozen = true; |
233 | 233 | ||
234 | break; | 234 | break; |
235 | 235 | ||
@@ -240,7 +240,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
240 | free_basic_memory_bitmaps(); | 240 | free_basic_memory_bitmaps(); |
241 | data->free_bitmaps = false; | 241 | data->free_bitmaps = false; |
242 | thaw_processes(); | 242 | thaw_processes(); |
243 | data->frozen = 0; | 243 | data->frozen = false; |
244 | break; | 244 | break; |
245 | 245 | ||
246 | case SNAPSHOT_CREATE_IMAGE: | 246 | case SNAPSHOT_CREATE_IMAGE: |
@@ -270,7 +270,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
270 | case SNAPSHOT_FREE: | 270 | case SNAPSHOT_FREE: |
271 | swsusp_free(); | 271 | swsusp_free(); |
272 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); | 272 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); |
273 | data->ready = 0; | 273 | data->ready = false; |
274 | /* | 274 | /* |
275 | * It is necessary to thaw kernel threads here, because | 275 | * It is necessary to thaw kernel threads here, because |
276 | * SNAPSHOT_CREATE_IMAGE may be invoked directly after | 276 | * SNAPSHOT_CREATE_IMAGE may be invoked directly after |
@@ -334,7 +334,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
334 | * PM_HIBERNATION_PREPARE | 334 | * PM_HIBERNATION_PREPARE |
335 | */ | 335 | */ |
336 | error = suspend_devices_and_enter(PM_SUSPEND_MEM); | 336 | error = suspend_devices_and_enter(PM_SUSPEND_MEM); |
337 | data->ready = 0; | 337 | data->ready = false; |
338 | break; | 338 | break; |
339 | 339 | ||
340 | case SNAPSHOT_PLATFORM_SUPPORT: | 340 | case SNAPSHOT_PLATFORM_SUPPORT: |