lkml.org 
[lkml]   [2008]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers/ide/ide-probe.c: uninitialized variable 'rc'
Date

Hi,

On Tuesday 09 September 2008, Steven Noonan wrote:
> Fixed the warning by initializing 'rc' to zero.
>
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>
> ---
> drivers/ide/ide-probe.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
> index 994e410..e53c645 100644
> --- a/drivers/ide/ide-probe.c
> +++ b/drivers/ide/ide-probe.c
> @@ -1492,7 +1492,7 @@ static struct device_attribute *ide_port_attrs[] = {
>
> static int ide_sysfs_register_port(ide_hwif_t *hwif)
> {
> - int i, rc;
> + int i, rc = 0;
>
> for (i = 0; ide_port_attrs[i]; i++) {
> rc = device_create_file(hwif->portdev, ide_port_attrs[i]);

I recall seeing identical patch before:

http://article.gmane.org/gmane.linux.ide/33107

Does the existing code really results in gcc warning?

If so we may apply it just to shut-up the broken gcc version...

Thanks,
Bart


\
 
 \ /
  Last update: 2008-09-10 23:19    [W:0.080 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site