[PATCH v2] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Christophe JAILLET
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET Reviewed

Re: [PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Christophe JAILLET
Le 14/04/2024 à 10:35, Michael S. Tsirkin a écrit : On Mon, Jan 15, 2024 at 09:35:50PM +0100, Christophe JAILLET wrote: ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive

Re: [PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Christophe JAILLET
Le 16/01/2024 à 15:57, Simon Horman a écrit : On Mon, Jan 15, 2024 at 09:35:50PM +0100, Christophe JAILLET wrote: ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, buInputt

[PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-01-15 Thread Christophe JAILLET
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, buInputt the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET

[PATCH] rpmsg: Remove usage of the deprecated ida_simple_xx() API

2024-01-14 Thread Christophe JAILLET
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET --- drivers

Re: [PATCH v5] can: virtio: Initial virtio CAN driver.

2024-01-08 Thread Christophe JAILLET
Le 08/01/2024 à 14:10, Mikhail Golubev-Ciuchea a écrit : From: Harald Mommer - CAN Control - "ip link set up can0" starts the virtual CAN controller, - "ip link set up can0" stops the virtual CAN controller - CAN RX Receive CAN frames. CAN frames can be standard or extended,

[PATCH] vdpa: Remove usage of the deprecated ida_simple_xx() API

2023-12-10 Thread Christophe JAILLET
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Signed-off-by: Christophe JAILLET --- drivers/vdpa/vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa

[PATCH] nvdimm: Remove usage of the deprecated ida_simple_xx() API

2023-12-10 Thread Christophe JAILLET
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). This is less verbose. Signed-off-by: Christophe JAILLET --- drivers/nvdimm/btt_devs.c | 6 +++--- drivers/nvdimm/bus.c| 4 ++-- drivers/nvdimm/dax_devs.c | 4

Re: [PATCH] vdpa: Fix an error handling path in eni_vdpa_probe()

2023-12-07 Thread Christophe JAILLET
Le 20/10/2022 à 21:21, Christophe JAILLET a écrit : After a successful vp_legacy_probe() call, vp_legacy_remove() should be called in the error handling path, as already done in the remove function. Add the missing call. Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI&quo

Re: [PATCH v3] seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_str()

2023-11-01 Thread Christophe JAILLET
Le 27/10/2023 à 17:56, Kees Cook a écrit : Solve two ergonomic issues with struct seq_buf; 1) Too much boilerplate is required to initialize: struct seq_buf s; char buf[32]; seq_buf_init(s, buf, sizeof(buf)); Instead, we can build this directly on the stack. Provide

[PATCH] tracing/histograms: Simplify last_cmd_set()

2023-10-21 Thread Christophe JAILLET
Turn a kzalloc()+strcpy()+strncat() into an equivalent and less verbose kasprintf(). Signed-off-by: Christophe JAILLET --- kernel/trace/trace_events_hist.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace

Re: [PATCH v5 2/2] leds: add ktd202x driver

2023-10-01 Thread Christophe JAILLET
Le 01/10/2023 à 18:56, André Apitzsch a écrit : Hi Christophe, Am Sonntag, dem 01.10.2023 um 17:15 +0200 schrieb Christophe JAILLET: Le 01/10/2023 à 15:52, André Apitzsch a écrit : This commit adds support for Kinetic KTD2026/7 RGB/White LED driver. Signed-off-by: André Apitzsch

Re: [PATCH v5 2/2] leds: add ktd202x driver

2023-10-01 Thread Christophe JAILLET
Le 01/10/2023 à 15:52, André Apitzsch a écrit : This commit adds support for Kinetic KTD2026/7 RGB/White LED driver. Signed-off-by: André Apitzsch ... +static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct device_node *np, +struct ktd202x_led *led,

[PATCH v3] nvdimm: Use kstrtobool() instead of strtobool()

2023-07-12 Thread Christophe JAILLET
-by: Christophe JAILLET --- This patch was already sent as a part of a serie ([1]) that axed all usages of strtobool(). Most of the patches have been merged in -next. I synch'ed with latest -next and re-send the remaining ones as individual patches. Even if R-b and told that it was applied for v6.3

Re: RE: [PATCH v2] nvdimm: Use kstrtobool() instead of strtobool()

2023-05-04 Thread Christophe JAILLET
Le 25/01/2023 à 20:11, Dan Williams a écrit : Christophe JAILLET wrote: strtobool() is the same as kstrtobool(). However, the latter is more used within the kernel. In order to remove strtobool() and slightly simplify kstrtox.h, switch to the other function name. While at it, include

[PATCH v2] nvdimm: Use kstrtobool() instead of strtobool()

2023-01-14 Thread Christophe JAILLET
strtobool() is the same as kstrtobool(). However, the latter is more used within the kernel. In order to remove strtobool() and slightly simplify kstrtox.h, switch to the other function name. While at it, include the corresponding header file () Signed-off-by: Christophe JAILLET --- This patch

Re: [PATCH] libnvdimm: Add check for nd_dax_alloc

2022-11-22 Thread Christophe JAILLET
Le 22/11/2022 à 03:33, Jiasheng Jiang a écrit : As the nd_dax_alloc may return NULL pointer, it should be better to add check for the return value, as same as the one in nd_dax_create(). Fixes: c5ed9268643c ("libnvdimm, dax: autodetect support") Signed-off-by: Jiasheng Jiang ---

[PATCH 05/30] nvdimm: Use kstrtobool() instead of strtobool()

2022-11-01 Thread Christophe JAILLET
strtobool() is the same as kstrtobool(). However, the latter is more used within the kernel. In order to remove strtobool() and slightly simplify kstrtox.h, switch to the other function name. While at it, include the corresponding header file () Signed-off-by: Christophe JAILLET --- This patch

Re: [PATCH] nvdimm: Avoid wasting some memory.

2022-09-04 Thread Christophe JAILLET
Le 04/09/2022 à 16:38, Dan Williams a écrit : Christophe JAILLET wrote: sizeof(struct btt_sb) is 4096. When using devm_kzalloc(), there is a small memory overhead and, on most systems, this leads to 40 bytes of extra memory allocation. So 5036 bytes are expected to be allocated. The memory

[PATCH] nvdimm: Avoid wasting some memory.

2022-09-04 Thread Christophe JAILLET
, it will require 8192 bytes of memory because more than 4096 bytes are required. In order to avoid wasting 4ko of memory, just use kzalloc() and add a devm action to free it when needed. Signed-off-by: Christophe JAILLET --- drivers/nvdimm/btt_devs.c | 17 - 1 file changed, 16 insertions(+), 1

Re: [PATCH] nvdimm/pmem: Fix an error handling path in 'pmem_attach_disk()'

2021-11-07 Thread Marion & Christophe JAILLET
Le 07/11/2021 à 18:25, Marion & Christophe JAILLET a écrit : Le 07/11/2021 à 18:20, Christophe JAILLET a écrit : Le 07/11/2021 à 18:11, Ira Weiny a écrit : On Sat, Nov 06, 2021 at 06:27:11PM +0100, Christophe JAILLET wrote: If 'devm_init_badblocks()' fails, a previous 'blk_alloc_

Re: [PATCH] nvdimm/pmem: Fix an error handling path in 'pmem_attach_disk()'

2021-11-07 Thread Marion & Christophe JAILLET
Le 07/11/2021 à 18:20, Christophe JAILLET a écrit : Le 07/11/2021 à 18:11, Ira Weiny a écrit : On Sat, Nov 06, 2021 at 06:27:11PM +0100, Christophe JAILLET wrote: If 'devm_init_badblocks()' fails, a previous 'blk_alloc_disk()' call must be undone. I think this is a problem... Signed

Re: [PATCH] nvdimm/pmem: Fix an error handling path in 'pmem_attach_disk()'

2021-11-07 Thread Christophe JAILLET
Le 07/11/2021 à 18:11, Ira Weiny a écrit : On Sat, Nov 06, 2021 at 06:27:11PM +0100, Christophe JAILLET wrote: If 'devm_init_badblocks()' fails, a previous 'blk_alloc_disk()' call must be undone. I think this is a problem... Signed-off-by: Christophe JAILLET --- This patch is speculative

[PATCH] nvdimm/pmem: Fix an error handling path in 'pmem_attach_disk()'

2021-11-06 Thread Christophe JAILLET
If 'devm_init_badblocks()' fails, a previous 'blk_alloc_disk()' call must be undone. Signed-off-by: Christophe JAILLET --- This patch is speculative. Several fixes on error handling paths have been done recently, but this one has been left as-is. There was maybe a good reason that I have missed

[PATCH] nvmem: core: add a missing of_node_put

2021-04-20 Thread Christophe JAILLET
'for_each_child_of_node' performs an of_node_get on each iteration, so a return from the middle of the loop requires an of_node_put. Fixes: e888d445ac33 ("nvmem: resolve cells from DT at registration time") Signed-off-by: Christophe JAILLET --- drivers/nvmem/core.c | 6 +- 1 file

[PATCH] spi: fsi: add a missing of_node_put

2021-04-20 Thread Christophe JAILLET
'for_each_available_child_of_node' performs an of_node_get on each iteration, so a return from the middle of the loop requires an of_node_put. Fixes: bbb6b2f9865b ("spi: Add FSI-attached SPI controller driver") Signed-off-by: Christophe JAILLET --- drivers/spi/spi-fsi.c | 4 +++- 1 fi

[PATCH] regulator: Avoid a double 'of_node_get' in 'regulator_of_get_init_node()'

2021-04-20 Thread Christophe JAILLET
node") Signed-off-by: Christophe JAILLET --- Untested, speculative patch --- drivers/regulator/of_regulator.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 564f928eb1db..49f6c05fee34 100644 ---

[PATCH] scsi: bfa: Remove some unused variables

2021-04-20 Thread Christophe JAILLET
'lp' is unused. It is just declared and memset'ed. It can be removed. Signed-off-by: Christophe JAILLET --- drivers/scsi/bfa/bfa_svc.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index 11c0c3e6f014..5387883d6604 100644

[PATCH] RDMA/mlx4: remove an unused variable

2021-04-20 Thread Christophe JAILLET
'in6' is unused. It is just declared and filled-in. It can be removed. This is a left over from commit 5ea8bbfc4929 ("mlx4: Implement IP based gids support for RoCE/SRIOV") Signed-off-by: Christophe JAILLET --- drivers/infiniband/hw/mlx4/qp.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH resend] xhci: Do not use GFP_KERNEL in (potentially) atomic context

2021-04-20 Thread Christophe JAILLET
alled from 'xhci_urb_enqueue()', uses GFP_KERNEL. Be safe and pass the mem_flags to this function as well. Fixes: ddba5cd0aeff ("xhci: Use command structures when queuing commands on the command ring") Signed-off-by: Christophe JAILLET --- I'm not 100% sure of the Fixes tag. Th

[PATCH] staging: octeon: Use 'for_each_child_of_node'

2021-04-20 Thread Christophe JAILLET
Use 'for_each_child_of_node' instead of hand writing it. This saves a few line of code. Signed-off-by: Christophe JAILLET --- drivers/staging/octeon/ethernet.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging

[PATCH] brcmfmac: Avoid GFP_ATOMIC when GFP_KERNEL is enough

2021-04-19 Thread Christophe JAILLET
A workqueue is not atomic, so constraints can be relaxed here. GFP_KERNEL can be used instead of GFP_ATOMIC. Signed-off-by: Christophe JAILLET --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless

Re: [PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier

2021-04-19 Thread Marion et Christophe JAILLET
  > Message du 19/04/21 01:03 > De : "Bart Van Assche" > A : "Christophe JAILLET" , t...@kernel.org, jiangshan...@gmail.com, > sae...@nvidia.com, l...@kernel.org, da...@davemloft.net, k...@kernel.org, > "Tejun Heo" > Copie à : net...@vger.

Re: [PATCH] net/mlx5: Use kasprintf instead of hand-writing it

2021-04-18 Thread Christophe JAILLET
Le 18/04/2021 à 22:03, Bart Van Assche a écrit : On 4/17/21 12:16 AM, Christophe JAILLET wrote: 'kasprintf()' can replace a kmalloc/strcpy/strcat sequence. It is less verbose and avoid the use of a magic number (64). Anyway, the underlying 'alloc_workqueue()' would only keep the 24 first chars

[PATCH 2/2] net/mlx5: Simplify workqueue name creation

2021-04-18 Thread Christophe JAILLET
There is no need to explicitly allocate, populate and free some memory just to pass a workqueue name to 'create_singlethread_workqueue()'. This macro can do all this for us, so keep the code simple. Signed-off-by: Christophe JAILLET --- A similar patch has also been sent. It was replacing

[PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier

2021-04-18 Thread Christophe JAILLET
. This will also allow further code simplification. Suggested-by: Bart Van Assche Signed-off-by: Christophe JAILLET --- include/linux/workqueue.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index d15a7730ee18

[PATCH 0/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier

2021-04-18 Thread Christophe JAILLET
. This will also allow further code simplification. Patch 1 is the modification of the macro. Patch 2 is an example of simplification possible with this patch Christophe JAILLET (2): workqueue: Have 'alloc_workqueue()' like macros accept a format specifier net/mlx5: Simplify workqueue name creation

[PATCH] net/mlx5: Use kasprintf instead of hand-writing it

2021-04-17 Thread Christophe JAILLET
'kasprintf()' can replace a kmalloc/strcpy/strcat sequence. It is less verbose and avoid the use of a magic number (64). Anyway, the underlying 'alloc_workqueue()' would only keep the 24 first chars (i.e. sizeof(struct workqueue_struct->name) = WQ_NAME_LEN). Signed-off-by: Christophe JAIL

Re: [PATCH] checkpatch: Improve ALLOC_ARRAY_ARGS test

2021-04-16 Thread Christophe JAILLET
Le 16/04/2021 à 19:03, Joe Perches a écrit : On Fri, 2021-04-16 at 18:51 +0200, Christophe JAILLET wrote: Le 16/04/2021 à 18:11, Joe Perches a écrit : On Fri, 2021-04-16 at 17:58 +0200, Christophe JAILLET wrote: The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested Add

[PATCH v2] checkpatch: Improve ALLOC_ARRAY_ARGS test

2021-04-16 Thread Christophe JAILLET
The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested Add the corresponding check. Signed-off-by: Christophe JAILLET --- v2: use a cleaner regex as proposed by Joe Perches --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts

Re: [PATCH] checkpatch: Improve ALLOC_ARRAY_ARGS test

2021-04-16 Thread Christophe JAILLET
Le 16/04/2021 à 18:11, Joe Perches a écrit : On Fri, 2021-04-16 at 17:58 +0200, Christophe JAILLET wrote: The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested Add the corresponding check. [] diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] @@ -7006,9 +7006,9

[PATCH] checkpatch: Improve ALLOC_ARRAY_ARGS test

2021-04-16 Thread Christophe JAILLET
The devm_ variant of 'kcalloc()' and 'kmalloc_array()' are not tested Add the corresponding check. Signed-off-by: Christophe JAILLET --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 44b9dc330ac6

[PATCH 2/2] Input: evbug - Use 'pr_debug()' instead of hand-writing it

2021-04-15 Thread Christophe JAILLET
'printk(KERN_DEBUG pr_fmt(...))' can be replaced by a much less verbose 'pr_debug()'. Signed-off-by: Christophe JAILLET --- drivers/input/evbug.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/input/evbug.c b/drivers/input/evbug.c index e47bdf92088a

[PATCH 1/2] Input: evbug - Remove an empty comment block

2021-04-15 Thread Christophe JAILLET
This is a left-over from commit 1a59d1b8e05e ("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156") Axe an empty and useless comment block. Signed-off-by: Christophe JAILLET --- drivers/input/evbug.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/input

Re: [PATCH] ASoC: cs35l35: Fix an error handling path in 'cs35l35_i2c_probe()'

2021-04-13 Thread Christophe JAILLET
Le 13/04/2021 à 14:43, Mark Brown a écrit : On Sun, Apr 11, 2021 at 02:51:06PM +0200, Christophe JAILLET wrote: If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should return directly as already done by the surrounding error handling paths. These are stylistic improvements

Re: [PATCH 2/3] staging: rtl8723bs: Use existing arc4 implementation

2021-04-12 Thread Christophe JAILLET
Le 12/04/2021 à 11:34, Greg KH a écrit : On Sat, Apr 10, 2021 at 03:35:52PM +0200, Christophe JAILLET wrote: Use functions provided by instead of hand writing them. The implementations are slightly different, but are equivalent. It has been checked with a test program which compares

[PATCH] ASoC: cs35l36: Fix an error handling path in 'cs35l36_i2c_probe()'

2021-04-11 Thread Christophe JAILLET
If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should return directly as already done by the surrounding error handling paths. Signed-off-by: Christophe JAILLET --- sound/soc/codecs/cs35l36.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc

[PATCH] ASoC: cs35l35: Fix an error handling path in 'cs35l35_i2c_probe()'

2021-04-11 Thread Christophe JAILLET
If 'devm_regmap_init_i2c()' fails, there is no need to goto err. We should return directly as already done by the surrounding error handling paths. Signed-off-by: Christophe JAILLET --- sound/soc/codecs/cs35l35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc

[PATCH] tracing/dynevent: Fix a memory leak in an error handling path

2021-04-11 Thread Christophe JAILLET
We must free 'argv' before returning, as already done in all the other paths of this function. Fixes: d262271d0483 ("tracing/dynevent: Delegate parsing to create function") Signed-off-by: Christophe JAILLET --- kernel/trace/trace_dynevent.c | 6 -- 1 file changed, 4 insert

[PATCH] scsi: qla2xxx: Re-use existing error handling path

2021-04-11 Thread Christophe JAILLET
There is no need to duplicate some code, use the existing error handling path to free some resources. This is more future-proof. Signed-off-by: Christophe JAILLET --- The code above this hunk looks spurious to me. It looks like an error handling path (i.e. "if (response_len >

[PATCH] net: davicom: Fix regulator not turned off on failed probe

2021-04-11 Thread Christophe JAILLET
dm9000") Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/davicom/dm9000.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 252adfa5d837..8a9096aa85cd 100644 --- a/drivers/

[PATCH 2/2] leds: lgm: Fix an error handling path in '__sso_led_dt_parse()'

2021-04-11 Thread Christophe JAILLET
If a memory allocation fails, we must free the already allocated resources before returning. Fixes: c3987cd2bca3 ("leds: lgm: Add LED controller driver for LGM SoC") Signed-off-by: Christophe JAILLET --- drivers/leds/blink/leds-lgm-sso.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH 1/2] leds: lgm: Propagate error codes to the caller

2021-04-11 Thread Christophe JAILLET
Do not always return -EINVAL in case of error in '__sso_led_dt_parse()'. Propagate the error code instead. Signed-off-by: Christophe JAILLET --- drivers/leds/blink/leds-lgm-sso.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/leds/blink/leds-lgm-sso.c b

[PATCH] iommu/vt-d: Fix an error handling path in 'intel_prepare_irq_remapping()'

2021-04-11 Thread Christophe JAILLET
If 'intel_cap_audit()' fails, we should return directly, as already done in the surrounding error handling path. Fixes: ad3d19029979 ("iommu/vt-d: Audit IOMMU Capabilities and add helper functions") Signed-off-by: Christophe JAILLET --- This patch is completely speculative. I

[PATCH] crypto: crc32-generic - Use SPDX-License-Identifier

2021-04-10 Thread Christophe JAILLET
Use SPDX-License-Identifier: GPL-2.0-only, instead of hand writing it. This also removes a reference to http://www.xyratex.com which seems to be down. Signed-off-by: Christophe JAILLET --- crypto/crc32_generic.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions

[PATCH 2/3] staging: rtl8723bs: Use existing arc4 implementation

2021-04-10 Thread Christophe JAILLET
Use functions provided by instead of hand writing them. The implementations are slightly different, but are equivalent. It has been checked with a test program which compares the output of the 2 sets of functions. Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8723bs/core

[PATCH 3/3] staging: rtl8712: Use existing arc4 implementation

2021-04-10 Thread Christophe JAILLET
Use functions provided by instead of hand writing them. The implementations are slightly different, but are equivalent. It has been checked with a test program which compares the output of the 2 sets of functions. Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8712

[PATCH 1/3] staging: rtl8188eu: Use existing arc4 implementation

2021-04-10 Thread Christophe JAILLET
Use functions provided by instead of hand writing them. The implementations are slightly different, but are equivalent. It has been checked with a test program which compares the output of the 2 sets of functions. Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8188eu/core

[PATCH 3/3] staging: rtl8712: remove (most of) enum WIFI_FRAME_TYPE

2021-04-08 Thread Christophe JAILLET
The values defined in enum WIFI_FRAME_TYPE are the same the #define IEEE80211_FTYPE_xxx from Use these values to avoid code duplication. WIFI_QOS_DATA_TYPE is a bit more tricky and doesn't have a direct equivalence in . So leave this one as-is for now. Signed-off-by: Christophe JAILLET

[PATCH 2/3] staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE

2021-04-08 Thread Christophe JAILLET
The values defined in enum WIFI_FRAME_SUBTYPE are the same the #define IEEE80211_STYPE_xxx from Use theses values to avoid code duplication. Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8712/rtl871x_recv.c | 2 +- drivers/staging/rtl8712/rtl871x_security.c | 14

[PATCH 1/3] staging: rtl8712: remove struct rtl_ieee80211_ht_cap and ieee80211_ht_addt_info

2021-04-08 Thread Christophe JAILLET
struct 'ieee80211_ht_addt_info' is unused and can be removed. struct 'rtl_ieee80211_ht_cap' can be replaced by 'ieee80211_ht_cap' defined in which has the same layout. Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8712/rtl871x_ht.h | 2 +- drivers/staging/rtl8712

[PATCH] staging: rtl8712: Use constants from

2021-04-06 Thread Christophe JAILLET
t used) _HT_ADD_INFO_IE_ --> WLAN_EID_HT_OPERATION _VENDOR_SPECIFIC_IE_ --> WLAN_EID_VENDOR_SPECIFIC _RESERVED47_ --> (not used) Signed-off-by: Christophe JAILLET --- drivers/staging/rtl8712/ieee80211.c | 12 ++-- drivers/staging/rtl8712/rtl871x_ioc

[PATCH] rtl8xxxu: Simplify locking of a skb list accesses

2021-04-05 Thread Christophe JAILLET
The 'c2hcmd_lock' spinlock is only used to protect some __skb_queue_tail() and __skb_dequeue() calls. Use the lock provided in the skb itself and call skb_queue_tail() and skb_dequeue(). These functions already include the correct locking. Signed-off-by: Christophe JAILLET --- drivers/net

[PATCH] rtlwifi: Simplify locking of a skb list accesses

2021-04-05 Thread Christophe JAILLET
The 'c2hcmd_lock' spinlock is only used to protect some __skb_queue_tail() and __skb_dequeue() calls. Use the lock provided in the skb itself and call skb_queue_tail() and skb_dequeue(). These functions already include the correct locking. Signed-off-by: Christophe JAILLET --- drivers/net

[PATCH 2/2] qede: Use 'skb_add_rx_frag()' instead of hand coding it

2021-04-04 Thread Christophe JAILLET
Some lines of code can be merged into an equivalent 'skb_add_rx_frag()' call which is less verbose. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/qlogic/qede/qede_fp.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede

[PATCH 1/2] qede: Remove a erroneous ++ in 'qede_rx_build_jumbo()'

2021-04-04 Thread Christophe JAILLET
-increment to avoid confusion. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/qlogic/qede/qede_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_fp.c b/drivers/net/ethernet/qlogic/qede/qede_fp.c index 102d0e0808d5

[PATCH] sfc: Use 'skb_add_rx_frag()' instead of hand coding it

2021-04-04 Thread Christophe JAILLET
Some lines of code can be merged into an equivalent 'skb_add_rx_frag()' call which is less verbose. Signed-off-by: Christophe JAILLET --- UNTESTED. Compile tested only The 'skb->truesize' computation is likely to be slightly slower (n additions hidden in 'skb_add_rx_frag' instead o

[PATCH] ibmvnic: Use 'skb_frag_address()' instead of hand coding it

2021-04-04 Thread Christophe JAILLET
'page_address(skb_frag_page()) + skb_frag_off()' can be replaced by an equivalent 'skb_frag_address()' which is less verbose. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/ibm/ibmvnic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet

[PATCH] net: openvswitch: Use 'skb_push_rcsum()' instead of hand coding it

2021-04-04 Thread Christophe JAILLET
'skb_push()'/'skb_postpush_rcsum()' can be replaced by an equivalent 'skb_push_rcsum()' which is less verbose. Signed-off-by: Christophe JAILLET --- net/openvswitch/conntrack.c| 6 ++ net/openvswitch/vport-netdev.c | 7 +++ 2 files changed, 5 insertions(+), 8 deletions(-) diff

[PATCH] net: ag71xx: Slightly simplify 'ag71xx_rx_packets()'

2021-04-04 Thread Christophe JAILLET
There is no need to use 'list_for_each_entry_safe' here, as nothing is removed from the list in the 'for' loop. Use 'list_for_each_entry' instead, it is slightly less verbose. Signed-off-by: Christophe JAILLET --- drivers/net/ethernet/atheros/ag71xx.c | 4 ++-- 1 file changed, 2 insertions

[PATCH] carl9170: remove get_tid_h

2021-04-02 Thread Christophe JAILLET
'get_tid_h()' is the same as 'ieee80211_get_tid()'. So this function can be removed to save a few lines of code. Signed-off-by: Christophe JAILLET --- drivers/net/wireless/ath/carl9170/carl9170.h | 7 +-- drivers/net/wireless/ath/carl9170/tx.c | 2 +- 2 files changed, 2 insertions

[PATCH] rtlwifi: remove rtl_get_tid_h

2021-04-02 Thread Christophe JAILLET
'rtl_get_tid_h()' is the same as 'ieee80211_get_tid()'. So this function can be removed to save a line of code. Signed-off-by: Christophe JAILLET --- drivers/net/wireless/realtek/rtlwifi/wifi.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/wireless

[PATCH] media: tw68: switch from 'pci_' to 'dma_' API

2021-03-28 Thread Christophe JAILLET
pression e1, e2; @@ -pci_set_dma_mask(e1, e2) +dma_set_mask(>dev, e2) @@ expression e1, e2; @@ -pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(>dev, e2) Signed-off-by: Christophe JAILLET --- If needed, see post from Christoph Hellwig on the kernel-janitors ML: https://marc.

[PATCH] media: tw686x: switch from 'pci_' to 'dma_' API

2021-03-28 Thread Christophe JAILLET
mapping_error(>dev, e2) @@ expression e1, e2; @@ -pci_set_dma_mask(e1, e2) +dma_set_mask(>dev, e2) @@ expression e1, e2; @@ -pci_set_consistent_dma_mask(e1, e2) + dma_set_coherent_mask(>dev, e2) Signed-off-by: Christophe JAILLET --- If needed, see post from Christoph Hellwig on the kerne

[PATCH] media: cx23885: switch from 'pci_' to 'dma_' API

2021-03-28 Thread Christophe JAILLET
et_consistent_dma_mask(e1, e2) +dma_set_coherent_mask(>dev, e2) Signed-off-by: Christophe JAILLET --- If needed, see post from Christoph Hellwig on the kernel-janitors ML: https://marc.info/?l=kernel-janitors=158745678307186=4 --- drivers/media/pci/cx23885/cx23885-alsa.c | 2 +- drivers/me

[PATCH v3 2/2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'

2021-03-27 Thread Christophe JAILLET
Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error handling path of the probe function, as already done in the remove function. Fixes: 3fc154b6b813 ("USB Gadget driver for Samsung s3c2410 ARM SoC") Signed-off-by: Christophe JAILLET Reviewed-by: Krzysztof Kozlows

[PATCH v3 1/2] usb: gadget: s3c: Fix incorrect resources releasing

2021-03-27 Thread Christophe JAILLET
'rsrc_len' global variables. Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources") Signed-off-by: Christophe JAILLET Reviewed-by: Krzysztof Kozlowski --- the 'err' label is used only to reduce the diff size of this patch. It is removed in the following patch. v2: Fix a stup

[PATCH] media: cx25821: switch from 'pci_' to 'dma_' API

2021-03-21 Thread Christophe JAILLET
, e2; @@ -pci_set_consistent_dma_mask(e1, e2) +dma_set_coherent_mask(>dev, e2) Signed-off-by: Christophe JAILLET --- If needed, see post from Christoph Hellwig on the kernel-janitors ML: https://marc.info/?l=kernel-janitors=158745678307186=4 --- drivers/media/pci/cx25821/cx25821-alsa.c | 2 +- drivers/

Re: [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'

2021-03-06 Thread Christophe JAILLET
Le 06/03/2021 à 17:16, Krzysztof Kozlowski a écrit : On 06/03/2021 15:21, Christophe JAILLET wrote: Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error handling path of the probe function, as already done in the remove function. Fixes: 3fc154b6b813 ("USB Gadget d

[PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'

2021-03-06 Thread Christophe JAILLET
Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error handling path of the probe function, as already done in the remove function. Fixes: 3fc154b6b813 ("USB Gadget driver for Samsung s3c2410 ARM SoC") Signed-off-by: Christophe JAILLET --- v2: Fix a stupid error i

[PATCH 1/2 V2] usb: gadget: s3c: Fix incorrect resources releasing

2021-03-06 Thread Christophe JAILLET
'rsrc_len' global variables. Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources") Signed-off-by: Christophe JAILLET --- the 'err' label is used only to reduce the diff size of this patch. It is removed in the following patch. v2: Fix a stupid error in the hash in Fixes: --- dr

Re: [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing

2021-02-23 Thread Christophe JAILLET
Le 22/02/2021 à 07:03, Dan Carpenter a écrit : On Sun, Feb 21, 2021 at 08:41:17AM +0100, Christophe JAILLET wrote: Since commit fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources"), This the wrong hash. It should be 188db4435ac6 from the URL you posted below. regards, dan

[PATCH 2/2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'

2021-02-20 Thread Christophe JAILLET
Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error handling path of the probe function, as already done in the remove function. Fixes: 1c6d47aa4f4b ("USB Gadget driver for Samsung s3c2410 ARM SoC") Signed-off-by: Christophe JAILLET --- checkpatch reports: WARNIN

[PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing

2021-02-20 Thread Christophe JAILLET
'rsrc_len' global variables. Fixes: fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources") Signed-off-by: Christophe JAILLET --- the 'err' label is used only to reduce the diff size of this patch. It is removed in the following patch. checkpatch reports: WARNING: Unknown commit id '

[PATCH 2/2] mmc: uniphier-sd: Fix a resource leak in the remove function

2021-02-20 Thread Christophe JAILLET
er SD/eMMC controller driver") Signed-off-by: Christophe JAILLET --- drivers/mmc/host/uniphier-sd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index 6f0f05466917..ccbf9885a52b 100644 --- a/drivers/mmc/host/uniphier-sd.c +++

[PATCH 1/2] mmc: uniphier-sd: Fix an error handling path in uniphier_sd_probe()

2021-02-20 Thread Christophe JAILLET
river") Signed-off-by: Christophe JAILLET --- drivers/mmc/host/uniphier-sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index 2413b6750cec..6f0f05466917 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/d

[PATCH] scsi: mpt3sas: Do not use GFP_KERNEL in atomic context

2021-02-20 Thread Christophe JAILLET
10260 inside lock on line 10256 but uses GFP_KERNEL Fixes: 324c122fc0a4 ("scsi: mpt3sas: Add module parameter multipath_on_hba") Signed-off-by: Christophe JAILLET --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sc

Re: [PATCH] scsi: pm80xx: switch from 'pci_' to 'dma_' API

2021-02-20 Thread Christophe JAILLET
Please ignore. This one has already been applied, I'va attached the wrong patch. Sorry for the noise. CJ Le 20/02/2021 à 09:31, Christophe JAILLET a écrit : The wrappers in include/linux/pci-dma-compat.h should go away. The patch has been generated with the coccinelle script below and has

[PATCH] scsi: pm80xx: switch from 'pci_' to 'dma_' API

2021-02-20 Thread Christophe JAILLET
2) +dma_set_mask(>dev, e2) @@ expression e1, e2; @@ -pci_set_consistent_dma_mask(e1, e2) +dma_set_coherent_mask(>dev, e2) Signed-off-by: Christophe JAILLET --- If needed, see post from Christoph Hellwig on the kernel-janitors ML: https://marc.info/?l=kernel-janitors=158745678307186=4 --- drivers/

[PATCH resend] media: ngene: switch from 'pci_' to 'dma_' API

2021-01-30 Thread Christophe JAILLET
(e1, e2) +dma_set_coherent_mask(>dev, e2) Signed-off-by: Christophe JAILLET --- If needed, see post from Christoph Hellwig on the kernel-janitors ML: https://marc.info/?l=kernel-janitors=158745678307186=4 --- drivers/media/pci/ngene/ngene-core.c | 56 ++-- 1

[PATCH resend] e100: switch from 'pci_' to 'dma_' API

2021-01-28 Thread Christophe JAILLET
;dev, e2, e3, e4) @@ expression e1, e2; @@ -pci_dma_mapping_error(e1, e2) +dma_mapping_error(>dev, e2) @@ expression e1, e2; @@ -pci_set_dma_mask(e1, e2) +dma_set_mask(>dev, e2) @@ expression e1, e2; @@ -pci_set_consistent_dma_mask(e1, e2) +dma_set_coherent_mask(>dev, e2) Sig

[PATCH v2] media: venus: core: Fix some resource leaks in the error path of 'venus_probe()'

2021-01-28 Thread Christophe JAILLET
t API") Signed-off-by: Christophe JAILLET --- v1->v2: use managed resources instead of expanding the error handling path. --- drivers/media/platform/qcom/venus/core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/

Re: [PATCH] media: venus: core: Fix some resource leaks in the error path of 'venus_probe()'

2021-01-28 Thread Christophe JAILLET
Le 28/01/2021 à 11:49, Georgi Djakov a écrit : Hi Christophe, Thanks for the fix! On 1/27/21 22:17, Christophe JAILLET wrote: If an error occurs after a successful 'of_icc_get()' call, it must be undone by a corresponding 'icc_put()' call. This works, but why not switch to devm_of_icc_get

[PATCH] media: venus: core: Fix some resource leaks in the error path of 'venus_probe()'

2021-01-27 Thread Christophe JAILLET
Signed-off-by: Christophe JAILLET --- drivers/media/platform/qcom/venus/core.c | 31 +--- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 0bde19edac86..8fd5da941067 100644 --- a/dri

[PATCH] ACPICA: Common: Fix a typo

2021-01-24 Thread Christophe JAILLET
This module is 'cmfsize', not 'cfsize'. Fix it. Signed-off-by: Christophe JAILLET --- tools/power/acpi/common/cmfsize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/power/acpi/common/cmfsize.c b/tools/power/acpi/common/cmfsize.c index 9ea2c0aeb86c..185b8c588e1d

[PATCH v2] iwlwifi: mvm: Fix an error handling path in 'iwl_mvm_wowlan_config_key_params()'

2021-01-24 Thread Christophe JAILLET
If the 'cmd_ver' check fails, we must release some memory as already done in all the other error handling paths of this function. Fixes: 9e3c39361a30 ("iwlwifi: mvm: support new KEK KCK api") Signed-off-by: Christophe JAILLET --- v1->v2: Fix the subject --- drivers/net/wireless/

Re: [PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()'

2021-01-24 Thread Christophe JAILLET
Le 24/01/2021 à 08:56, Christophe JAILLET a écrit : If the 'cmd_ver' check fails, we must release some memory as already done in all the other error handling paths of this function. Fixes: 9e3c39361a30 ("iwlwifi: mvm: support new KEK KCK api") Signed-off-by: Christophe JAILLET ---

[PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()'

2021-01-24 Thread Christophe JAILLET
If the 'cmd_ver' check fails, we must release some memory as already done in all the other error handling paths of this function. Fixes: 9e3c39361a30 ("iwlwifi: mvm: support new KEK KCK api") Signed-off-by: Christophe JAILLET --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6

[PATCH] mtd: rawnand: Fix an error handling path in 'ebu_dma_start()'

2021-01-23 Thread Christophe JAILLET
If 'dmaengine_prep_slave_single()' fails, we must undo a previous 'dma_map_single()' call, as already done in all the other error handling paths of this function. Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Christophe JAILLET --

[PATCH] dmaengine: ti: k3-udma: Fix a resource leak in an error handling path

2021-01-23 Thread Christophe JAILLET
In 'dma_pool_create()', we return -ENOMEM, but don't release the resources already allocated, as in all the other error handling paths. Go to 'err_res_free' instead of returning directly. Fixes: 017794739702 ("dmaengine: ti: k3-udma: Initial support for K3 BCDMA") Signed-off-by:

  1   2   3   4   5   6   7   8   9   10   >