All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Thomas Graf <tgraf@suug.ch>, Alexei Starovoitov <ast@kernel.org>,
	Joe Stringer <joe@ovn.org>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [patch] samples/bpf: silence shift wrapping warning
Date: Mon, 23 Jan 2017 22:44:34 -0800	[thread overview]
Message-ID: <CAADnVQLF6PWEjic6aSRBnRqtO25eEw7YLE+Gb95+f5_pvq3ZMA@mail.gmail.com> (raw)

On Mon, Jan 23, 2017 at 5:27 AM, Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
> Em Sun, Jan 22, 2017 at 02:51:25PM -0800, Alexei Starovoitov escreveu:
>> On Sat, Jan 21, 2017 at 07:51:43AM +0300, Dan Carpenter wrote:
>> > max_key is a value in the 0-63 range, so on 32 bit systems the shift
>> > could wrap.
>> >
>> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> Looks fine. I think 'net-next' is ok.
>
> I could process these patches, if that would help,

Thanks for the offer.
I don't think there will be conflicts with all the work happening in net-next,
but it's best to avoid even possibility of it when we can.
Dan,
can you please resend the patch cc-ing Dave and netdev ?
please mention [PATCH net-next] in the subject.

> - Arnaldo
>
>> Acked-by: Alexei Starovoitov <ast@kernel.org>
>
>> > diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_user.c
>> > index ec8f3bb..bd06eef 100644
>> > --- a/samples/bpf/lwt_len_hist_user.c
>> > +++ b/samples/bpf/lwt_len_hist_user.c
>> > @@ -68,7 +68,7 @@ int main(int argc, char **argv)
>> >     for (i = 1; i <= max_key + 1; i++) {
>> >             stars(starstr, data[i - 1], max_value, MAX_STARS);
>> >             printf("%8ld -> %-8ld : %-8ld |%-*s|\n",
>> > -                  (1l << i) >> 1, (1l << i) - 1, data[i - 1],
>> > +                  (1ULL << i) >> 1, (1ULL << i) - 1, data[i - 1],
>> >                    MAX_STARS, starstr);
>> >     }
>> >

WARNING: multiple messages have this Message-ID (diff)
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Thomas Graf <tgraf@suug.ch>, Alexei Starovoitov <ast@kernel.org>,
	Joe Stringer <joe@ovn.org>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [patch] samples/bpf: silence shift wrapping warning
Date: Tue, 24 Jan 2017 06:44:34 +0000	[thread overview]
Message-ID: <CAADnVQLF6PWEjic6aSRBnRqtO25eEw7YLE+Gb95+f5_pvq3ZMA@mail.gmail.com> (raw)
In-Reply-To: <20170121045143.GC15269@mwanda>

On Mon, Jan 23, 2017 at 5:27 AM, Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
> Em Sun, Jan 22, 2017 at 02:51:25PM -0800, Alexei Starovoitov escreveu:
>> On Sat, Jan 21, 2017 at 07:51:43AM +0300, Dan Carpenter wrote:
>> > max_key is a value in the 0-63 range, so on 32 bit systems the shift
>> > could wrap.
>> >
>> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> Looks fine. I think 'net-next' is ok.
>
> I could process these patches, if that would help,

Thanks for the offer.
I don't think there will be conflicts with all the work happening in net-next,
but it's best to avoid even possibility of it when we can.
Dan,
can you please resend the patch cc-ing Dave and netdev ?
please mention [PATCH net-next] in the subject.

> - Arnaldo
>
>> Acked-by: Alexei Starovoitov <ast@kernel.org>
>
>> > diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_user.c
>> > index ec8f3bb..bd06eef 100644
>> > --- a/samples/bpf/lwt_len_hist_user.c
>> > +++ b/samples/bpf/lwt_len_hist_user.c
>> > @@ -68,7 +68,7 @@ int main(int argc, char **argv)
>> >     for (i = 1; i <= max_key + 1; i++) {
>> >             stars(starstr, data[i - 1], max_value, MAX_STARS);
>> >             printf("%8ld -> %-8ld : %-8ld |%-*s|\n",
>> > -                  (1l << i) >> 1, (1l << i) - 1, data[i - 1],
>> > +                  (1ULL << i) >> 1, (1ULL << i) - 1, data[i - 1],
>> >                    MAX_STARS, starstr);
>> >     }
>> >

             reply	other threads:[~2017-01-24  6:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24  6:44 Alexei Starovoitov [this message]
2017-01-24  6:44 ` [patch] samples/bpf: silence shift wrapping warning Alexei Starovoitov
2017-01-24  8:46 ` Dan Carpenter
2017-01-24  8:46   ` Dan Carpenter
2017-01-24 16:02 ` Arnaldo Carvalho de Melo
2017-01-24 16:02   ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2017-01-21  4:51 Dan Carpenter
2017-01-21  4:51 ` Dan Carpenter
2017-01-22 22:51 ` Alexei Starovoitov
2017-01-22 22:51   ` Alexei Starovoitov
2017-01-23 13:27   ` Arnaldo Carvalho de Melo
2017-01-23 13:27     ` Arnaldo Carvalho de Melo
2017-01-25 11:08   ` David Laight

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=CAADnVQLF6PWEjic6aSRBnRqtO25eEw7YLE+Gb95+f5_pvq3ZMA@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=joe@ovn.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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.