Re: [PATCH v5] staging: comedi: Improved readability of function comedi_nsamples_left.

2018-06-13 Thread Ian Abbott
nsamples) + return samples_left; return nsamples; } EXPORT_SYMBOL_GPL(comedi_nsamples_left); -- 2.1.4 The actual patch looks fine thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=

Re: [PATCH v4] staging: comedi: Improved readability of function comedi_nsamples_left.

2018-06-13 Thread Ian Abbott
text below the cut-off line. I don't know. Maybe? I haven't seen it used before. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-

Re: [PATCH v4] staging: comedi: Improved readability of function comedi_nsamples_left.

2018-06-13 Thread Ian Abbott
text below the cut-off line. I don't know. Maybe? I haven't seen it used before. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-

Re: [PATCH v4] staging: comedi: Improved readability of function comedi_nsamples_left.

2018-06-13 Thread Ian Abbott
thing below the "---" cut-off line gets stripped out of the commit message in the git repository, so that is a good place to add comments about the patch itself (such as change logs) that do not belong in the commit message. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( ME

Re: [PATCH v4] staging: comedi: Improved readability of function comedi_nsamples_left.

2018-06-13 Thread Ian Abbott
thing below the "---" cut-off line gets stripped out of the commit message in the git repository, so that is a good place to add comments about the patch itself (such as change logs) that do not belong in the commit message. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( ME

Re: [PATCH] staging: comedi: comedidev.h: Fix SPDX-License-Identifier tag style

2018-05-25 Thread Ian Abbott
@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * comedidev.h * header file for kernel-only structures, variables, and constants That looks fine thanks. Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott <abbo...@me

Re: [PATCH] staging: comedi: comedidev.h: Fix SPDX-License-Identifier tag style

2018-05-25 Thread Ian Abbott
-Identifier: GPL-2.0+ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * comedidev.h * header file for kernel-only structures, variables, and constants That looks fine thanks. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England

Re: [PATCH] Staging:Comedi:comedi_compat32.c: Lindent changes

2018-05-15 Thread Ian Abbott
>chanlist); + >chanlist); err |= __get_user(temp.uint, >chanlist_len); err |= __put_user(temp.uint, >chanlist_len); err |= __get_user(temp.uptr, >data); That is the only one that is an improvement, IMHO. -- -=( Ian Abbott <abbo...@mev.co.uk> || W

Re: [PATCH] Staging:Comedi:comedi_compat32.c: Lindent changes

2018-05-15 Thread Ian Abbott
err |= __get_user(temp.uint, >chanlist_len); err |= __put_user(temp.uint, >chanlist_len); err |= __get_user(temp.uptr, >data); That is the only one that is an improvement, IMHO. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company register

Re: [PATCH] staging: comedi: cb_pcidas64: fix alignment of function parameters

2018-04-11 Thread Ian Abbott
struct pcidas64_private *devpriv = dev->private; unsigned int divisor; Looks good, thanks. I guess the remaining case of open parentheses alignment wasn't changed because that would exceed 80 columns. Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd

Re: [PATCH] staging: comedi: cb_pcidas64: fix alignment of function parameters

2018-04-11 Thread Ian Abbott
ate *devpriv = dev->private; unsigned int divisor; Looks good, thanks. I guess the remaining case of open parentheses alignment wasn't changed because that would exceed 80 columns. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web

Re: [PATCH] staging: comedi: cb_pcidas64: fix alignment of function parameters

2018-04-11 Thread Ian Abbott
) + const struct comedi_cmd *cmd) Someone has made the effort to put const on these parameters, but not on the other similar functions. Perhaps this can be improved as well. Perhaps, but that should be in a separate patch. -- -=( Ian Abbott @ MEV Ltd.E-mail: <a

Re: [PATCH] staging: comedi: cb_pcidas64: fix alignment of function parameters

2018-04-11 Thread Ian Abbott
) + const struct comedi_cmd *cmd) Someone has made the effort to put const on these parameters, but not on the other similar functions. Perhaps this can be improved as well. Perhaps, but that should be in a separate patch. -- -=( Ian Abbott @ MEV Ltd.E-mail

Re: [PATCH] Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

2018-03-16 Thread Ian Abbott
dev->card) continue; Looks good, 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: drivers: ni_atmio.c: fixed multi-line derefernce issue

2018-03-16 Thread Ian Abbott
ntinue; Looks good, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

2018-03-16 Thread Ian Abbott
id), NULL); + ISAPNP_FUNCTION(ni_boards[i].isapnp_id), + NULL); if (!isapnp_dev || !isapnp_dev->card) continue; I suggest splitting the expression just after the '=' to avoid going over 80 columns. -- -=( Ian Abbo

Re: [PATCH] Staging: comedi: drivers: ni_atmio.c: fixed multi-line derefernce issue

2018-03-16 Thread Ian Abbott
ION(ni_boards[i].isapnp_id), + NULL); if (!isapnp_dev || !isapnp_dev->card) continue; I suggest splitting the expression just after the '=' to avoid going over 80 columns. -- -=( Ian Abbott @ MEV Ltd.

Re: [PATCH] staging: comedi: adl_pci6208: remove redundant initialization of 'val'

2018-03-13 Thread Ian Abbott
0; i < insn->n; i++) { - val = data[i]; + unsigned int val = data[i]; /* D/A transfer rate is 2.2us */ ret = comedi_timeout(dev, s, insn, pci6208_ao_eoc, 0); Looks good, thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbo

Re: [PATCH] staging: comedi: adl_pci6208: remove redundant initialization of 'val'

2018-03-13 Thread Ian Abbott
unsigned int val = data[i]; /* D/A transfer rate is 2.2us */ ret = comedi_timeout(dev, s, insn, pci6208_ao_eoc, 0); Looks good, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] Staging: comedi: das16: Fixed a const struct coding style issue

2017-11-27 Thread Ian Abbott
if (min || max) { - struct comedi_lrange *lrange; + const struct comedi_lrange *lrange; struct comedi_krange *krange; /* allocate single-range range table */ Ditto. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=(

Re: [PATCH] Staging: comedi: das16: Fixed a const struct coding style issue

2017-11-27 Thread Ian Abbott
*lrange; + const struct comedi_lrange *lrange; struct comedi_krange *krange; /* allocate single-range range table */ Ditto. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] Staging: comedi: adl_pci9118.c : fixed code style issue

2017-11-20 Thread Ian Abbott
(cmd->scan_end_arg == 1)) { +   if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) {     if (cmd->convert_src == TRIG_NOW)     devpriv->ai_add_back = 1;             if (cmd-

Re: [PATCH] Staging: comedi: adl_pci9118.c : fixed code style issue

2017-11-20 Thread Ian Abbott
   (cmd->scan_end_arg == 1)) { +   if (cmd->flags & CMDF_WAKE_EOS && cmd->scan_end_arg == 1) {     if (cmd->convert_src == TRIG_NOW)     devpriv->ai_add_back = 1;         if (cmd->convert

Re: [PATCH v2] staging: comedi: add missing MODULE_DESCRIPTION/LICENSE

2017-11-20 Thread Ian Abbott
On 20/11/17 10:29, Ian Abbott wrote: On 20/11/17 07:50, Jesse Chan wrote: This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/staging/comedi/drivers/ni_atmio.o see include/linux/module.h for more information

Re: [PATCH v2] staging: comedi: add missing MODULE_DESCRIPTION/LICENSE

2017-11-20 Thread Ian Abbott
On 20/11/17 10:29, Ian Abbott wrote: On 20/11/17 07:50, Jesse Chan wrote: This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/staging/comedi/drivers/ni_atmio.o see include/linux/module.h for more information

Re: [PATCH] staging: comedi: ni_atmio: fix license warning.

2017-11-20 Thread Ian Abbott
the same driver by Jesse Chan, but that one never had the MODULE_AUTHOR line. Also, your patch arrived earlier, so should take precedence. 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: ni_atmio: fix license warning.

2017-11-20 Thread Ian Abbott
n, but that one never had the MODULE_AUTHOR line. Also, your patch arrived earlier, so should take precedence. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH v2] staging: comedi: add missing MODULE_DESCRIPTION/LICENSE

2017-11-20 Thread Ian Abbott
(ni_atmio_driver); + +MODULE_DESCRIPTION("Comedi low-level driver"); +MODULE_LICENSE("GPL"); Thanks! I wonder how I managed to miss out this driver in commit 3c323c01b6bd ("Staging: comedi: Add MODULE_LICENSE and similar to NI modules")? Reviewed-by: Ian Abbott <abbo

Re: [PATCH v2] staging: comedi: add missing MODULE_DESCRIPTION/LICENSE

2017-11-20 Thread Ian Abbott
ESCRIPTION("Comedi low-level driver"); +MODULE_LICENSE("GPL"); Thanks! I wonder how I managed to miss out this driver in commit 3c323c01b6bd ("Staging: comedi: Add MODULE_LICENSE and similar to NI modules")? Reviewed-by: Ian Abbott

Re: [PATCH] staging: comedi: ni_atmio: Handle return value of pnp_*

2017-11-16 Thread Ian Abbott
re valid. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] staging: comedi: ni_atmio: Handle return value of pnp_*

2017-11-16 Thread Ian Abbott
); irq = pnp_irq(isapnp_dev, 0); + if (irq == -1 || !iobase) + return -ENOMEM; + comedi_set_hw_dev(dev, _dev->dev); } Can they fail here? ni_isapnp_find_board() has already checked they are valid. -- -=( Ian Abbott @ MEV

Re: [PATCH] staging: comedi: usbdux: remove redundant initialization of val

2017-11-08 Thread Ian Abbott
Thanks for catching that. It looks like it has been redundant since commit 65a847477f63 ("staging: comedi: usbdux: use comedi_subdevice 'readback'"). 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: usbdux: remove redundant initialization of val

2017-11-08 Thread Ian Abbott
since commit 65a847477f63 ("staging: comedi: usbdux: use comedi_subdevice 'readback'"). Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] staging: comedi: usbduxsigma: Improve unlocking of a mutex in three functions

2017-11-03 Thread Ian Abbott
_unlock(>mut); - return ret; - } + if (ret < 0) + goto unlock; + s->readback[chan] = data[i]; } mutex_unlock(>mut); return insn->n; Ditto. + +unlock: + mutex_unlock

Re: [PATCH] staging: comedi: usbduxsigma: Improve unlocking of a mutex in three functions

2017-11-03 Thread Ian Abbott
} + if (ret < 0) + goto unlock; + s->readback[chan] = data[i]; } mutex_unlock(>mut); return insn->n; Ditto. + +unlock: + mutex_unlock(>mut); + return ret; } static int usbduxsigma_ao_inttrig(struct comedi_device *dev, -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] staging: comedi: usbduxfast: Improve unlocking of a mutex in usbduxfast_ai_insn_read()

2017-11-03 Thread Ian Abbott
by replacing the above three lines with: ret = insn->n; which will fall through to the 'unlock:' label below. + +unlock: + mutex_unlock(>mut); + return ret; } static int usbduxfast_upload_firmware(struct comedi_device *dev, -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH] staging: comedi: usbduxfast: Improve unlocking of a mutex in usbduxfast_ai_insn_read()

2017-11-03 Thread Ian Abbott
fall through to the 'unlock:' label below. + +unlock: + mutex_unlock(>mut); + return ret; } static int usbduxfast_upload_firmware(struct comedi_device *dev, -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

[PATCH] fpga: region: release of_parse_phandle nodes after use

2017-10-27 Thread Ian Abbott
tree control for FPGA") Cc: <sta...@vger.kernel.org> # 4.10+ Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- drivers/fpga/fpga-region.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-regio

[PATCH] fpga: region: release of_parse_phandle nodes after use

2017-10-27 Thread Ian Abbott
tree control for FPGA") Cc: # 4.10+ Signed-off-by: Ian Abbott --- drivers/fpga/fpga-region.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index d9ab7c75b14f..e0c73ceba2ed 100644 --- a/drivers/fpga/fpg

Re: [PATCH] staging/comedi: Convert timers to use timer_setup()

2017-10-17 Thread Ian Abbott
-- drivers/staging/comedi/drivers/das16.c | 11 ++- drivers/staging/comedi/drivers/jr3_pci.c | 10 ++ 3 files changed, 22 insertions(+), 17 deletions(-) It looks fine to me. Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.

Re: [PATCH] staging/comedi: Convert timers to use timer_setup()

2017-10-17 Thread Ian Abbott
++ 3 files changed, 22 insertions(+), 17 deletions(-) It looks fine to me. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH v2] staging: comedi: dt282x: fix IRQ assignment for dev->irq.

2017-10-09 Thread Ian Abbott
if (!devpriv->dma) free_irq(irq_num, dev); + else + dev->irq = irq_num; } static void dt282x_free_dma(struct comedi_device *dev) Good catch. Thanks! Reviewed-by: Ian Abbott <abbo...@mev.co.uk> -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk>

Re: [PATCH v2] staging: comedi: dt282x: fix IRQ assignment for dev->irq.

2017-10-09 Thread Ian Abbott
rq(irq_num, dev); + else + dev->irq = irq_num; } static void dt282x_free_dma(struct comedi_device *dev) Good catch. Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-09-25 Thread Ian Abbott
e are several clocksource config options in "drivers/clocksource/Kconfig" that select 'TIMER_OF' without depending on 'GENERIC_CLOCKEVENTS'. Some of them are only manually selectable when 'COMPILE_TEST' is selected. This particular failure seems to be at

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-09-25 Thread Ian Abbott
e are several clocksource config options in "drivers/clocksource/Kconfig" that select 'TIMER_OF' without depending on 'GENERIC_CLOCKEVENTS'. Some of them are only manually selectable when 'COMPILE_TEST' is selected. This particular failure seems to be at least partly due to 'ARMV

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-09-25 Thread Ian Abbott
uot; that select 'TIMER_OF' without depending on 'GENERIC_CLOCKEVENTS'. Some of them are only manually selectable when 'COMPILE_TEST' is selected. This particular failure seems to be at least partly due to 'ARMV7M_SYSTICK' getting selected. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-09-25 Thread Ian Abbott
uot; that select 'TIMER_OF' without depending on 'GENERIC_CLOCKEVENTS'. Some of them are only manually selectable when 'COMPILE_TEST' is selected. This particular failure seems to be at least partly due to 'ARMV7M_SYSTICK' getting selected. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH v2 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-21 Thread Ian Abbott
On 21/09/17 00:27, Kees Cook wrote: With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott <abbo...@mev.co.uk> Cc: H Hartley Sweeten <hswee...@visionengravers.com&

Re: [PATCH v2 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-21 Thread Ian Abbott
On 21/09/17 00:27, Kees Cook wrote: With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott Cc: H Hartley Sweeten Cc: Greg Kroah-Hartman Cc: de...@driverdev.osuosl.org Signed

Re: [PATCH 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-01 Thread Ian Abbott
On 01/09/17 10:29, Ian Abbott wrote: On 01/09/17 00:29, Kees Cook wrote: With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott <abbo...@mev.co.uk> Cc: H Hartley Sweeten

Re: [PATCH 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-01 Thread Ian Abbott
On 01/09/17 10:29, Ian Abbott wrote: On 01/09/17 00:29, Kees Cook wrote: With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott Cc: H Hartley Sweeten Cc: Greg Kroah-Hartman

Re: [PATCH 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-01 Thread Ian Abbott
On 01/09/17 00:29, Kees Cook wrote: With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott <abbo...@mev.co.uk> Cc: H Hartley Sweeten <hswee...@visionengravers.com&

Re: [PATCH 26/31] staging/comedi/das16: Make timer initialization unconditional

2017-09-01 Thread Ian Abbott
On 01/09/17 00:29, Kees Cook wrote: With timer initialization made unconditional, there is no reason to make del_timer_sync() calls conditionally, there by removing the test of the .data field. Cc: Ian Abbott Cc: H Hartley Sweeten Cc: Greg Kroah-Hartman Cc: de...@driverdev.osuosl.org Signed

Re: [PATCH] Staging: comedi: addi_apci_3501: fixed a CamelCase coding style issue

2017-08-08 Thread Ian Abbott
member is also used in "drivers/staging/comedi/addi-data/hwdrv_apci3501.c" which is #include'd by "addi_apci_3501.c") and out-of-date (the 'tsk_Current' member was removed in kernel version 4.9 by commit a6672530f6fc ("staging: comedi: addi_apci_3501: remove timer/counter su

Re: [PATCH] Staging: comedi: addi_apci_3501: fixed a CamelCase coding style issue

2017-08-08 Thread Ian Abbott
ers/staging/comedi/addi-data/hwdrv_apci3501.c" which is #include'd by "addi_apci_3501.c") and out-of-date (the 'tsk_Current' member was removed in kernel version 4.9 by commit a6672530f6fc ("staging: comedi: addi_apci_3501: remove timer/counter subdevice support"

[PATCH] staging: comedi: comedi_fops: do not call blocking ops when !TASK_RUNNING

2017-07-28 Thread Ian Abbott
to `TASK_RUNNING` a bit earlier before calling these functions. Reported-by: Piotr Gregor <piotrgre...@rsyncme.org> Signed-off-by: Ian Abbott <abbo...@mev.co.uk> Cc: <sta...@vger.kernel.org> # 4.5+ --- Note: stable kernel versions 4.4 and earlier will need a slightly more extensive chang

[PATCH] staging: comedi: comedi_fops: do not call blocking ops when !TASK_RUNNING

2017-07-28 Thread Ian Abbott
to `TASK_RUNNING` a bit earlier before calling these functions. Reported-by: Piotr Gregor Signed-off-by: Ian Abbott Cc: # 4.5+ --- Note: stable kernel versions 4.4 and earlier will need a slightly more extensive change in `comedi_write()` than provided by this patch due to a call to `mutex_lock

Re: [PATCH] staging: comedi: ni_mio_common.c: fix coding style issue

2017-07-28 Thread Ian Abbott
unsigned int max_count) { +unsigned int max_count) +{ #ifdef PCIDMA unsigned int nbytes = max_count; Thanks for the fix. 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: ni_mio_common.c: fix coding style issue

2017-07-28 Thread Ian Abbott
signed int max_count) +{ #ifdef PCIDMA unsigned int nbytes = max_count; Thanks for the fix. Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-24 Thread Ian Abbott
ontainer_of()"); \ 863 ((type *)(__mptr - offsetof(type, member))); }) 864 Matt Redfearn sent a fix 6 days ago. It didn't get Cc'ed to LKML, but it did get Cc'd to the CLOCKSOURCE maintainers. Does it need re-posting? -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-24 Thread Ian Abbott
ontainer_of()"); \ 863 ((type *)(__mptr - offsetof(type, member))); }) 864 Matt Redfearn sent a fix 6 days ago. It didn't get Cc'ed to LKML, but it did get Cc'd to the CLOCKSOURCE maintainers. Does it need re-posting? -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-18 Thread Ian Abbott
[Top-posting fixed. Please don't top-post!] On 17/07/17 19:14, Piotr Gregor wrote: On Mon, Jul 17, 2017 at 05:02:45PM +0100, Ian Abbott wrote: On 17/07/17 15:48, Piotr Gregor wrote: Calling blocking operations from wrong context. Kernel: Linux piotrpc 4.4.70-rt83 #1 SMP PREEMPT RT Thu Jul 13

Re: [BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-18 Thread Ian Abbott
[Top-posting fixed. Please don't top-post!] On 17/07/17 19:14, Piotr Gregor wrote: On Mon, Jul 17, 2017 at 05:02:45PM +0100, Ian Abbott wrote: On 17/07/17 15:48, Piotr Gregor wrote: Calling blocking operations from wrong context. Kernel: Linux piotrpc 4.4.70-rt83 #1 SMP PREEMPT RT Thu Jul 13

Re: [BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-17 Thread Ian Abbott
SK_RUNNING) before the call to mutex_lock(). I'll work on a patch. -- -=( Ian Abbott @ MEV Ltd.E-mail: <abbo...@mev.co.uk> )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [BUG] drivers: staging: comedi: do not call blocking ops when !TASK_RUNNING; state=1

2017-07-17 Thread Ian Abbott
SK_RUNNING) before the call to mutex_lock(). I'll work on a patch. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-16 Thread Ian Abbott
On 16/07/17 14:50, Ian Abbott wrote: On 16/07/17 04:24, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 commit: c7acec713d14c6ce8a20154f9dfda258d6bcad3b kernel.h: handle pointers

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-16 Thread Ian Abbott
On 16/07/17 14:50, Ian Abbott wrote: On 16/07/17 04:24, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 commit: c7acec713d14c6ce8a20154f9dfda258d6bcad3b kernel.h: handle pointers

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-16 Thread Ian Abbott
On 16/07/17 15:14, Ian Abbott wrote: On 16/07/17 14:50, Ian Abbott wrote: On 16/07/17 04:24, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 commit

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-16 Thread Ian Abbott
On 16/07/17 15:14, Ian Abbott wrote: On 16/07/17 14:50, Ian Abbott wrote: On 16/07/17 04:24, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 commit

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-16 Thread Ian Abbott
test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation struct clock_event_device is only completely defined when CONFIG_GENERIC_CLOCKEVENTS is defined, which it isn't. But I'm confused as to why TIMER_O

Re: include/linux/kernel.h:860:32: error: dereferencing pointer to incomplete type 'struct clock_event_device'

2017-07-16 Thread Ian Abbott
test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation struct clock_event_device is only completely defined when CONFIG_GENERIC_CLOCKEVENTS is defined, which it isn't. But I'm confused as to why TIMER_O

Re: [PATCH] staging: comedi: Use offset_in_page macro

2017-07-04 Thread Ian Abbott
"mm.h" header file gets included indirectly, and there are plenty of examples where `offset_in_page` is used without including directly. Signed-off-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: Use offset_in_page macro

2017-07-04 Thread Ian Abbott
ile gets included indirectly, and there are plenty of examples where `offset_in_page` is used without including directly. Signed-off-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

[PATCH] staging: comedi: ni_mio_common: fix AO timer off-by-one regression

2017-06-30 Thread Ian Abbott
common: Cleans up/clarifies ni_ao_cmd") Cc: Éric Piel <p...@delmic.com> Cc: Spencer E. Olson <olso...@umich.edu> Cc: <sta...@vger.kernel.org> # 4.7+ Signed-off-by: Ian Abbott <abbo...@mev.co.uk> --- The bug is also in 4.6.x, but this patch does not apply to it cleanly. --

[PATCH] staging: comedi: ni_mio_common: fix AO timer off-by-one regression

2017-06-30 Thread Ian Abbott
ni_ao_cmd") Cc: Éric Piel Cc: Spencer E. Olson Cc: # 4.7+ Signed-off-by: Ian Abbott --- The bug is also in 4.6.x, but this patch does not apply to it cleanly. --- drivers/staging/comedi/drivers/ni_mio_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/s

Re: [PATCH] kernel.h: fix new warnings for container_of()

2017-06-21 Thread Ian Abbott
"pointer type mismatch in container_of()"); \ - ((type *)((char *)(ptr) - offsetof(type, member))); }) + ((type *)(__mptr - offsetof(type, member))); }) /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ #ifdef CONFIG_FTRACE_MCOUNT_RECORD Acked-by: Ian A

Re: [PATCH] kernel.h: fix new warnings for container_of()

2017-06-21 Thread Ian Abbott
quot;pointer type mismatch in container_of()"); \ - ((type *)((char *)(ptr) - offsetof(type, member))); }) + ((type *)(__mptr - offsetof(type, member))); }) /* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ #ifdef CONFIG_FTRACE_MCOUNT_RECORD Acked-by: Ian Abbott -- -=(

Re: [PATCH v5 1/6] asm-generic/bug.h: declare struct pt_regs; before function prototype

2017-06-12 Thread Ian Abbott
On 08/06/17 15:07, Steven Rostedt wrote: On Thu, 25 May 2017 13:03:11 +0100 Ian Abbott <abbo...@mev.co.uk> wrote: The declaration of `__warn()` has `struct pt_regs *regs` as one of its parameters. This can result in compiler warnings if `struct regs` is not already declared. Add an

Re: [PATCH v5 1/6] asm-generic/bug.h: declare struct pt_regs; before function prototype

2017-06-12 Thread Ian Abbott
On 08/06/17 15:07, Steven Rostedt wrote: On Thu, 25 May 2017 13:03:11 +0100 Ian Abbott wrote: The declaration of `__warn()` has `struct pt_regs *regs` as one of its parameters. This can result in compiler warnings if `struct regs` is not already declared. Add an empty declaration of `struct

Re: [PATCH] Staging: comedi: ni_labpc_regs: fixed a block comment alignment issue

2017-06-09 Thread Ian Abbott
REGS_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/ )=-

Re: [PATCH] Staging: comedi: ni_labpc_regs: fixed a block comment alignment issue

2017-06-09 Thread Ian Abbott
-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=-

Re: [PATCH v2] xen: avoid type warning in xchg_xen_ulong

2017-06-08 Thread Ian Abbott
': drivers/xen/events/events_2l.c:187:1020: error: call to '__compiletime_assert_187' declared with attribute error: pointer type mismatch in container_of() This adds a cast to work around the warning. Cc: Ian Abbott <abbo...@mev.co.uk> Fixes: 85323a991d40 ("xen: arm: mandate EABI and use gen

Re: [PATCH v2] xen: avoid type warning in xchg_xen_ulong

2017-06-08 Thread Ian Abbott
': drivers/xen/events/events_2l.c:187:1020: error: call to '__compiletime_assert_187' declared with attribute error: pointer type mismatch in container_of() This adds a cast to work around the warning. Cc: Ian Abbott Fixes: 85323a991d40 ("xen: arm: mandate EABI and use generic atomic opera

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-26 Thread Ian Abbott
On 25/05/17 19:35, Kees Cook wrote: On Thu, May 25, 2017 at 5:03 AM, Ian Abbott <abbo...@mev.co.uk> wrote: If the first parameter of container_of() is a pointer to a non-const-qualified array type (and the third parameter names a non-const-qualified array member), the local variable

Re: [PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-26 Thread Ian Abbott
On 25/05/17 19:35, Kees Cook wrote: On Thu, May 25, 2017 at 5:03 AM, Ian Abbott wrote: If the first parameter of container_of() is a pointer to a non-const-qualified array type (and the third parameter names a non-const-qualified array member), the local variable __mptr will be defined

[PATCH v5 0/6] kernel.h: container_of() pointer checking

2017-05-25 Thread Ian Abbott
TL;DR: This series of patches splits BUILD_BUG related macros out of "include/linux/bug.h" into new file "include/linux/build_bug.h" (patch 5), and changes the pointer type checking in the `container_of()` macro to deal with pointers of array type better (patch 6). Patches 1 to 4 are

[PATCH v5 0/6] kernel.h: container_of() pointer checking

2017-05-25 Thread Ian Abbott
TL;DR: This series of patches splits BUILD_BUG related macros out of "include/linux/bug.h" into new file "include/linux/build_bug.h" (patch 5), and changes the pointer type checking in the `container_of()` macro to deal with pointers of array type better (patch 6). Patches 1 to 4 are

[PATCH v5 4/6] linux/bug.h: correct "space required before that '-'"

2017-05-25 Thread Ian Abbott
BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) I decided to wrap the bitfield expressions that begin with minus signs in parentheses rather than insert spaces before the minus signs. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Kees

[PATCH v5 4/6] linux/bug.h: correct "space required before that '-'"

2017-05-25 Thread Ian Abbott
BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) I decided to wrap the bitfield expressions that begin with minus signs in parentheses rather than insert spaces before the minus signs. Signed-off-by: Ian Abbott Cc: Andrew Morton Cc: Kees Cook Cc: Steven Rostedt Cc: Peter Zijlstra Cc: Jakub

[PATCH v5 5/6] bug: split BUILD_BUG stuff out into

2017-05-25 Thread Ian Abbott
that begin with a minus sign. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Kees Cook <keesc...@chromium.org> Cc: Steven Rostedt <rost...@goodmis.org> Cc: Peter Zijlstra <pet...@infradead.org> Cc: Jakub Kicinski <

[PATCH v5 5/6] bug: split BUILD_BUG stuff out into

2017-05-25 Thread Ian Abbott
that begin with a minus sign. Signed-off-by: Ian Abbott Cc: Andrew Morton Cc: Kees Cook Cc: Steven Rostedt Cc: Peter Zijlstra Cc: Jakub Kicinski Cc: Rasmus Villemoes --- v5: Actually, there was no v1 thru v4. I called this v5 to match the series. --- include/linux/bug.h | 74

[PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Ian Abbott
the macro to avoid these warnings. Make sure `*(ptr)` either has type compatible with the member, or has type compatible with `void`, ignoring qualifiers. Raise compiler errors if this is not true. This is stronger than the previous behaviour, which only resulted in compiler warnings for a t

[PATCH v5 3/6] linux/bug.h: correct "(foo*)" should be "(foo *)"

2017-05-25 Thread Ian Abbott
Correct this checkpatch.pl error: |ERROR: "(foo*)" should be "(foo *)" |#19: FILE: include/linux/bug.h:19: |+#define BUILD_BUG_ON_NULL(e) ((void*)0) Signed-off-by: Ian Abbott <abbo...@mev.co.uk> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Kees Cook &l

[PATCH v5 6/6] kernel.h: handle pointers to arrays better in container_of()

2017-05-25 Thread Ian Abbott
the macro to avoid these warnings. Make sure `*(ptr)` either has type compatible with the member, or has type compatible with `void`, ignoring qualifiers. Raise compiler errors if this is not true. This is stronger than the previous behaviour, which only resulted in compiler warnings for a type mi

[PATCH v5 3/6] linux/bug.h: correct "(foo*)" should be "(foo *)"

2017-05-25 Thread Ian Abbott
Correct this checkpatch.pl error: |ERROR: "(foo*)" should be "(foo *)" |#19: FILE: include/linux/bug.h:19: |+#define BUILD_BUG_ON_NULL(e) ((void*)0) Signed-off-by: Ian Abbott Cc: Andrew Morton Cc: Kees Cook Cc: Steven Rostedt Cc: Peter Zijlstra Cc: Jakub Kicinski

[PATCH v5 2/6] linux/bug.h: correct formatting of block comment

2017-05-25 Thread Ian Abbott
use a trailing */ on a separate line |#36: FILE: include/linux/bug.h:36: |+ aren't permitted). */ Signed-off-by: Ian Abbott <abbo...@mev.co.uk> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Kees Cook <keesc...@chromium.org> Cc: Steven Rostedt <rost...@goodmis.org>

[PATCH v5 1/6] asm-generic/bug.h: declare struct pt_regs; before function prototype

2017-05-25 Thread Ian Abbott
The declaration of `__warn()` has `struct pt_regs *regs` as one of its parameters. This can result in compiler warnings if `struct regs` is not already declared. Add an empty declaration of `struct pt_regs` to avoid the warnings. Signed-off-by: Ian Abbott <abbo...@mev.co.uk> Cc: Arnd Be

[PATCH v5 2/6] linux/bug.h: correct formatting of block comment

2017-05-25 Thread Ian Abbott
use a trailing */ on a separate line |#36: FILE: include/linux/bug.h:36: |+ aren't permitted). */ Signed-off-by: Ian Abbott Cc: Andrew Morton Cc: Kees Cook Cc: Steven Rostedt Cc: Peter Zijlstra Cc: Jakub Kicinski Cc: Rasmus Villemoes --- v5: Actually, there was no v1 thru v4. I called

[PATCH v5 1/6] asm-generic/bug.h: declare struct pt_regs; before function prototype

2017-05-25 Thread Ian Abbott
The declaration of `__warn()` has `struct pt_regs *regs` as one of its parameters. This can result in compiler warnings if `struct regs` is not already declared. Add an empty declaration of `struct pt_regs` to avoid the warnings. Signed-off-by: Ian Abbott Cc: Arnd Bergmann Acked-by: Arnd

Re: [PATCH v2] bug: fix problem including from linux/kernel.h

2017-05-24 Thread Ian Abbott
On 2017-05-24 17:06, Ian Abbott wrote: If "include/linux/kernel.h" includes , a circular dependency is introduced when "include/asm-generic/bug.h" includes . This results in build breakage when something includes before for architectures that select `CONFIG_GENERIC_

<    1   2   3   4   5   6   7   8   9   10   >