lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 29 Apr 2007 04:50:08 +0200
From:	Adrian Bunk <bunk@...sta.de>
To:	Henrique de Moraes Holschuh <hmh@....eng.br>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, lenb@...nel.org,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: Re: [-mm patch] make drivers/misc/thinkpad_acpi:fan_mutex static

On Sat, Apr 28, 2007 at 04:58:21PM -0300, Henrique de Moraes Holschuh wrote:
> On Sat, 28 Apr 2007, Adrian Bunk wrote:
>...
> > BTW: Prototypes for static versions and static variables in a header
> >      file are really wrong, but the mess is bigger than what I'm
> >      willing to clean up...
> 
> It is a private header file, only one file uses it and it is not supposed to
> be used by any other file ever, either.  I can certainly do a cleaning up
> and a lot can be removed (at least 70% of it), but the driver is not linear
> (it is some infrastructure and various subdrivers) and there is a bunch of
> stuff that will need forward declarations regardless.

Forward declarations of static functions (if required) and actual 
variables (like fan_mutex) belong into the C file, not the header.

> Maybe I should just break the driver into multiple files in a subdirectory?
> That would certainly make it *much* cleaner...

But even more in this case, you will not want to have actual variables 
or prototypes of static functions in the header file.

> > --- linux-2.6.21-rc7-mm2/drivers/misc/thinkpad_acpi.h.old	2007-04-27 00:55:58.000000000 +0200
> > +++ linux-2.6.21-rc7-mm2/drivers/misc/thinkpad_acpi.h	2007-04-28 01:32:54.000000000 +0200
> > @@ -382,7 +382,7 @@
> >  static u8 fan_control_desired_level;
> >  static int fan_watchdog_maxinterval;
> >  
> > -struct mutex fan_mutex;
> > +static struct mutex fan_mutex;
> >  
> >  static acpi_handle fans_handle, gfan_handle, sfan_handle;
> >  
>   Henrique Holschuh

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists