Re: [PATCH 01/10] staging: unisys: include: fix improper use of dma_data_direction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 01, 2017 at 05:38:53PM -0500, David Kershner wrote:
> From: Steven Matthews <steven.matthews@xxxxxxxxxx>
> 
> Replace use of standard Linux dma_data_direction with a Unisys-
> specific uis_dma_data_direction and provide a function to convert
> from the latter to the former.  This is necessary because Unisys
> s-Par depends on the exact format of this field in multiple OSs
> and languages, and so using the standard version creates an
> unnecessary dependency between the kernel and s-Par.
> 
> Signed-off-by: Steven Matthews <steven.matthews@xxxxxxxxxx>
> Signed-off-by: David Kershner <david.kershner@xxxxxxxxxx>
> ---
>  drivers/staging/unisys/include/iochannel.h      | 11 +++++++--
>  drivers/staging/unisys/visorhba/visorhba_main.c | 22 +++++++++++++++++-
>  2 files changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/unisys/include/iochannel.h b/drivers/staging/unisys/include/iochannel.h
> index 54f4900..6e80462 100644
> --- a/drivers/staging/unisys/include/iochannel.h
> +++ b/drivers/staging/unisys/include/iochannel.h
> @@ -31,7 +31,6 @@
>  
>  #include <linux/uuid.h>
>  
> -#include <linux/dma-direction.h>
>  #include "channel.h"
>  
>  #define ULTRA_VHBA_CHANNEL_PROTOCOL_SIGNATURE ULTRA_CHANNEL_PROTOCOL_SIGNATURE
> @@ -80,6 +79,14 @@
>  /* Size of cdb - i.e., SCSI cmnd */
>  #define MAX_CMND_SIZE 16
>  
> +/* Unisys-specific DMA direction values */
> +enum uis_dma_data_direction {
> +	UIS_DMA_BIDIRECTIONAL = 0,
> +	UIS_DMA_TO_DEVICE,
> +	UIS_DMA_FROM_DEVICE,
> +	UIS_DMA_NONE

An enumerated type that is shared across platforms yet you don't
specifically set what each type is?  That's just begging for nasty bugs
in the future.

Please set all of them so you _know_ what the values are, never trust a
C compiler you haven't written yourself :)

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux