All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Ioannis Valasakis <code@wizofe.uk>
Cc: outreachy-kernel@googlegroups.com, aditya.shankar@microchip.com,
	ganesh.krishna@microchip.com
Subject: Re: [PATCH 3/3] staging: wilc1000: Change struct members from bool to u8
Date: Wed, 10 Oct 2018 20:32:10 +0200	[thread overview]
Message-ID: <20181010183210.GA24096@kroah.com> (raw)
In-Reply-To: <e409baf10c6cc043344f1a63712d661611953973.1539182155.git.code@wizofe.uk>

On Wed, Oct 10, 2018 at 03:48:21PM +0100, Ioannis Valasakis wrote:
> Recent versions of checkpatch have a new warning based on a documented
> preference of Linus to not use bool in structures due to wasted space and
> the size of bool is implementation dependent.  For more information, see
> the email thread at https://lkml.org/lkml/2017/11/21/384.
> 
> Signed-off-by: Ioannis Valasakis <code@wizofe.uk>
> ---
>  drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
>  drivers/staging/wilc1000/host_interface.h     |  8 ++++----
>  drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
>  3 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
> index b62acb447383..dbea5144395e 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.h
> +++ b/drivers/staging/wilc1000/coreconfigurator.h
> @@ -30,7 +30,7 @@
>  #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
>  
>  struct rssi_history_buffer {
> -	bool full;
> +	u8 full;

No, this reduces the information about the field.  There's no wasted
space here at all, the end result is the same.  The issue is, as
Himanshu points out, when using bool instead of a bitfield.

So this patch isn't needed, sorry.

greg k-h


  parent reply	other threads:[~2018-10-10 18:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 14:46 [PATCH 0/3] staging: wilc1000 Ioannis Valasakis
2018-10-10 14:47 ` [PATCH 1/3] staging: wilc1000: replace udelay with usleep_range Ioannis Valasakis
2018-10-10 14:54   ` [Outreachy kernel] " Julia Lawall
2018-10-10 14:59     ` Ioannis Valasakis
2018-10-10 15:02       ` Julia Lawall
2018-10-10 15:13         ` Ioannis Valasakis
2018-10-10 18:33   ` Greg KH
2018-10-10 14:47 ` [PATCH 2/3] staging: wilc1000: prefer 'help' in KConfig Ioannis Valasakis
2018-10-10 14:48 ` [PATCH 3/3] staging: wilc1000: Change struct members from bool to u8 Ioannis Valasakis
2018-10-10 14:58   ` [Outreachy kernel] " Julia Lawall
2018-10-10 18:10   ` Himanshu Jha
2018-10-10 18:32   ` Greg KH [this message]
2018-10-11  8:52     ` Ioannis Valasakis

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=20181010183210.GA24096@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=aditya.shankar@microchip.com \
    --cc=code@wizofe.uk \
    --cc=ganesh.krishna@microchip.com \
    --cc=outreachy-kernel@googlegroups.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 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.