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:	Tue, 19 Jun 2012 17:11:28 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Anton Vorontsov <anton.vorontsov@...aro.org>
Cc:	Len Brown <len.brown@...el.com>, Jean Delvare <khali@...ux-fr.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] thermal: Constify 'type' argument for the registration
 routine

On Sun, 17 Jun 2012 21:50:37 -0700
Anton Vorontsov <anton.vorontsov@...aro.org> wrote:

> thermal_zone_device_register() does not modify 'type' argument, so
> it is safe to declare it as const. Otherwise, if we pass a const
> string, we are getting the ugly warning:
> 
> ...
>

For some reason I can't apply this.  I typed it in again and it seems
to work OK.  I'll assume that someone else will merge it into
whatever-tree-broke.

> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -137,7 +137,8 @@ enum {
>  };
>  #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
>  
> -struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
> +struct thermal_zone_device *
> +thermal_zone_device_register(const char *, int, void *,
>  		const struct thermal_zone_device_ops *, int tc1, int tc2,
>  		int passive_freq, int polling_freq);
>  void thermal_zone_device_unregister(struct thermal_zone_device *);

Personally, I prefer it when the arguments are named in the declaration
- if you ever have reason to *read* the thing, the lack of names is
quite maddening.  Particularly when the function has 72 arguments.

But naming some of them and not others is just daft.
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ