lkml.org 
[lkml]   [2010]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/5]acpi:glue.c Fix warning: variable 'ret' set but not used
Date
Justin P. Mattock <justinmattock@gmail.com> wrote:

> + if (fn) {
> + dev_warn(&acpi_dev->dev,
> + "Failed to create firmware_node link to %s %s: %d\n",
> + dev_driver_string(dev), dev_name(dev), fn);
> + } else if (pn) {
> + dev_warn(&acpi_dev->dev,
> + "Failed to create physical_node link to %s %s: %d\n",
> + dev_driver_string(dev), dev_name(dev), pn);
> + return AE_ERROR;
> + }

There's one more question to ask yourself: do you really need two dev_warn()
statements? You could have just one that prints both error values:

if (fn || pn)
dev_warn(&acpi_dev->dev,
"Failed to create link(s) to %s %s:"
" fn=%d pn=%d\n",
dev_driver_string(dev), dev_name(dev),
fn, pn);

Not sure it's worth going that far. You could reduce it still further:

if (fn || pn)
dev_warn(&acpi_dev->dev,
"Failed to create link(s) to %s %s:"
" %d\n",
dev_driver_string(dev), dev_name(dev),
fn ?: pn);

Is it that important to know which failed to be created, or that both failed
to be created?

David


\
 
 \ /
  Last update: 2010-07-01 11:35    [W:0.064 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site