mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'Robert Richter'" <rrichter@caviumnetworks.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sunil Goutham <sgoutham@cavium.com>,
	Robert Richter <rric@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Robert Richter <rrichter@cavium.com>
Subject: RE: [PATCH 2/2] net, thunderx: Use bool in structs where possible
Date: Mon, 22 Feb 2016 11:00:02 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CCE6A71@AcuExch.aculab.com> (raw)
In-Reply-To: <1455799149-19590-3-git-send-email-rrichter@caviumnetworks.com>

From: Robert Richter
> Sent: 18 February 2016 12:39
> From: Robert Richter <rrichter@cavium.com>
> 
> Looks like the :1 notation was accidentally introduced (this still
> uses 1 byte per flag). Using bool instead, which is the common use.
> 
> Signed-off-by: Robert Richter <rrichter@cavium.com>
> ---
>  drivers/net/ethernet/cavium/thunder/nic.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cavium/thunder/nic.h b/drivers/net/ethernet/cavium/thunder/nic.h
> index 688828865c48..fa5b1d2d8e23 100644
> --- a/drivers/net/ethernet/cavium/thunder/nic.h
> +++ b/drivers/net/ethernet/cavium/thunder/nic.h
> @@ -262,9 +262,9 @@ struct nicvf {
>  	struct pci_dev		*pdev;
>  	u8			vf_id;
>  	u8			node;
> -	u8			tns_mode:1;
> -	u8			sqs_mode:1;
> -	u8			loopback_supported:1;
> +	bool			tns_mode;
> +	bool                    sqs_mode;
> +	bool			loopback_supported;
>  	bool			hw_tso;
>  	u16			mtu;
>  	struct queue_set	*qs;

If the size of the structure matters, you've just made it two bytes larger.
(Although it looks like there is some padding).

	David

      parent reply	other threads:[~2016-02-22 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 12:39 [PATCH 0/2] net: thunderx: Small cleanups Robert Richter
2016-02-18 12:39 ` [PATCH 1/2] net: thunderx: Fix const type in nicvf_set_rxfh() Robert Richter
2016-02-18 12:39 ` [PATCH 2/2] net, thunderx: Use bool in structs where possible Robert Richter
2016-02-18 16:05   ` David Miller
2016-02-18 16:42     ` Robert Richter
2016-02-18 20:06       ` David Miller
2016-02-22 11:00   ` David Laight [this message]

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=063D6719AE5E284EB5DD2968C1650D6D1CCE6A71@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rric@kernel.org \
    --cc=rrichter@cavium.com \
    --cc=rrichter@caviumnetworks.com \
    --cc=sgoutham@cavium.com \
    /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

all inboxes | Powered by JetHome®