aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2013-08-30 06:30:51 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-23 19:40:38 -0400
commitbf9b59f2571d0d0470f904842a283ac7957438cd (patch)
tree3da513d38db75493787ce21828604769b3ae2e03
parent1bb25df0fde2cdb2f250a7e7e43c2ec1ba65d0f5 (diff)
ACPI / processor: remove superfluous pr == NULL checks
The only acpi_processor_get_power_info_fadt() user (acpi_processor_get_power_info()) dereferences pr before calling the function. The only acpi_processor_hotplug() user (acpi_cpu_soft_notify()) checks for pr == NULL before calling the function. The only acpi_processor_cst_has_changed() user (acpi_processor_notify()) checks for pr == NULL before calling the function. The only acpi_processor_power_init() user (__acpi_processor_start()) dereferences pr before calling the function. Thus remove superfluous pr == NULL checks from affected functions. Also: While at it remove redundant brackets from acpi_processor_hotplug(). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/processor_idle.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f98dd00b51a9..35c8f2bbcc40 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -272,9 +272,6 @@ static void tsc_check_state(int state) { return; }
272static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) 272static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
273{ 273{
274 274
275 if (!pr)
276 return -EINVAL;
277
278 if (!pr->pblk) 275 if (!pr->pblk)
279 return -ENODEV; 276 return -ENODEV;
280 277
@@ -1076,12 +1073,8 @@ int acpi_processor_hotplug(struct acpi_processor *pr)
1076 if (disabled_by_idle_boot_param()) 1073 if (disabled_by_idle_boot_param())
1077 return 0; 1074 return 0;
1078 1075
1079 if (!pr) 1076 if (nocst)
1080 return -EINVAL;
1081
1082 if (nocst) {
1083 return -ENODEV; 1077 return -ENODEV;
1084 }
1085 1078
1086 if (!pr->flags.power_setup_done) 1079 if (!pr->flags.power_setup_done)
1087 return -ENODEV; 1080 return -ENODEV;
@@ -1108,9 +1101,6 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
1108 if (disabled_by_idle_boot_param()) 1101 if (disabled_by_idle_boot_param())
1109 return 0; 1102 return 0;
1110 1103
1111 if (!pr)
1112 return -EINVAL;
1113
1114 if (nocst) 1104 if (nocst)
1115 return -ENODEV; 1105 return -ENODEV;
1116 1106
@@ -1183,9 +1173,6 @@ int acpi_processor_power_init(struct acpi_processor *pr)
1183 first_run++; 1173 first_run++;
1184 } 1174 }
1185 1175
1186 if (!pr)
1187 return -EINVAL;
1188
1189 if (acpi_gbl_FADT.cst_control && !nocst) { 1176 if (acpi_gbl_FADT.cst_control && !nocst) {
1190 status = 1177 status =
1191 acpi_os_write_port(acpi_gbl_FADT.smi_command, acpi_gbl_FADT.cst_control, 8); 1178 acpi_os_write_port(acpi_gbl_FADT.smi_command, acpi_gbl_FADT.cst_control, 8);