linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Len Brown <len.brown@intel.com>,
	Jean Delvare <khali@linux-fr.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: Constify 'type' argument for the registration routine
Date: Tue, 19 Jun 2012 17:11:28 -0700	[thread overview]
Message-ID: <20120619171128.377fc971.akpm@linux-foundation.org> (raw)
In-Reply-To: <1339995037-19561-1-git-send-email-cbouatmailru@gmail.com>

On Sun, 17 Jun 2012 21:50:37 -0700
Anton Vorontsov <anton.vorontsov@linaro.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.

  parent reply	other threads:[~2012-06-20  0:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18  4:50 [PATCH] thermal: Constify 'type' argument for the registration routine Anton Vorontsov
2012-06-18  6:19 ` Jean Delvare
2012-06-20  0:11 ` Andrew Morton [this message]
2012-06-20  1:25   ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120619171128.377fc971.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=khali@linux-fr.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).