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

2015-11-12 Thread Ian Abbott
_DRQ_ENA BIT(1) +#define PCMMIO_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

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

2015-11-12 Thread Ian Abbott
fine WENAB (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 <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.u

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

2015-11-12 Thread Ian Abbott
data_reg_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.u

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

2015-11-11 Thread Ian Abbott
quot; line. Thanks. -- -=( 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 majordomo info at ht

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

2015-11-11 Thread Ian Abbott
RL_IRQ_ENA (1 << 4) -#define PARPORT_CTRL_BIDIR_ENA (1 << 5) +#define PARPORT_CTRL_IRQ_ENA BIT(4) +#define PARPORT_CTRL_BIDIR_ENA BIT(5) static int parport_data_reg_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, -- 1.7.10.4 -- -=(

Re: [PATCH v2] staging: comedi: use kmalloc_array instead of kmalloc

2015-11-11 Thread Ian Abbott
sizeof(struct comedi_lrange *), +GFP_KERNEL); if (!range_table_list) return -ENOMEM; s->range_table_list = range_table_list; Seems fine! Reviewed

Re: [PATCH v2] staging: comedi: use kmalloc_array instead of kmalloc

2015-11-11 Thread Ian Abbott
); + range_table_list = kmalloc_array(32, +sizeof(struct comedi_lrange *), +GFP_KERNEL); if (!range_table_list) return -ENOMEM; s->range_table_list = range_

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

2015-11-11 Thread Ian Abbott
quot; line. Thanks. -- -=( 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.ker

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

2015-11-11 Thread Ian Abbott
struct comedi_subdevice *s, -- 1.7.10.4 -- -=( 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 messa

Re: [PATCH 1/4] staging: comedi: use kmalloc_array instead of kmalloc

2015-11-09 Thread Ian Abbott
GFP_KERNEL); if (!range_table_list) return -ENOMEM; s->range_table_list = range_table_list; -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from

Re: [PATCH 1/4] staging: comedi: use kmalloc_array instead of kmalloc

2015-11-09 Thread Ian Abbott
GFP_KERNEL); if (!range_table_list) return -ENOMEM; s->range_table_list = range_table_list; -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( W

Re: [PATCH 3/3] comedi: driver: Fix - BIT macro used coding style issue

2015-11-06 Thread Ian Abbott
BIT(5) +#define PCMMIO_AO_STATUS_IRQ_PEND BIT(4) +#define PCMMIO_AO_STATUS_DATA_DRQ_ENA BIT(2) +#define PCMMIO_AO_STATUS_REG_SEL BIT(3) +#define PCMMIO_AO_STATUS_CMD_DRQ_ENA BIT(1) +#define PCMMIO_AO_STATUS_IRQ_ENA

Re: [PATCH 3/3] comedi: driver: Fix - BIT macro used coding style issue

2015-11-06 Thread Ian Abbott
BIT(6) +#define PCMMIO_AO_STATUS_CMD_DMA_PEND BIT(5) +#define PCMMIO_AO_STATUS_IRQ_PEND BIT(4) +#define PCMMIO_AO_STATUS_DATA_DRQ_ENA BIT(2) +#define PCMMIO_AO_STATUS_REG_SEL BIT(3) +#define PCMMIO_AO_STATUS_CMD_DRQ_ENA BIT(1) +#define PCMMIO_AO_

Re: [PATCH 2/2] comedi: drivers: Fix - BIT macro used coding style issue

2015-11-02 Thread Ian Abbott
BIT(2) No, that's wrong. (0 << 1) is 0, but BIT(0) is 1. Hartley already fixed the coding style issue. It's in linux-next. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH 1/2] comedi: drivers: Fix - BIT macro used coding style issue

2015-11-02 Thread Ian Abbott
I1032_CTRL_INT_ENA BIT(2) struct apci1032_private { unsigned long amcc_iobase; /* base of AMCC I/O registers */ Hartley already fixed this coding style issue. It's in linux-next. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: ht

Re: [PATCH 1/2] comedi: drivers: Fix - BIT macro used coding style issue

2015-11-02 Thread Ian Abbott
+#define APCI1032_CTRL_INT_AND BIT(1) +#define APCI1032_CTRL_INT_ENA BIT(2) struct apci1032_private { unsigned long amcc_iobase; /* base of AMCC I/O registers */ Hartley already fixed this coding style issue. It's in linux-next. -- -=( Ian Abbott @ MEV Ltd.

Re: [PATCH 2/2] comedi: drivers: Fix - BIT macro used coding style issue

2015-11-02 Thread Ian Abbott
_AND BIT(1) #define APCI1032_CTRL_INT_ENA BIT(2) No, that's wrong. (0 << 1) is 0, but BIT(0) is 1. Hartley already fixed the coding style issue. It's in linux-next. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=(

[PATCH 01/16] staging: comedi: comedi_test: reformat multi-line comments

2015-10-27 Thread Ian Abbott
Use the preferred style for multi-line comments. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 94 ++-- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi

[PATCH 07/16] staging: comedi: comedi_test: use unsigned int for waveform timing

2015-10-27 Thread Ian Abbott
the waveform period) will be no more than `INT_MAX + UINT_MAX / 1000`. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi

[PATCH 06/16] staging: comedi: comedi_test: move modulo operations for waveform

2015-10-27 Thread Ian Abbott
the time since the start of a waveform exceeds the waveform period. Usually, several samples are produced in each waveform period and modulo operations are typically more expensive than a simple comparison. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 18

[PATCH 05/16] staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW

2015-10-27 Thread Ian Abbott
_private`. An `unsigned int` is still wide enough, because the conversion period is no more than `UINT_MAX / 1000` microseconds and the number of conversions is no more than 16 (`N_CHANS * 2`). Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 64 +++-

[PATCH 04/16] staging: comedi: comedi_test: limit maximum convert_arg

2015-10-27 Thread Ian Abbott
ts within an `unsigned int`, as that is used to limit the minimum scan period (`cmd->scan_begin_arg`). Also ensure rounding of the conversion period and scan period to the nearest microsecond both fit in an `unsigned int`. Do all this in stage 4 ("fix up any arguments") of the command testin

[PATCH 09/16] staging: comedi: comedi_test: rename members for AI commands

2015-10-27 Thread Ian Abbott
Rename the members of `struct waveform_private` that are used to handle AI commands, apart from those members used to control fake waveform generation. The renames are `timer` --> `ai_timer`, `scan_period` --> `ai_scan_period`, and `convert_period` --> `ai_convert_period`. Signed-of

[PATCH 08/16] staging: comedi: comedi_test: simplify time since last AI scan

2015-10-27 Thread Ian Abbott
` that records the time of the last scan. This simplifies the calculation of the number of scans to simulate in the timer routine, `waveform_ai_interrupt()`. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 27 ++- 1 file changed, 10 insertions

[PATCH 11/16] staging: comedi: comedi_test: make timer rate similar to scan rate

2015-10-27 Thread Ian Abbott
. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index 1b3ad7f..9655dc3 100644 --- a/drivers/staging

[PATCH 12/16] staging: comedi: comedi_test: use unsigned short for loopback values

2015-10-27 Thread Ian Abbott
of the AI subdevice `waveform_ai_insn_read()`. As the stored sample values are only 16 bits wide, change the type of the `ao_loopbacks[]` member to `unsigned short` to save some space. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH 10/16] staging: comedi: comedi_test: rename waveform members

2015-10-27 Thread Ian Abbott
rent time within a waveform period). Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 40 ++-- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/come

[PATCH 13/16] staging: comedi: comedi_test: allow read-back of AO channels

2015-10-27 Thread Ian Abbott
on the analog output subdevice to be read back via corresponding channels on the analog input subdevice. The "insn_read" handler for the analog input subdevice is `waveform_ai_insn_read()`. Set that as the "insn_read" handler for the analog output subdevice as well. Signed-

[PATCH 14/16] staging: comedi: comedi_test: handle partial scans in timer routine

2015-10-27 Thread Ian Abbott
Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 85 ++-- 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index 468847a..318340c 100644 ---

[PATCH 16/16] staging: comedi: comedi_test: implement commands on AO subdevice

2015-10-27 Thread Ian Abbott
ice. The command is stopped when the "cancel" handler `waveform_ao_cancel()` is called. This may be due to the command terminating due to completion or an error, or as a result of the user cancelling the command. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.

[PATCH 15/16] staging: comedi: comedi_test: rename waveform_ai_interrupt()

2015-10-27 Thread Ian Abbott
`waveform_ai_interrupt()` is a timer expiry function used to generate fake waveform data for an analog input subdevice. Rename it to `waveform_ai_timer()`. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions

[PATCH 00/16] staging: comedi: comedi_test: enhancements

2015-10-27 Thread Ian Abbott
The "comedi_test" module is a driver for a dummy COMEDI device. It has an analog input subdevice and an analog output subdevice. The analog input subdevice supports COMEDI asynchronous acquisition commands using waveform generators to generate the input data for each channel. A kernel timer is

[PATCH 02/16] staging: comedi: comedi_test: saturate fake waveform values

2015-10-27 Thread Ian Abbott
the sample values that would go out of range. This is closer to how a real hardware device would behave (assuming the input voltage is not high enough to damage the hardware!). Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 29 ++-- 1 file changed

[PATCH 03/16] staging: comedi: comedi_test: remove nano_per_micro

2015-10-27 Thread Ian Abbott
The `static const int nano_per_micro` variable is set to 1000, the number of nanoseconds in a microsecond. Remove it and use the `NSEC_PER_USEC` macro from instead. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/comedi_test.c | 17 +++-- 1 file changed, 7 insertions

[PATCH 09/16] staging: comedi: comedi_test: rename members for AI commands

2015-10-27 Thread Ian Abbott
Rename the members of `struct waveform_private` that are used to handle AI commands, apart from those members used to control fake waveform generation. The renames are `timer` --> `ai_timer`, `scan_period` --> `ai_scan_period`, and `convert_period` --> `ai_convert_period`. Signed-of

[PATCH 08/16] staging: comedi: comedi_test: simplify time since last AI scan

2015-10-27 Thread Ian Abbott
` that records the time of the last scan. This simplifies the calculation of the number of scans to simulate in the timer routine, `waveform_ai_interrupt()`. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 27 ++- 1 file c

[PATCH 11/16] staging: comedi: comedi_test: make timer rate similar to scan rate

2015-10-27 Thread Ian Abbott
. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index 1b3ad7f..9655dc3

[PATCH 10/16] staging: comedi: comedi_test: rename waveform members

2015-10-27 Thread Ian Abbott
rent time within a waveform period). Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 40 ++-- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging

[PATCH 12/16] staging: comedi: comedi_test: use unsigned short for loopback values

2015-10-27 Thread Ian Abbott
of the AI subdevice `waveform_ai_insn_read()`. As the stored sample values are only 16 bits wide, change the type of the `ao_loopbacks[]` member to `unsigned short` to save some space. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 2 +- 1 file

[PATCH 04/16] staging: comedi: comedi_test: limit maximum convert_arg

2015-10-27 Thread Ian Abbott
ts within an `unsigned int`, as that is used to limit the minimum scan period (`cmd->scan_begin_arg`). Also ensure rounding of the conversion period and scan period to the nearest microsecond both fit in an `unsigned int`. Do all this in stage 4 ("fix up any arguments") of the command testin

[PATCH 05/16] staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW

2015-10-27 Thread Ian Abbott
_private`. An `unsigned int` is still wide enough, because the conversion period is no more than `UINT_MAX / 1000` microseconds and the number of conversions is no more than 16 (`N_CHANS * 2`). Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/com

[PATCH 02/16] staging: comedi: comedi_test: saturate fake waveform values

2015-10-27 Thread Ian Abbott
the sample values that would go out of range. This is closer to how a real hardware device would behave (assuming the input voltage is not high enough to damage the hardware!). Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.

[PATCH 03/16] staging: comedi: comedi_test: remove nano_per_micro

2015-10-27 Thread Ian Abbott
The `static const int nano_per_micro` variable is set to 1000, the number of nanoseconds in a microsecond. Remove it and use the `NSEC_PER_USEC` macro from instead. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 17 +++--

[PATCH 00/16] staging: comedi: comedi_test: enhancements

2015-10-27 Thread Ian Abbott
The "comedi_test" module is a driver for a dummy COMEDI device. It has an analog input subdevice and an analog output subdevice. The analog input subdevice supports COMEDI asynchronous acquisition commands using waveform generators to generate the input data for each channel. A kernel timer is

[PATCH 15/16] staging: comedi: comedi_test: rename waveform_ai_interrupt()

2015-10-27 Thread Ian Abbott
`waveform_ai_interrupt()` is a timer expiry function used to generate fake waveform data for an analog input subdevice. Rename it to `waveform_ai_timer()`. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 5 ++--- 1 file changed, 2 inse

[PATCH 01/16] staging: comedi: comedi_test: reformat multi-line comments

2015-10-27 Thread Ian Abbott
Use the preferred style for multi-line comments. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 94 ++-- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_tes

[PATCH 06/16] staging: comedi: comedi_test: move modulo operations for waveform

2015-10-27 Thread Ian Abbott
the time since the start of a waveform exceeds the waveform period. Usually, several samples are produced in each waveform period and modulo operations are typically more expensive than a simple comparison. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/d

[PATCH 07/16] staging: comedi: comedi_test: use unsigned int for waveform timing

2015-10-27 Thread Ian Abbott
the waveform period) will be no more than `INT_MAX + UINT_MAX / 1000`. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/d

[PATCH 16/16] staging: comedi: comedi_test: implement commands on AO subdevice

2015-10-27 Thread Ian Abbott
ice. The command is stopped when the "cancel" handler `waveform_ao_cancel()` is called. This may be due to the command terminating due to completion or an error, or as a result of the user cancelling the command. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- d

[PATCH 14/16] staging: comedi: comedi_test: handle partial scans in timer routine

2015-10-27 Thread Ian Abbott
Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers/comedi_test.c | 85 ++-- 1 file changed, 54 insertions(+), 31 deletions(-) diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c index 468847a

[PATCH 13/16] staging: comedi: comedi_test: allow read-back of AO channels

2015-10-27 Thread Ian Abbott
on the analog output subdevice to be read back via corresponding channels on the analog input subdevice. The "insn_read" handler for the analog input subdevice is `waveform_ai_insn_read()`. Set that as the "insn_read" handler for the analog output subdevice as well. Sign

[PATCH] staging: comedi: fix extreme case of comedi_nsamples_left()

2015-10-23 Thread Ian Abbott
nscans` to avoid the overflow. This overflow bug doesn't affect any of the current COMEDI drivers. I stumbled across it while changing to one of the drivers. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers.c | 38 +- 1 file changed, 21 insertions(

[PATCH] staging: comedi: fix extreme case of comedi_nsamples_left()

2015-10-23 Thread Ian Abbott
nscans` to avoid the overflow. This overflow bug doesn't affect any of the current COMEDI drivers. I stumbled across it while changing to one of the drivers. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/drivers.c | 38 +- 1 file

Re: [PATCH 1/3] staging: comedi: make ni_tio_has_gate2_registers return boolean

2015-10-21 Thread Ian Abbott
ies: default: - return 0; + return false; case ni_gpct_variant_m_series: case ni_gpct_variant_660x: - return 1; + return true; } } Looks okay! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-m

Re: [PATCH 1/3] staging: comedi: make ni_tio_has_gate2_registers return boolean

2015-10-21 Thread Ian Abbott
case ni_gpct_variant_e_series: default: - return 0; + return false; case ni_gpct_variant_m_series: case ni_gpct_variant_660x: - return 1; + return true; } } Looks okay! Reviewed-by: Ian Abbott <abbo...@mev.co.uk&

[PATCH 2/2] staging: comedi: comedidev.h: spaces preferred around that '*'

2015-10-12 Thread Ian Abbott
Fix the checkpatch.pl issues: CHECK: spaces preferred around that '*' (ctx:VxV) Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedidev.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi

[PATCH 0/2] staging: comedi: comedidev.h: fix some checkpatch issues

2015-10-12 Thread Ian Abbott
Fix some checkpatch issues in "comedidev.h". There are still some CamelCase warnings, but since those are for the use of "mA" and it represents "milliamps", I think I'll leave them alone. 1) staging: comedi: comedidev.h: add comments to spin-lock and mutex 2) staging: comedi: comedidev.h: spaces

[PATCH 1/2] staging: comedi: comedidev.h: add comments to spin-lock and mutex

2015-10-12 Thread Ian Abbott
Fix the checkpatch.pl issues: CHECK: spinlock_t definition without comment CHECK: struct mutes definition withoug comment Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedidev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi

[PATCH 01/10] staging: comedi: remain busy until read end-of-file

2015-10-12 Thread Ian Abbott
onbusy` doesn't get set to `true` unless the count is 0, but check the return count anyway to make the intention clearer. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/dr

[PATCH 04/10] staging: comedi: make some variables unsigned in comedi_read()

2015-10-12 Thread Ian Abbott
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 cca3fb1..ae9d519 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b

[PATCH 05/10] staging: comedi: avoid bad truncation of a size_t in comedi_read()

2015-10-12 Thread Ian Abbott
At one point in `comedi_read()`, the variable `n` gets assigned to the minimum of the parameter `nbytes` and the amount of readable buffer space `m`. 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 03/10] staging: comedi: do extra checks for becoming non-busy for "read"

2015-10-12 Thread Ian Abbott
as terminated, and has no data available to be read. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 89e8e87..cca

[PATCH 08/10] staging: comedi: return error on "read" if no command set up

2015-10-12 Thread Ian Abbott
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 | 7 ++- 1 file changed, 6 insertions

[PATCH 09/10] staging: comedi: simplify returned errors for comedi_read()

2015-10-12 Thread Ian Abbott
tion" 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 a/drive

[PATCH 10/10] staging: comedi: check for more errors for zero-length read

2015-10-12 Thread Ian Abbott
subdevice to be marked as non-busy, and the return value does not indicate an "end-of-file" condition. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/dr

[PATCH 02/10] staging: comedi: don't consider "unmunged" data when becoming non-busy

2015-10-12 Thread Ian Abbott
d directly through the mmapped buffer instead of via the "read" file operation.) Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/com

[PATCH 06/10] staging: comedi: allow buffer wraparound in comedi_read()

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

[PATCH 07/10] staging: comedi: remove superfluous retval = 0 in comedi_read()

2015-10-12 Thread Ian Abbott
`comedi_read()` initializes `retval` to 0. The other `retval = 0` assignments are superfluous, so remove them. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi

[PATCH 00/10] staging: comedi: some comedi_read() changes

2015-10-12 Thread Ian Abbott
Tidy up the "read" file operation handler, `comedi_read()` a bit and improve the error handling and the "end-of-file" handling. There are some other changes I want to make, such as switching to the newer wait API (prepare_to_wait()/finish_wait()) and preventing several tasks trying to read or

[PATCH 05/10] staging: comedi: avoid bad truncation of a size_t in comedi_read()

2015-10-12 Thread Ian Abbott
At one point in `comedi_read()`, the variable `n` gets assigned to the minimum of the parameter `nbytes` and the amount of readable buffer space `m`. 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 03/10] staging: comedi: do extra checks for becoming non-busy for "read"

2015-10-12 Thread Ian Abbott
as terminated, and has no data available to be read. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi

[PATCH 07/10] staging: comedi: remove superfluous retval = 0 in comedi_read()

2015-10-12 Thread Ian Abbott
`comedi_read()` initializes `retval` to 0. The other `retval = 0` assignments are superfluous, so remove them. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/comedi/comedi_fop

[PATCH 00/10] staging: comedi: some comedi_read() changes

2015-10-12 Thread Ian Abbott
Tidy up the "read" file operation handler, `comedi_read()` a bit and improve the error handling and the "end-of-file" handling. There are some other changes I want to make, such as switching to the newer wait API (prepare_to_wait()/finish_wait()) and preventing several tasks trying to read or

[PATCH 01/10] staging: comedi: remain busy until read end-of-file

2015-10-12 Thread Ian Abbott
onbusy` doesn't get set to `true` unless the count is 0, but check the return count anyway to make the intention clearer. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/

[PATCH 04/10] staging: comedi: make some variables unsigned in comedi_read()

2015-10-12 Thread Ian Abbott
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 cca3fb1..ae9d519 100644 --- a/drivers/staging/

[PATCH 10/10] staging: comedi: check for more errors for zero-length read

2015-10-12 Thread Ian Abbott
subdevice to be marked as non-busy, and the return value does not indicate an "end-of-file" condition. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/stagi

[PATCH 02/10] staging: comedi: don't consider "unmunged" data when becoming non-busy

2015-10-12 Thread Ian Abbott
d directly through the mmapped buffer instead of via the "read" file operation.) Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/driv

[PATCH 06/10] staging: comedi: allow buffer wraparound in comedi_read()

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

[PATCH 08/10] staging: comedi: return error on "read" if no command set up

2015-10-12 Thread Ian Abbott
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 | 7 ++-

[PATCH 09/10] staging: comedi: simplify returned errors for comedi_read()

2015-10-12 Thread Ian Abbott
tion" 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(+), 18 deletio

[PATCH 1/2] staging: comedi: comedidev.h: add comments to spin-lock and mutex

2015-10-12 Thread Ian Abbott
Fix the checkpatch.pl issues: CHECK: spinlock_t definition without comment CHECK: struct mutes definition withoug comment Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedidev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/d

[PATCH 0/2] staging: comedi: comedidev.h: fix some checkpatch issues

2015-10-12 Thread Ian Abbott
Fix some checkpatch issues in "comedidev.h". There are still some CamelCase warnings, but since those are for the use of "mA" and it represents "milliamps", I think I'll leave them alone. 1) staging: comedi: comedidev.h: add comments to spin-lock and mutex 2) staging: comedi: comedidev.h: spaces

[PATCH 2/2] staging: comedi: comedidev.h: spaces preferred around that '*'

2015-10-12 Thread Ian Abbott
Fix the checkpatch.pl issues: CHECK: spaces preferred around that '*' (ctx:VxV) Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedidev.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/comedidev.h b/d

[PATCH 0/6] staging: comedi: fix some minor issues with file poll op

2015-10-09 Thread Ian Abbott
A few changes for the "poll" file operation to avoid poll-waiting on the same subdevice for both read and write (patch 1), avoid allocating write buffer space unnecessarily and possibly inappropriately (patch 4), consider whether any active commands belong to the current file object (patch 5), and

[PATCH 4/6] staging: comedi: don't allocate buffer space when polling for write

2015-10-09 Thread Ian Abbott
ing the buffer space before checking a "write" command is running can cause problems if the subdevice supports commands in either direction and currently has an active "read" command. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 3 +-- 1 file changed, 1

[PATCH 2/6] staging: comedi: rename comedi_buf_write_n_available

2015-10-09 Thread Ian Abbott
-off-by: Ian Abbott --- drivers/staging/comedi/comedi_buf.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index d45a4b6..4837559 100644 --- a/drivers/staging/comedi/comedi_buf.c +++ b/drivers

[PATCH 5/6] staging: comedi: check command started by file being polled

2015-10-09 Thread Ian Abbott
nly file object able to read (or write) data, take it into consideration. With this change, if no read (or write) command is running on the subdevice, or it is started by a different file object, the file object is marked as readable (or writeable) regardless, but the read (or write) file operatio

[PATCH 6/6] staging: comedi: don't use mutex when polling file

2015-10-09 Thread Ian Abbott
ce becoming detached at an inopportune moment. Do the same for the "poll" file operation. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi

[PATCH 3/6] staging: comedi: add new comedi_buf_write_n_available()

2015-10-09 Thread Ian Abbott
. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_buf.c | 8 drivers/staging/comedi/comedi_internal.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index 4837559..90c2801 100644 --- a/drivers

[PATCH 1/6] staging: comedi: don't poll_wait on same subdevice twice

2015-10-09 Thread Ian Abbott
same subdevice twice. Although harmless, it wastes a poll table entry. Check for that, and avoid it. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/

[PATCH 1/6] staging: comedi: don't poll_wait on same subdevice twice

2015-10-09 Thread Ian Abbott
same subdevice twice. Although harmless, it wastes a poll table entry. Check for that, and avoid it. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops

[PATCH 6/6] staging: comedi: don't use mutex when polling file

2015-10-09 Thread Ian Abbott
ce becoming detached at an inopportune moment. Do the same for the "poll" file operation. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/driver

[PATCH 3/6] staging: comedi: add new comedi_buf_write_n_available()

2015-10-09 Thread Ian Abbott
. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_buf.c | 8 drivers/staging/comedi/comedi_internal.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index 4837559..9

[PATCH 2/6] staging: comedi: rename comedi_buf_write_n_available

2015-10-09 Thread Ian Abbott
-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_buf.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c index d45a4b6..4837559 100644 --- a/drivers/staging/

[PATCH 5/6] staging: comedi: check command started by file being polled

2015-10-09 Thread Ian Abbott
nly file object able to read (or write) data, take it into consideration. With this change, if no read (or write) command is running on the subdevice, or it is started by a different file object, the file object is marked as readable (or writeable) regardless, but the read (or write) file operatio

[PATCH 4/6] staging: comedi: don't allocate buffer space when polling for write

2015-10-09 Thread Ian Abbott
ing the buffer space before checking a "write" command is running can cause problems if the subdevice supports commands in either direction and currently has an active "read" command. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/staging/comedi/comedi_fop

[PATCH 0/6] staging: comedi: fix some minor issues with file poll op

2015-10-09 Thread Ian Abbott
A few changes for the "poll" file operation to avoid poll-waiting on the same subdevice for both read and write (patch 1), avoid allocating write buffer space unnecessarily and possibly inappropriately (patch 4), consider whether any active commands belong to the current file object (patch 5), and

[PATCH] staging: comedi: comedi_usb.c: improve function documentation

2015-09-30 Thread Ian Abbott
Expand the descriptions of the functions and document the return values. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_usb.c | 75 + 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/drivers/staging/comedi/comedi_usb.c b/drivers

[PATCH] staging: comedi: comedi_pcmcia.c: improve function documentation

2015-09-30 Thread Ian Abbott
Expand the descriptions of the functions and document the return values. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_pcmcia.c | 104 - 1 file changed, 76 insertions(+), 28 deletions(-) diff --git a/drivers/staging/comedi/comedi_pcmcia.c b

[PATCH] staging: comedi: comedi_pci.c: Fix kernel-doc Return tags

2015-09-30 Thread Ian Abbott
Fix the 'Return' tags in the kernel-doc comments as they currently say 'Returns', which is not recognized by kernel-doc. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_pci.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi

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