lkml.org 
[lkml]   [2018]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[0/10] staging:rtl8192u: One significant change...
Date
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.


\
 
 \ /
  Last update: 2018-07-15 22:05    [W:0.144 / U:0.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site