All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Staging: rtl8192e: Avoid using bool structure members
@ 2019-02-20  7:30 Bhanusree Pola
  2019-02-20  7:53 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Bhanusree Pola @ 2019-02-20  7:30 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman

Use 'u8' with bitfield instead of 'bool' to avoid alignment
issues and remove checkpatch.pl check:
CHECK: Avoid using bool structure members because of possible alignment
issues

Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
---
 drivers/staging/rtl8192e/dot11d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
index 44f11f629922..f3e8373b1312 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -29,7 +29,7 @@ enum dot11d_state {
  */
 
 struct rt_dot11d_info {
-	bool enabled;
+	u8 enabled:1;
 
 	u16 country_len;
 	u8  country_buffer[MAX_IE_LEN];
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] Staging: rtl8192e: Avoid using bool structure members
  2019-02-20  7:30 [PATCH 2/2] Staging: rtl8192e: Avoid using bool structure members Bhanusree Pola
@ 2019-02-20  7:53 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-02-20  7:53 UTC (permalink / raw)
  To: Bhanusree Pola; +Cc: outreachy-kernel

On Wed, Feb 20, 2019 at 01:00:11PM +0530, Bhanusree Pola wrote:
> Use 'u8' with bitfield instead of 'bool' to avoid alignment
> issues and remove checkpatch.pl check:
> CHECK: Avoid using bool structure members because of possible alignment
> issues
> 
> Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> ---
>  drivers/staging/rtl8192e/dot11d.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/dot11d.h b/drivers/staging/rtl8192e/dot11d.h
> index 44f11f629922..f3e8373b1312 100644
> --- a/drivers/staging/rtl8192e/dot11d.h
> +++ b/drivers/staging/rtl8192e/dot11d.h
> @@ -29,7 +29,7 @@ enum dot11d_state {
>   */
>  
>  struct rt_dot11d_info {
> -	bool enabled;
> +	u8 enabled:1;

Ick, no, that might just have caused a lot more work to have happen to
access that variable (think about how a bool is stored and accessed vs.
a bitfield).

There's nothing wrong with this bool as-is, I would leave it alone.

thanks,

greg k-h


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-20  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20  7:30 [PATCH 2/2] Staging: rtl8192e: Avoid using bool structure members Bhanusree Pola
2019-02-20  7:53 ` Greg Kroah-Hartman

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.