[PATCH 8/8] staging: comedi: COMEDI_BUFINFO: terminate "write" command when stopped

2016-02-19 Thread Ian Abbott
e just report the final buffer position back to the user. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_

[PATCH 5/8] staging: comedi: COMEDI_BUFINFO: return error if no active command

2016-02-19 Thread Ian Abbott
`) in this case. Prior to this change, if a command was started via a different file object, the ioctl returned `-EACCES`, but now it will return `-EINVAL`, which is consistent with the current behavior of the "read" and "write" file operation handlers. Signed-off-by: Ian Abbot

[PATCH 4/8] staging: comedi: COMEDI_BUFINFO: force bytes_written to 0 if stopped

2016-02-19 Thread Ian Abbott
t successfully written to 0 in that case. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index e625ef2..b7c9270 100644 --- a/drivers/staging/co

[PATCH 8/8] staging: comedi: COMEDI_BUFINFO: terminate "write" command when stopped

2016-02-19 Thread Ian Abbott
e just report the final buffer position back to the user. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 7cb1d06

[PATCH 5/8] staging: comedi: COMEDI_BUFINFO: return error if no active command

2016-02-19 Thread Ian Abbott
`) in this case. Prior to this change, if a command was started via a different file object, the ioctl returned `-EACCES`, but now it will return `-EINVAL`, which is consistent with the current behavior of the "read" and "write" file operation handlers. Signed-off-by: Ian Abbott --- dr

[PATCH 7/8] staging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read

2016-02-19 Thread Ian Abbott
;read" position reported back to the user has been advanced to the end of all available data. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/stagi

[PATCH 7/8] staging: comedi: COMEDI_BUFINFO: return -EPIPE for abnormal read

2016-02-19 Thread Ian Abbott
;read" position reported back to the user has been advanced to the end of all available data. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/dr

[PATCH 3/8] staging: comedi: COMEDI_BUFINFO: update buffer before becoming non-busy

2016-02-19 Thread Ian Abbott
that gets the updated buffer position. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 04d6040

[PATCH 6/8] staging: comedi: COMEDI_BUFINFO: become non-busy even if bytes_read is 0

2016-02-19 Thread Ian Abbott
s without error is when it has been set up to read a finite amount of data. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/sta

[PATCH 3/8] staging: comedi: COMEDI_BUFINFO: update buffer before becoming non-busy

2016-02-19 Thread Ian Abbott
that gets the updated buffer position. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 04d6040..e625ef2 100644 --- a/drivers/stag

[PATCH 6/8] staging: comedi: COMEDI_BUFINFO: become non-busy even if bytes_read is 0

2016-02-19 Thread Ian Abbott
s without error is when it has been set up to read a finite amount of data. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c in

[PATCH 1/5] staging: comedi: comedi.h: tweak start of header comment

2016-02-09 Thread Ian Abbott
The wording at the start of the header comment is a bit misleading, particularly the part in parentheses: "(installed as /usr/include/comedi.h)". This version of "comedi.h" certainly won't be installed as that pathname. Fix it. Signed-off-by: Ian Abbott --- drivers/staging

[PATCH 5/5] staging: comedi: comedi.h: remove SDF_MODE0 etc.

2016-02-09 Thread Ian Abbott
`SDF_MODE0` etc. flags to display the fact that they are set, but COMEDILIB uses and installs its own, compatible version of "comedi.h" anyway so isn't affected by their removal from the kernel copy. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi.h | 22 --

[PATCH 4/5] staging: comedi: comedi.h: remove struct comedi_trig

2016-02-09 Thread Ian Abbott
these, but it uses its own, compatible version of "comedi.h", so isn't affected by their removal from the kernel copy. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi.h | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/stag

[PATCH 3/5] staging: comedi: comedi.h: add kernel-doc comments to struct types

2016-02-09 Thread Ian Abbott
Add "kernel-doc"-formatted comments to the COMEDI `struct` declarations used with ioctls. Don't bother documenting `struct comedi_trig` as it is obsolete and not supported. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi.h | 332 ++

[PATCH 0/5] staging: comedi: comedi.h: kernel-doc and remove cruft

2016-02-09 Thread Ian Abbott
Add some kernel-doc comments to the common enums and structs in "comedi.h", and remove the cruft related to the non-functional and obsolete COMEDI_TRIG ioctl. 1) staging: comedi: comedi.h: tweak start of header comment 2) staging: comedi: comedi.h: add kernel-doc to common enums 3) staging:

[PATCH 2/5] staging: comedi: comedi.h: add kernel-doc to common enums

2016-02-09 Thread Ian Abbott
Add "kernel-doc"-formatted comments to COMEDI's general-purpose `enum` type declarations. Don't bother documenting the low-level driver-specific ones for now. Move the declaration of `enum comedi_counter_status_flags` next to the other general-purpose `enum` types. Signed-off-by:

[PATCH 4/5] staging: comedi: comedi.h: remove struct comedi_trig

2016-02-09 Thread Ian Abbott
these, but it uses its own, compatible version of "comedi.h", so isn't affected by their removal from the kernel copy. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi.h | 24 +--- 1 file changed, 1 insertion(+), 23 deletion

[PATCH 3/5] staging: comedi: comedi.h: add kernel-doc comments to struct types

2016-02-09 Thread Ian Abbott
Add "kernel-doc"-formatted comments to the COMEDI `struct` declarations used with ioctls. Don't bother documenting `struct comedi_trig` as it is obsolete and not supported. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comed

[PATCH 1/5] staging: comedi: comedi.h: tweak start of header comment

2016-02-09 Thread Ian Abbott
The wording at the start of the header comment is a bit misleading, particularly the part in parentheses: "(installed as /usr/include/comedi.h)". This version of "comedi.h" certainly won't be installed as that pathname. Fix it. Signed-off-by: Ian Abbott <abbo...@mev.co.u

[PATCH 0/5] staging: comedi: comedi.h: kernel-doc and remove cruft

2016-02-09 Thread Ian Abbott
Add some kernel-doc comments to the common enums and structs in "comedi.h", and remove the cruft related to the non-functional and obsolete COMEDI_TRIG ioctl. 1) staging: comedi: comedi.h: tweak start of header comment 2) staging: comedi: comedi.h: add kernel-doc to common enums 3) staging:

[PATCH 2/5] staging: comedi: comedi.h: add kernel-doc to common enums

2016-02-09 Thread Ian Abbott
Add "kernel-doc"-formatted comments to COMEDI's general-purpose `enum` type declarations. Don't bother documenting the low-level driver-specific ones for now. Move the declaration of `enum comedi_counter_status_flags` next to the other general-purpose `enum` types. Signed-off-by:

[PATCH 5/5] staging: comedi: comedi.h: remove SDF_MODE0 etc.

2016-02-09 Thread Ian Abbott
`SDF_MODE0` etc. flags to display the fact that they are set, but COMEDILIB uses and installs its own, compatible version of "comedi.h" anyway so isn't affected by their removal from the kernel copy. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/st

Re: [PATCH v2 2/2] STAGING: COMEDI: Wrap line over 80 characters

2016-02-05 Thread Ian Abbott
*); /** - * module_comedi_pcmcia_driver() - Helper macro for registering a comedi PCMCIA driver + * module_comedi_pcmcia_driver() - Helper macro for registering a comedi + * PCMCIA driver * @__comedi_driver: comedi_driver struct * @__pcmcia_driver: pcmcia_driver struct * Thanks! Reviewed-by: Ian Abbott

Re: [PATCH v2 1/2] STAGING: COMEDI: Remove unnecessary typecast of c90 int constant

2016-02-05 Thread Ian Abbott
)0x) +#define COMEDI_MIN_SPEED 0xu /**/ /* everything after this line is ALPHA */ Thanks. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH v2 1/2] STAGING: COMEDI: Remove unnecessary typecast of c90 int constant

2016-02-05 Thread Ian Abbott
_SPEED ((unsigned int)0x) +#define COMEDI_MIN_SPEED 0xu /**/ /* everything after this line is ALPHA */ Thanks. Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <ab

Re: [PATCH v2 2/2] STAGING: COMEDI: Wrap line over 80 characters

2016-02-05 Thread Ian Abbott
Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH 2/2] STAGING: COMEDI: Wrap line over 80 characters

2016-02-01 Thread Ian Abbott
On 01/02/16 16:35, Hartley Sweeten wrote: On Monday, February 01, 2016 5:26 AM, Ian Abbott wrote: On 01/02/16 01:06, Pablo G. Gallardo wrote: This patch wraps lines over 80 characters. Signed-off-by: Pablo G. Gallardo --- drivers/staging/comedi/comedi_pcmcia.h | 3 ++- 1 file changed, 2

Re: [PATCH 2/2] STAGING: COMEDI: Wrap line over 80 characters

2016-02-01 Thread Ian Abbott
*); /** - * module_comedi_pcmcia_driver() - Helper macro for registering a comedi PCMCIA driver + * module_comedi_pcmcia_driver() - Helper macro for registering a comedi + * PCMCIA driver * @__comedi_driver: comedi_driver struct * @__pcmcia_driver: pcmcia_driver struct * Thanks! Reviewed-by: Ian Abbott

Re: [PATCH 1/2] STAGING: COMEDI: Remove unnecessary typecast of c90 int constant

2016-02-01 Thread Ian Abbott
about. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH 2/2] STAGING: COMEDI: Wrap line over 80 characters

2016-02-01 Thread Ian Abbott
On 01/02/16 16:35, Hartley Sweeten wrote: On Monday, February 01, 2016 5:26 AM, Ian Abbott wrote: On 01/02/16 01:06, Pablo G. Gallardo wrote: This patch wraps lines over 80 characters. Signed-off-by: Pablo G. Gallardo <gallardo_pa...@hotmail.com> --- drivers/staging/comedi/comedi_pc

Re: [PATCH 1/2] STAGING: COMEDI: Remove unnecessary typecast of c90 int constant

2016-02-01 Thread Ian Abbott
that's probably not worth worrying about. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH 2/2] STAGING: COMEDI: Wrap line over 80 characters

2016-02-01 Thread Ian Abbott
struct * Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] Staging: comedi: fix block comments coding style issue in comedi.h

2015-12-22 Thread Ian Abbott
in Greg's staging-next branch. Also, it doesn't use the preferred block comment style with the leading '/*' on a separate line. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubs

Re: [PATCH] Staging: comedi: fix block comments coding style issue in comedi.h

2015-12-22 Thread Ian Abbott
Sorry, this clashes with another patch in Greg's staging-next branch. Also, it doesn't use the preferred block comment style with the leading '/*' on a separate line. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To

Re: [PATCH v2 1/3] STAGING: COMEDI: Fixed format of comments in plx9080.h

2015-12-17 Thread Ian Abbott
drivers/staging/comedi/drivers/plx9080.h | 122 --- 1 file changed, 78 insertions(+), 44 deletions(-) Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from

Re: [PATCH v2 1/3] STAGING: COMEDI: Fixed format of comments in plx9080.h

2015-12-17 Thread Ian Abbott
revious line * using the usual block comment style drivers/staging/comedi/drivers/plx9080.h | 122 --- 1 file changed, 78 insertions(+), 44 deletions(-) Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail:

Re: [PATCH 3/3] STAGING: COMEDI: Using kernel types in plx9080.h

2015-12-16 Thread Ian Abbott
) { void __iomem *dma_cs_addr; - uint8_t dma_status; + u8 dma_status; const int timeout = 1; unsigned int i; Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk

Re: [PATCH 2/3] STAGING: COMEDI: Added spaces around binary operators in plx9080.h

2015-12-16 Thread Ian Abbott
*/ #define MBX_ADDR_SPACE_360 0x80 /* wanXL100s/200/400 */ -#define MBX_ADDR_MASK_360 (MBX_ADDR_SPACE_360-1) +#define MBX_ADDR_MASK_360 (MBX_ADDR_SPACE_360 - 1) static inline int plx9080_abort_dma(void __iomem *iobase, unsigned int channel) { Thanks! Reviewed-by: Ian Abbott

Re: [PATCH 1/3] STAGING: COMEDI: Fixed format of comments in plx9080.h

2015-12-16 Thread Ian Abbott
/* L, Local Addr Space 1 Range Register */ #define PLX_LAS1RNG_REG 0x00f0 -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message

Re: [PATCH 3/3] STAGING: COMEDI: Using kernel types in plx9080.h

2015-12-16 Thread Ian Abbott
ort_dma(void __iomem *iobase, unsigned int channel) { void __iomem *dma_cs_addr; - uint8_t dma_status; + u8 dma_status; const int timeout = 1; unsigned int i; Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail:

Re: [PATCH 2/3] STAGING: COMEDI: Added spaces around binary operators in plx9080.h

2015-12-16 Thread Ian Abbott
int channel) { Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"

Re: [PATCH 1/3] STAGING: COMEDI: Fixed format of comments in plx9080.h

2015-12-16 Thread Ian Abbott
nge Register */ #define PLX_LAS0RNG_REG 0x /* L, Local Addr Space 1 Range Register */ #define PLX_LAS1RNG_REG 0x00f0 -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this l

Re: [PATCH 0/2] staging: COMEDI: checkpatch.pl cleanups in comedi.h

2015-12-11 Thread Ian Abbott
these issues: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081778.html -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in t

Re: [PATCH 0/2] staging: COMEDI: checkpatch.pl cleanups in comedi.h

2015-12-11 Thread Ian Abbott
these issues: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-November/081778.html -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubs

Re: [PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments

2015-11-24 Thread Ian Abbott
_LINUX_COMEDILIB_H Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majo

Re: [PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments

2015-11-24 Thread Ian Abbott
e for more details. + */ #ifndef _LINUX_COMEDILIB_H #define _LINUX_COMEDILIB_H Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe

Re: [PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments

2015-11-23 Thread Ian Abbott
seful than the "linux/include/comedilib.h" line, especially as the pathname "linux/include/comedilib.h" isn't very accurate! -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the

Re: [PATCH] staging: comedi: Coding style warning fix for block comments

2015-11-23 Thread Ian Abbott
1 file changed, 16 insertions(+), 16 deletions(-) Please could you mention comedilib.h in the Subject line? E.g.: staging: comedi: comedilib.h: Fix block comments It helps to localize the affected area more. -- -=( Ian Abbott @ MEV Ltd.E-mail

Re: [PATCH] staging: comedi: Coding style warning fix for block comments

2015-11-23 Thread Ian Abbott
as the existing pathname is wrong. It could be changed to be just the basename of the header file like this: * comedilib.h which is similar to the header comment in comedidev.h. -header file for kcomedilib Perhaps * Header file for kcomedilib. No objections there. -- -=( Ian Abbott @ MEV

Re: [PATCH] staging: comedi: comedilib.h: Coding style warning fix for block comments

2015-11-23 Thread Ian Abbott
d the "header file for kcomedilib" line, which was probably more useful than the "linux/include/comedilib.h" line, especially as the pathname "linux/include/comedilib.h" isn't very accurate! -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=-

Re: [PATCH] staging: comedi: Coding style warning fix for block comments

2015-11-23 Thread Ian Abbott
r kcomedilib. No objections there. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org

Re: [PATCH] staging: comedi: Coding style warning fix for block comments

2015-11-23 Thread Ian Abbott
h | 32 1 file changed, 16 insertions(+), 16 deletions(-) Please could you mention comedilib.h in the Subject line? E.g.: staging: comedi: comedilib.h: Fix block comments It helps to localize the affected area more. -- -=( Ian Abbott @ MEV Ltd.E-mail:

[PATCH 1/2] staging: comedi: s526: replace counter mode bitfield struct

2015-11-19 Thread Ian Abbott
and replace it with a bunch of macros to set and mask out bits of the register value, as that's the more conventional way to do it. A bonus is that we get rid of a load of CamelCase definitions in the process. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/s526.c | 156

[PATCH 0/2] staging: comedi: s526: add counter register macros

2015-11-19 Thread Ian Abbott
Add macros to describe the counter mode and counter control/status registers. In patch 1, the macros for the counter mode register replace the use of bitfield structure and union types. 1) staging: comedi: s526: replace counter mode bitfield struct 2) staging: comedi: s526: add macros for

[PATCH 2/2] staging: comedi: s526: add macros for counter control reg values

2015-11-19 Thread Ian Abbott
-by: Ian Abbott --- drivers/staging/comedi/drivers/s526.c | 41 +++ 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c index a8165df..c80527d 100644 --- a/drivers/staging/comedi

[PATCH 2/2] staging: comedi: s526: add macros for counter control reg values

2015-11-19 Thread Ian Abbott
-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/s526.c | 41 +++ 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c index a8165df..c80527d

[PATCH 0/2] staging: comedi: s526: add counter register macros

2015-11-19 Thread Ian Abbott
Add macros to describe the counter mode and counter control/status registers. In patch 1, the macros for the counter mode register replace the use of bitfield structure and union types. 1) staging: comedi: s526: replace counter mode bitfield struct 2) staging: comedi: s526: add macros for

[PATCH 1/2] staging: comedi: s526: replace counter mode bitfield struct

2015-11-19 Thread Ian Abbott
and replace it with a bunch of macros to set and mask out bits of the register value, as that's the more conventional way to do it. A bonus is that we get rid of a load of CamelCase definitions in the process. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/s526.c

[PATCH 6/8] staging: comedi: return error on "write" if no command set up

2015-11-18 Thread Ian Abbott
results in a return value of 0 (unless COMEDI instructions are being processed or an asynchronous command has been set up by a different file object). Change it to return `-EINVAL` in this case. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 11 --- 1 file changed

[PATCH 7/8] staging: comedi: simplify returned errors for comedi_write()

2015-11-18 Thread Ian Abbott
uot;instruction" is currently being processed. `-EINVAL` is returned in other cases. Simplify it by returning `-EINVAL` for all these cases. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git

[PATCH 0/8] staging: comedi: some comedi_write() changes

2015-11-18 Thread Ian Abbott
Tidy up the "write" file operation handler, `comedi_write()` a bit and improve the error handling. 1) staging: comedi: rearrange comedi_write() code 2) staging: comedi: do extra checks for becoming non-busy for "write" 3) staging: comedi: make some variables unsigned in comedi_write() 4) staging:

[PATCH 2/8] staging: comedi: do extra checks for becoming non-busy for "write"

2015-11-18 Thread Ian Abbott
ming non-busy still hold. Add some more checks that the subdevice is still busy with a command initiated by the same file object, and that the command is in the correct direction (in case the subdevice supports both "read" and "write"). Signed-off-by: Ian Abbott --- drivers

[PATCH 1/8] staging: comedi: rearrange comedi_write() code

2015-11-18 Thread Ian Abbott
is removed from the wait queue, and we can remove the `on_wait_queue` flag variable. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 71 +++- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c

[PATCH 4/8] staging: comedi: avoid bad truncation of a size_t in comedi_write()

2015-11-18 Thread Ian Abbott
At one point in `comedi_write()`, the variable `n` gets assigned to the minimum of the parameter `nbytes` and the amount of writeable buffer space. The way that is done currently is unsafe in the unlikely case that `nbytes` exceeds `UINT_MAX`, so fix it. Signed-off-by: Ian Abbott --- drivers

[PATCH 8/8] staging: comedi: check for more errors for zero-length write

2015-11-18 Thread Ian Abbott
subdevice to be marked as non-busy. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 5a9c9d9..d57fade 100644 --- a/drive

[PATCH 5/8] staging: comedi: allow buffer wraparound in comedi_write()

2015-11-18 Thread Ian Abbott
it to deal with the wraparound using two calls to `copy_from_user()` if necessary. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi

[PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write()

2015-11-18 Thread Ian Abbott
return type. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 94c2348..188a12a 100644 --- a/drivers/staging/comedi

Re: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 18/11/15 16:45, Hartley Sweeten wrote: On Wednesday, November 18, 2015 9:42 AM, Ian Abbott wrote: On 16/11/15 17:18, Ranjith Thangavel wrote: [snip] -#define DMM32AT_AI_CFG_SCINT_20US (0 << 4) -#define DMM32AT_AI_CFG_SCINT_15US (1 << 4) -#define DMM32AT_AI_CF

Re: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
BIT(3) /* 0=5V 1=10V */ +#define DMM32AT_AI_CFG_ADBUBIT(2) /* 0=bipolar 1=unipolar */ [snip] -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 18/11/15 16:26, Ian Abbott wrote: On 14/11/15 17:10, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator, usleep_range is preferred over udelay - coding style issue Those two things should be done in separate patches. Sorry, I didn't see

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
0 #define NI6527_CTRL_ENABLE_IRQS (NI6527_CTRL_FALLING | \ NI6527_CTRL_RISING | \ Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscr

Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
E_U10, dev->iobase + DMM32AT_AI_CFG_REG); /* should take 10 us to settle, here's a hundred */ - udelay(100); + usleep_range(100, 150); /* read back the values */ ailo = inb(dev->iobase + DMM32AT_AI_LO_CHAN_REG); The usleep_range() stuff is unr

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
if (err) return 3; As Dan Carpenter pointed out, this part has been added by mistake. The parts added by mistake seem to be a throwback to an earlier kernel version. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] comedi: pcmmio: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
d single patch using the '[PATCH v2]' tag in the email. If that's a bit daunting, it might be easier for you to recreate the patch from scratch! -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: sen

Re: [PATCH] comedi: gsc_hpdi: Fix coding style - use kernel type definitions for variables

2015-11-18 Thread Ian Abbott
gt;plx9080_mmio; #ifdef __BIG_ENDIAN Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message

Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
evice *dev) outb(DMM32AT_RANGE_U10, dev->iobase + DMM32AT_AI_CFG_REG); /* should take 10 us to settle, here's a hundred */ - udelay(100); + usleep_range(100, 150); /* read back the values */ ailo = inb(dev->iobase + DMM32AT_AI_LO_CHAN_REG);

Re: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
ine DMM32AT_AI_CFG_RANGE BIT(3) /* 0=5V 1=10V */ +#define DMM32AT_AI_CFG_ADBUBIT(2) /* 0=bipolar 1=unipolar */ [snip] -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe

Re: [PATCH 1/2] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 18/11/15 16:45, Hartley Sweeten wrote: On Wednesday, November 18, 2015 9:42 AM, Ian Abbott wrote: On 16/11/15 17:18, Ranjith Thangavel wrote: [snip] -#define DMM32AT_AI_CFG_SCINT_20US (0 << 4) -#define DMM32AT_AI_CFG_SCINT_15US (1 << 4) -#define DMM32AT_AI_CF

Re: [PATCH] comedi: gsc_hpdi: Fix coding style - use kernel type definitions for variables

2015-11-18 Thread Ian Abbott
_iomem *plx_iobase = devpriv->plx9080_mmio; #ifdef __BIG_ENDIAN Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this l

Re: [PATCH] comedi: dmm32at: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
On 18/11/15 16:26, Ian Abbott wrote: On 14/11/15 17:10, Ranjith Thangavel wrote: BIT macro is used for defining BIT location instead of shifting operator, usleep_range is preferred over udelay - coding style issue Those two things should be done in separate patches. Sorry, I didn't see

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
0) #define NI6527_CTRL_DISABLE_IRQS 0 #define NI6527_CTRL_ENABLE_IRQS (NI6527_CTRL_FALLING | \ NI6527_CTRL_RISING | \ Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=(

Re: [PATCH] comedi: pcmmio: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
p' patch. Then submit the combined single patch using the '[PATCH v2]' tag in the email. If that's a bit daunting, it might be easier for you to recreate the patch from scratch! -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-18 Thread Ian Abbott
ger_arg_is(>stop_arg, 0); if (err) return 3; As Dan Carpenter pointed out, this part has been added by mistake. The parts added by mistake seem to be a throwback to an earlier kernel version. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=(

[PATCH 0/8] staging: comedi: some comedi_write() changes

2015-11-18 Thread Ian Abbott
Tidy up the "write" file operation handler, `comedi_write()` a bit and improve the error handling. 1) staging: comedi: rearrange comedi_write() code 2) staging: comedi: do extra checks for becoming non-busy for "write" 3) staging: comedi: make some variables unsigned in comedi_write() 4) staging:

[PATCH 2/8] staging: comedi: do extra checks for becoming non-busy for "write"

2015-11-18 Thread Ian Abbott
ming non-busy still hold. Add some more checks that the subdevice is still busy with a command initiated by the same file object, and that the command is in the correct direction (in case the subdevice supports both "read" and "write"). Signed-off-by: Ian Abbott <abbo...@mev.

[PATCH 1/8] staging: comedi: rearrange comedi_write() code

2015-11-18 Thread Ian Abbott
is removed from the wait queue, and we can remove the `on_wait_queue` flag variable. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 71 +++- 1 file changed, 30 insertions(+), 41 deletions(-) diff --git a/driver

[PATCH 7/8] staging: comedi: simplify returned errors for comedi_write()

2015-11-18 Thread Ian Abbott
uot;instruction" is currently being processed. `-EINVAL` is returned in other cases. Simplify it by returning `-EINVAL` for all these cases. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 21 +++-- 1 file changed, 3 insertions(

[PATCH 6/8] staging: comedi: return error on "write" if no command set up

2015-11-18 Thread Ian Abbott
results in a return value of 0 (unless COMEDI instructions are being processed or an asynchronous command has been set up by a different file object). Change it to return `-EINVAL` in this case. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 11 +

[PATCH 4/8] staging: comedi: avoid bad truncation of a size_t in comedi_write()

2015-11-18 Thread Ian Abbott
At one point in `comedi_write()`, the variable `n` gets assigned to the minimum of the parameter `nbytes` and the amount of writeable buffer space. The way that is done currently is unsafe in the unlikely case that `nbytes` exceeds `UINT_MAX`, so fix it. Signed-off-by: Ian Abbott <a

[PATCH 5/8] staging: comedi: allow buffer wraparound in comedi_write()

2015-11-18 Thread Ian Abbott
it to deal with the wraparound using two calls to `copy_from_user()` if necessary. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/d

[PATCH 3/8] staging: comedi: make some variables unsigned in comedi_write()

2015-11-18 Thread Ian Abbott
return type. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 94c2348..188a12a 100644 --- a/drivers/s

[PATCH 8/8] staging: comedi: check for more errors for zero-length write

2015-11-18 Thread Ian Abbott
subdevice to be marked as non-busy. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 5a9c9d9

Re: [PATCH] comedi: comedi_parport: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
_device *dev, struct comedi_subdevice *s, Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-ke

Re: [PATCH] comedi: cb_pcidda: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
define DACALIBRATION14 /* D/A CALIBRATION REGISTER 1 */ /* write bits */ Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "uns

Re: [PATCH] comedi: ni_65xx: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
1 << 7) /* window enable */ +#define WENAB BIT(7) /* window enable */ static int ni_65xx_mite_init(struct pci_dev *pcidev) { Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubsc

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
0 #define NI6527_CTRL_ENABLE_IRQS (NI6527_CTRL_FALLING | \ NI6527_CTRL_RISING | \ Again, the column with the macro values is a bit misaligned. Could you fix it please? -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: ht

Re: [PATCH] comedi: pcmmio.c: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
O_AO_STATUS_IRQ_ENA BIT(0) #define PCMMIO_AO_RESOURCE_ENA_REG0x0b #define PCMMIO_AO_2ND_DAC_OFFSET 0x04 The macro values used to be more-or-less nicely aligned in a column, but now they are not so nicely aligned. Could you add or delete TAB

Re: [PATCH] comedi: ni_6527: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
0) #define NI6527_CTRL_DISABLE_IRQS 0 #define NI6527_CTRL_ENABLE_IRQS (NI6527_CTRL_FALLING | \ NI6527_CTRL_RISING | \ Again, the column with the macro values is a bit misaligned. Could you fix it please? -- -=( Ian Abbott @ MEV Ltd.E-mail:

Re: [PATCH] comedi: cb_pcidda: Fix coding style - use BIT macro

2015-11-12 Thread Ian Abbott
BIT(8) /* Unipolar range */ #define DACALIBRATION14 /* D/A CALIBRATION REGISTER 1 */ /* write bits */ Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http:

<    3   4   5   6   7   8   9   10   11   12   >