On Wed, Apr 12, 2017 at 09:56:46AM +1000, Tobin C. Harding wrote:
> Header has multiple constants defined using preprocessor
> directive. In the cases where these are an integer progression an
> enumeration type can be used. Doing so adds documentation to the code
> and makes the usage explicit.
>
> Replace (integer progression) preprocessor constants with enumeration type.
>
> Signed-off-by: Tobin C. Harding <[email protected]>
> ---
> drivers/staging/ks7010/ks7010_sdio.h | 26 +++++++++++++++++---------
> 1 file changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/ks7010/ks7010_sdio.h
> b/drivers/staging/ks7010/ks7010_sdio.h
> index a1c7551..43b9990 100644
> --- a/drivers/staging/ks7010/ks7010_sdio.h
> +++ b/drivers/staging/ks7010/ks7010_sdio.h
> @@ -24,8 +24,10 @@
>
> /* Read Status Register */
> #define READ_STATUS 0x000000
> -#define READ_STATUS_BUSY 0
> -#define READ_STATUS_IDLE 1
> +enum read_status_type {
> + READ_STATUS_BUSY,
> + READ_STATUS_IDLE
> +};
Is this even used? Why not just delete these unused defines?
I don't see READ_STATUS_BUSY used anywhere...
> /* Read Index Register */
> #define READ_INDEX 0x000004
> @@ -35,8 +37,10 @@
>
> /* Write Status Register */
> #define WRITE_STATUS 0x00000C
> -#define WRITE_STATUS_BUSY 0
> -#define WRITE_STATUS_IDLE 1
> +enum write_status_type {
> + WRITE_STATUS_BUSY,
> + WRITE_STATUS_IDLE
> +};
WRITE_STATUS_IDLE doesn't seem to be used either, implying that
something is odd here.
Please fix this up correctly please.
thanks,
greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel