lkml.org 
[lkml]   [2016]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 2/2] net, thunderx: Use bool in structs where possible
Date
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

\
 
 \ /
  Last update: 2016-02-22 12:21    [W:0.092 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site