All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] i40evf: remove redundant array comparisons to 0 checks
Date: Sun, 18 Feb 2018 08:31:50 -0800	[thread overview]
Message-ID: <1518971510.1894.2.camel@perches.com> (raw)
In-Reply-To: <CAHp75VcsV4NfR3OiAjjYAowcHmK+rXOsrPN2aHnxBp5hqg+C+g@mail.gmail.com>

On Sun, 2018-02-18 at 16:58 +0200, Andy Shevchenko wrote:
> On Fri, Feb 16, 2018 at 6:53 PM, Colin Ian King
> <colin.king@canonical.com> wrote:
> > On 16/02/18 16:51, Andy Shevchenko wrote:
> > > On Thu, Feb 15, 2018 at 9:42 PM, Colin King <colin.king@canonical.com> wrote:
> > > > +                       filter->f.mask.tcp_spec.dst_ip[i] |=
> > > >                                                         cpu_to_be32(0xffffffff);
> > > 
> > > Can it be one line then?
> > 
> > I re-adjusted the text because checkpatch was complaining.
> > > 
> > > > +                       filter->f.mask.tcp_spec.src_ip[i] |=
> > > >                                                         cpu_to_be32(0xffffffff);
> 
> For the rest OK, but for the above two how much over 80 it went if
> would be one line?
> If it 2-3 characters, consider to make it one line. It would increase
> readability.

Another possibility would be to use temporaries for
	filter->f.mask.tcp_spec
and
	filter->f.data.tcp_spec
as both are used ~10 times in the function



WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Colin Ian King <colin.king@canonical.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	intel-wired-lan@lists.osuosl.org, netdev <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] i40evf: remove redundant array comparisons to 0 checks
Date: Sun, 18 Feb 2018 16:31:50 +0000	[thread overview]
Message-ID: <1518971510.1894.2.camel@perches.com> (raw)
In-Reply-To: <CAHp75VcsV4NfR3OiAjjYAowcHmK+rXOsrPN2aHnxBp5hqg+C+g@mail.gmail.com>

On Sun, 2018-02-18 at 16:58 +0200, Andy Shevchenko wrote:
> On Fri, Feb 16, 2018 at 6:53 PM, Colin Ian King
> <colin.king@canonical.com> wrote:
> > On 16/02/18 16:51, Andy Shevchenko wrote:
> > > On Thu, Feb 15, 2018 at 9:42 PM, Colin King <colin.king@canonical.com> wrote:
> > > > +                       filter->f.mask.tcp_spec.dst_ip[i] |> > > >                                                         cpu_to_be32(0xffffffff);
> > > 
> > > Can it be one line then?
> > 
> > I re-adjusted the text because checkpatch was complaining.
> > > 
> > > > +                       filter->f.mask.tcp_spec.src_ip[i] |> > > >                                                         cpu_to_be32(0xffffffff);
> 
> For the rest OK, but for the above two how much over 80 it went if
> would be one line?
> If it 2-3 characters, consider to make it one line. It would increase
> readability.

Another possibility would be to use temporaries for
	filter->f.mask.tcp_spec
and
	filter->f.data.tcp_spec
as both are used ~10 times in the function



WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Colin Ian King <colin.king@canonical.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	intel-wired-lan@lists.osuosl.org, netdev <netdev@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] i40evf: remove redundant array comparisons to 0 checks
Date: Sun, 18 Feb 2018 08:31:50 -0800	[thread overview]
Message-ID: <1518971510.1894.2.camel@perches.com> (raw)
In-Reply-To: <CAHp75VcsV4NfR3OiAjjYAowcHmK+rXOsrPN2aHnxBp5hqg+C+g@mail.gmail.com>

On Sun, 2018-02-18 at 16:58 +0200, Andy Shevchenko wrote:
> On Fri, Feb 16, 2018 at 6:53 PM, Colin Ian King
> <colin.king@canonical.com> wrote:
> > On 16/02/18 16:51, Andy Shevchenko wrote:
> > > On Thu, Feb 15, 2018 at 9:42 PM, Colin King <colin.king@canonical.com> wrote:
> > > > +                       filter->f.mask.tcp_spec.dst_ip[i] |=
> > > >                                                         cpu_to_be32(0xffffffff);
> > > 
> > > Can it be one line then?
> > 
> > I re-adjusted the text because checkpatch was complaining.
> > > 
> > > > +                       filter->f.mask.tcp_spec.src_ip[i] |=
> > > >                                                         cpu_to_be32(0xffffffff);
> 
> For the rest OK, but for the above two how much over 80 it went if
> would be one line?
> If it 2-3 characters, consider to make it one line. It would increase
> readability.

Another possibility would be to use temporaries for
	filter->f.mask.tcp_spec
and
	filter->f.data.tcp_spec
as both are used ~10 times in the function

  reply	other threads:[~2018-02-18 16:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-15 19:42 [Intel-wired-lan] [PATCH] i40evf: remove redundant array comparisons to 0 checks Colin King
2018-02-15 19:42 ` Colin King
2018-02-15 19:42 ` Colin King
2018-02-15 22:39 ` [Intel-wired-lan] " Ramamurthy, Harshitha
2018-02-16 16:51 ` Andy Shevchenko
2018-02-16 16:51   ` Andy Shevchenko
2018-02-16 16:51   ` Andy Shevchenko
2018-02-16 16:53   ` [Intel-wired-lan] " Colin Ian King
2018-02-16 16:53     ` Colin Ian King
2018-02-16 16:53     ` Colin Ian King
2018-02-18 14:58     ` [Intel-wired-lan] " Andy Shevchenko
2018-02-18 14:58       ` Andy Shevchenko
2018-02-18 14:58       ` Andy Shevchenko
2018-02-18 16:31       ` Joe Perches [this message]
2018-02-18 16:31         ` Joe Perches
2018-02-18 16:31         ` Joe Perches
2018-02-18 19:00         ` [Intel-wired-lan] " Colin Ian King
2018-02-18 19:00           ` Colin Ian King
2018-02-18 19:00           ` Colin Ian King

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=1518971510.1894.2.camel@perches.com \
    --to=joe@perches.com \
    --cc=intel-wired-lan@osuosl.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.