All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: Re: [Powertop] [PATCH] src/process/do_process.cpp: Add suffix `u` to `4294967295` to signify an unsigned number
Date: Sun, 03 Feb 2013 18:10:12 +0300	[thread overview]
Message-ID: <20130203151012.GB2470@swordfish> (raw)
In-Reply-To: 1359843789.5545.21.camel@mattotaupa

[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]

On (02/02/13 23:23), Paul Menzel wrote:
> 
> The C++ compiler
> 
>         $ g++ --version
>         g++-4.7.real (Debian 4.7.2-15) 4.7.2
>         Copyright (C) 2012 Free Software Foundation, Inc.
>         This is free software; see the source for copying conditions.  There is NO
>         warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> reports the following warning.
> 
>         $ make
>         […]
>           CXX    process/powertop-do_process.o
>         process/do_process.cpp:595:3: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
>         […]
> 
> Adding the suffix to the constant gets rid of the warning [1].
> 
> [1] http://stackoverflow.com/questions/2347936/cant-get-rid-of-this-decimal-constant-is-unsigned-only-in-iso-c90-warning
> ---
>  src/process/do_process.cpp |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/process/do_process.cpp b/src/process/do_process.cpp
> index 322ad4c..3bb1573 100644
> --- a/src/process/do_process.cpp
> +++ b/src/process/do_process.cpp
> @@ -579,7 +579,7 @@ void perf_process_bundle::handle_trace_point(void *trace, int cpu, uint64_t time
>  	}
>  	else if (strcmp(event->name, "cpu_idle") == 0) {
>  		ret = pevent_get_field_val(NULL, event, "state", &rec, &val, 0);
> -		if (val == 4294967295)
> +		if (val == 4294967295u)

NACK.

the same point: cpu_idle tracepoint defined as    

         TP_PROTO(unsigned int state, unsigned int cpu_id)
please use `== (unsigned int)-1'.
   

+ we need there `-1' return code check from pevent_get_field_val() before
we test val.

               
        -ss


>  			consume_blame(cpu);
>  		else
>  			set_wakeup_pending(cpu);
> -- 
> 1.7.10.4



> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop


             reply	other threads:[~2013-02-03 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03 15:10 Sergey Senozhatsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-02-02 22:23 [Powertop] [PATCH] src/process/do_process.cpp: Add suffix `u` to `4294967295` to signify an unsigned number Paul Menzel

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=20130203151012.GB2470@swordfish \
    --to=powertop@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.