Message ID | 1617881896-3164-1-git-send-email-yangyicong@hisilicon.com (mailing list archive) |
---|---|
Headers | show |
Series | Simplify codes with devm_add_action_or_reset | expand |
On Thu, Apr 8, 2021 at 2:41 PM Yicong Yang <yangyicong@hisilicon.com> wrote: > > Some devm variants are implemented with devres_alloc() and devres_add() > manually to only manage a single pointer. This can be simplified with > devm_add_action_or_reset() which works the same. Simplify these functions. > Series looks good. There are a few elements that are a bit strange (from a habit perspective). For the devm_add_action_or_reset() callback usually there's a cast being done. But that's a preference I don't feel too strongly about. > Yicong Yang (7): > iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register > iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free > iio: hw_consumer: simplify devm_iio_hw_consumer_alloc > iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext > iio: core: simplify some devm functions > iio: trigger: simplify __devm_iio_trigger_register > iio: inkern: simplify some devm functions > > drivers/iio/adc/adi-axi-adc.c | 22 ++++---- > drivers/iio/buffer/industrialio-buffer-dmaengine.c | 22 ++++---- > drivers/iio/buffer/industrialio-hw-consumer.c | 25 ++++----- > drivers/iio/buffer/industrialio-triggered-buffer.c | 19 ++----- > drivers/iio/industrialio-core.c | 43 ++++++--------- > drivers/iio/industrialio-trigger.c | 18 ++----- > drivers/iio/inkern.c | 61 ++++++++-------------- > 7 files changed, 78 insertions(+), 132 deletions(-) > > -- > 2.8.1 >
On 4/8/21 1:38 PM, Yicong Yang wrote: > Some devm variants are implemented with devres_alloc() and devres_add() > manually to only manage a single pointer. This can be simplified with > devm_add_action_or_reset() which works the same. Simplify these functions. > Whole series looks good to me, thanks. Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
> -----Original Message----- > From: Yicong Yang <yangyicong@hisilicon.com> > Sent: Thursday, April 8, 2021 1:38 PM > To: jic23@kernel.org; linux-iio@vger.kernel.org > Cc: lars@metafoo.de; Hennerich, Michael > <Michael.Hennerich@analog.com>; pmeerw@pmeerw.net; > prime.zeng@huawei.com; tiantao6@hisilicon.com; > yangyicong@hisilicon.com > Subject: [PATCH 0/7] Simplify codes with devm_add_action_or_reset > > > Some devm variants are implemented with devres_alloc() and > devres_add() > manually to only manage a single pointer. This can be simplified with > devm_add_action_or_reset() which works the same. Simplify these > functions. > LGTM, Reviewed-by: Nuno Sa <nuno.sa@analog.com> Nuno Sá
On Thu, Apr 8, 2021 at 2:41 PM Yicong Yang <yangyicong@hisilicon.com> wrote: > > Some devm variants are implemented with devres_alloc() and devres_add() > manually to only manage a single pointer. This can be simplified with > devm_add_action_or_reset() which works the same. Simplify these functions. Thanks, I saw similar patches you have done for other subsystems, this also LGTM! Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Yicong Yang (7): > iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register > iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free > iio: hw_consumer: simplify devm_iio_hw_consumer_alloc > iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext > iio: core: simplify some devm functions > iio: trigger: simplify __devm_iio_trigger_register > iio: inkern: simplify some devm functions > > drivers/iio/adc/adi-axi-adc.c | 22 ++++---- > drivers/iio/buffer/industrialio-buffer-dmaengine.c | 22 ++++---- > drivers/iio/buffer/industrialio-hw-consumer.c | 25 ++++----- > drivers/iio/buffer/industrialio-triggered-buffer.c | 19 ++----- > drivers/iio/industrialio-core.c | 43 ++++++--------- > drivers/iio/industrialio-trigger.c | 18 ++----- > drivers/iio/inkern.c | 61 ++++++++-------------- > 7 files changed, 78 insertions(+), 132 deletions(-) > > -- > 2.8.1 >
On Thu, 8 Apr 2021 19:38:09 +0800 Yicong Yang <yangyicong@hisilicon.com> wrote: > Some devm variants are implemented with devres_alloc() and devres_add() > manually to only manage a single pointer. This can be simplified with > devm_add_action_or_reset() which works the same. Simplify these functions. > > Yicong Yang (7): > iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register > iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free > iio: hw_consumer: simplify devm_iio_hw_consumer_alloc > iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext > iio: core: simplify some devm functions > iio: trigger: simplify __devm_iio_trigger_register > iio: inkern: simplify some devm functions Nice set. Note no rush for a v2 as IIO is effectively closed for the coming merge window. Hence these won't hit linux-next now until after the merge window closes. Thanks, Jonathan > > drivers/iio/adc/adi-axi-adc.c | 22 ++++---- > drivers/iio/buffer/industrialio-buffer-dmaengine.c | 22 ++++---- > drivers/iio/buffer/industrialio-hw-consumer.c | 25 ++++----- > drivers/iio/buffer/industrialio-triggered-buffer.c | 19 ++----- > drivers/iio/industrialio-core.c | 43 ++++++--------- > drivers/iio/industrialio-trigger.c | 18 ++----- > drivers/iio/inkern.c | 61 ++++++++-------------- > 7 files changed, 78 insertions(+), 132 deletions(-) >
On Sun, 11 Apr 2021 15:21:20 +0100 Jonathan Cameron <jic23@kernel.org> wrote: > On Thu, 8 Apr 2021 19:38:09 +0800 > Yicong Yang <yangyicong@hisilicon.com> wrote: > > > Some devm variants are implemented with devres_alloc() and devres_add() > > manually to only manage a single pointer. This can be simplified with > > devm_add_action_or_reset() which works the same. Simplify these functions. > > > > Yicong Yang (7): > > iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register > > iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free > > iio: hw_consumer: simplify devm_iio_hw_consumer_alloc > > iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext > > iio: core: simplify some devm functions > > iio: trigger: simplify __devm_iio_trigger_register > > iio: inkern: simplify some devm functions > > Nice set. Note no rush for a v2 as IIO is effectively closed for the > coming merge window. Hence these won't hit linux-next now until after > the merge window closes. On second thoughts was just easier for me to make the minor tweaks and apply so I did that. All applied to the togreg branch of iio.git and pushed out as testing for autobuilders etc to poke at. Thanks, Jonathan > > Thanks, > > Jonathan > > > > > drivers/iio/adc/adi-axi-adc.c | 22 ++++---- > > drivers/iio/buffer/industrialio-buffer-dmaengine.c | 22 ++++---- > > drivers/iio/buffer/industrialio-hw-consumer.c | 25 ++++----- > > drivers/iio/buffer/industrialio-triggered-buffer.c | 19 ++----- > > drivers/iio/industrialio-core.c | 43 ++++++--------- > > drivers/iio/industrialio-trigger.c | 18 ++----- > > drivers/iio/inkern.c | 61 ++++++++-------------- > > 7 files changed, 78 insertions(+), 132 deletions(-) > > >
On 2021/4/24 22:15, Jonathan Cameron wrote: > On Sun, 11 Apr 2021 15:21:20 +0100 > Jonathan Cameron <jic23@kernel.org> wrote: > >> On Thu, 8 Apr 2021 19:38:09 +0800 >> Yicong Yang <yangyicong@hisilicon.com> wrote: >> >>> Some devm variants are implemented with devres_alloc() and devres_add() >>> manually to only manage a single pointer. This can be simplified with >>> devm_add_action_or_reset() which works the same. Simplify these functions. >>> >>> Yicong Yang (7): >>> iio: adc: adi-axi-adc: simplify devm_adi_axi_adc_conv_register >>> iio: buffer-dmaengine: simplify __devm_iio_dmaengine_buffer_free >>> iio: hw_consumer: simplify devm_iio_hw_consumer_alloc >>> iio: triggered-buffer: simplify devm_iio_triggered_buffer_setup_ext >>> iio: core: simplify some devm functions >>> iio: trigger: simplify __devm_iio_trigger_register >>> iio: inkern: simplify some devm functions >> >> Nice set. Note no rush for a v2 as IIO is effectively closed for the >> coming merge window. Hence these won't hit linux-next now until after >> the merge window closes. > > On second thoughts was just easier for me to make the minor tweaks and > apply so I did that. > > All applied to the togreg branch of iio.git and pushed out as testing > for autobuilders etc to poke at. > Thanks a lot! Sorry for didn't update, I have intended to send a v2 series after the tree reopened. :) Regards, Yicong > Thanks, > > Jonathan > >> >> Thanks, >> >> Jonathan >> >>> >>> drivers/iio/adc/adi-axi-adc.c | 22 ++++---- >>> drivers/iio/buffer/industrialio-buffer-dmaengine.c | 22 ++++---- >>> drivers/iio/buffer/industrialio-hw-consumer.c | 25 ++++----- >>> drivers/iio/buffer/industrialio-triggered-buffer.c | 19 ++----- >>> drivers/iio/industrialio-core.c | 43 ++++++--------- >>> drivers/iio/industrialio-trigger.c | 18 ++----- >>> drivers/iio/inkern.c | 61 ++++++++-------------- >>> 7 files changed, 78 insertions(+), 132 deletions(-) >>> >> > > > . >