linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [0/10] staging:rtl8192u: One significant change...
@ 2018-07-11 19:21 John Whitmore
  2018-07-11 19:21 ` [PATCH 01/10] staging:rtl8192u: typedef struct tx_desc_819x_usb > struct tx_desc_819x_usb John Whitmore
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: John Whitmore @ 2018-07-11 19:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: devel, gregkh, aastha.gupta4104, keescook, pombredanne, kstewart, tglx

The first 9 patches in this series are coding style changes, including a
number of patches to remove the "typedef" directive from a number of data
structure definitions. This clears the checkpatch warning about defining new
data types in the code.

The last patch in the series, however, changes the data type of a member
variable from a u8 to an enumerated type. Generally in C an enumerated type is
implemented by the compiler as an int, but can be changed by compiler
directives. Either way the member variable will most probably have its size
changed by this patch. I don't think that the structure is mapped to hardware
or physical memory location, but is allocated and populated in the
rtl8192_usb_probe() function in the file r8192U_core.c. Given that
allocation/population I don't think that the size of the member variable is of
run time significance, bar the slight increase in size of the overall
structure.

The reason for doing this is to enable the compiler's checking of assignments
to the variable defined as an enumerated type. The alternative is to leave the
variable as a u8 and remove the enumerated type, replacing it with #define
definitions of the possible values.

I raised this issue on the kernel newbies mailing list and of the two
alternatives enumerated type won out.



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

end of thread, other threads:[~2018-07-13 11:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 19:21 [0/10] staging:rtl8192u: One significant change John Whitmore
2018-07-11 19:21 ` [PATCH 01/10] staging:rtl8192u: typedef struct tx_desc_819x_usb > struct tx_desc_819x_usb John Whitmore
2018-07-11 19:21 ` [PATCH 02/10] staging:rtl8192u: trim multiple blank lines - Coding Style John Whitmore
2018-07-11 19:21 ` [PATCH 03/10] staging:rtl8192u: remove unused structure tx_desc_819x_usb_aggr_subframe John Whitmore
2018-07-11 19:21 ` [PATCH 04/10] staging:rtl8192u: Rename file macro to avoid camel case - Coding Style John Whitmore
2018-07-13  9:39   ` Greg KH
2018-07-13 11:26     ` John Whitmore
2018-07-11 19:21 ` [PATCH 05/10] staging:rtl8192u: typedef struct tx_desc_cmd_819x_usb remove typedef John Whitmore
2018-07-11 19:21 ` [PATCH 06/10] staging:rtl8192u: typedef struct tx_fwinfo_819x_usb " John Whitmore
2018-07-11 19:21 ` [PATCH 07/10] staging:rtl8192u: typedef struct rx_desc_819x_usb " John Whitmore
2018-07-11 19:21 ` [PATCH 08/10] staging:rtl8192u: Remove struct rx_desc_819x_usb_aggr_subframe John Whitmore
2018-07-11 19:21 ` [PATCH 09/10] staging:rtl8192u: remove typedef from struct rx_drvinfo_819x_usb John Whitmore
2018-07-11 19:21 ` [PATCH 10/10] staging:rtl8192u: Change struct r8192_priv member Rf_Mode from u8 > enum John Whitmore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).