aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2010-10-21 05:50:47 -0400
committerMatthew Garrett <mjg@redhat.com>2010-10-21 10:10:50 -0400
commite253fb944d3335a29bc392eafbe14c43832e806a (patch)
treebdbbd46d4c59b031997c4566a898a3703486cb42 /drivers/platform
parentaa13857f13c3d5535904781e264d8f9115e30438 (diff)
panasonic-laptop: Simplify calls to acpi_pcc_retrieve_biosdata
Function acpi_pcc_retrieve_biosdata is always called with parameters (pcc, pcc->sinf), so we can drop the second parameter. It was dangerous to pass the sinf array separately anyway, as its length is checked as pcc->num_sifr, which pretty much assumed it was pcc->sinf (or at least had the same size.) This change makes the code slightly more compact and thus marginally faster. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Harald Welte <laforge@gnumonks.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/panasonic-laptop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 96dd34155bad..cc1e0ba104d7 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -267,7 +267,7 @@ static inline int acpi_pcc_get_sqty(struct acpi_device *device)
267 } 267 }
268} 268}
269 269
270static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc, u32 *sinf) 270static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc)
271{ 271{
272 acpi_status status; 272 acpi_status status;
273 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 273 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -299,12 +299,12 @@ static int acpi_pcc_retrieve_biosdata(struct pcc_acpi *pcc, u32 *sinf)
299 for (i = 0; i < hkey->package.count; i++) { 299 for (i = 0; i < hkey->package.count; i++) {
300 union acpi_object *element = &(hkey->package.elements[i]); 300 union acpi_object *element = &(hkey->package.elements[i]);
301 if (likely(element->type == ACPI_TYPE_INTEGER)) { 301 if (likely(element->type == ACPI_TYPE_INTEGER)) {
302 sinf[i] = element->integer.value; 302 pcc->sinf[i] = element->integer.value;
303 } else 303 } else
304 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 304 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
305 "Invalid HKEY.SINF data\n")); 305 "Invalid HKEY.SINF data\n"));
306 } 306 }
307 sinf[hkey->package.count] = -1; 307 pcc->sinf[hkey->package.count] = -1;
308 308
309end: 309end:
310 kfree(buffer.pointer); 310 kfree(buffer.pointer);
@@ -322,7 +322,7 @@ static int bl_get(struct backlight_device *bd)
322{ 322{
323 struct pcc_acpi *pcc = bl_get_data(bd); 323 struct pcc_acpi *pcc = bl_get_data(bd);
324 324
325 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 325 if (!acpi_pcc_retrieve_biosdata(pcc))
326 return -EIO; 326 return -EIO;
327 327
328 return pcc->sinf[SINF_AC_CUR_BRIGHT]; 328 return pcc->sinf[SINF_AC_CUR_BRIGHT];
@@ -334,7 +334,7 @@ static int bl_set_status(struct backlight_device *bd)
334 int bright = bd->props.brightness; 334 int bright = bd->props.brightness;
335 int rc; 335 int rc;
336 336
337 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 337 if (!acpi_pcc_retrieve_biosdata(pcc))
338 return -EIO; 338 return -EIO;
339 339
340 if (bright < pcc->sinf[SINF_AC_MIN_BRIGHT]) 340 if (bright < pcc->sinf[SINF_AC_MIN_BRIGHT])
@@ -368,7 +368,7 @@ static ssize_t show_numbatt(struct device *dev, struct device_attribute *attr,
368 struct acpi_device *acpi = to_acpi_device(dev); 368 struct acpi_device *acpi = to_acpi_device(dev);
369 struct pcc_acpi *pcc = acpi_driver_data(acpi); 369 struct pcc_acpi *pcc = acpi_driver_data(acpi);
370 370
371 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 371 if (!acpi_pcc_retrieve_biosdata(pcc))
372 return -EIO; 372 return -EIO;
373 373
374 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]); 374 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
@@ -380,7 +380,7 @@ static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
380 struct acpi_device *acpi = to_acpi_device(dev); 380 struct acpi_device *acpi = to_acpi_device(dev);
381 struct pcc_acpi *pcc = acpi_driver_data(acpi); 381 struct pcc_acpi *pcc = acpi_driver_data(acpi);
382 382
383 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 383 if (!acpi_pcc_retrieve_biosdata(pcc))
384 return -EIO; 384 return -EIO;
385 385
386 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]); 386 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
@@ -392,7 +392,7 @@ static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
392 struct acpi_device *acpi = to_acpi_device(dev); 392 struct acpi_device *acpi = to_acpi_device(dev);
393 struct pcc_acpi *pcc = acpi_driver_data(acpi); 393 struct pcc_acpi *pcc = acpi_driver_data(acpi);
394 394
395 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 395 if (!acpi_pcc_retrieve_biosdata(pcc))
396 return -EIO; 396 return -EIO;
397 397
398 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]); 398 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
@@ -404,7 +404,7 @@ static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
404 struct acpi_device *acpi = to_acpi_device(dev); 404 struct acpi_device *acpi = to_acpi_device(dev);
405 struct pcc_acpi *pcc = acpi_driver_data(acpi); 405 struct pcc_acpi *pcc = acpi_driver_data(acpi);
406 406
407 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 407 if (!acpi_pcc_retrieve_biosdata(pcc))
408 return -EIO; 408 return -EIO;
409 409
410 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]); 410 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
@@ -594,7 +594,7 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
594 goto out_sinf; 594 goto out_sinf;
595 } 595 }
596 596
597 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) { 597 if (!acpi_pcc_retrieve_biosdata(pcc)) {
598 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 598 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
599 "Couldn't retrieve BIOS data\n")); 599 "Couldn't retrieve BIOS data\n"));
600 result = -EIO; 600 result = -EIO;