Re: [PATCH -next] media: tegra: Make tegra210_video_formats static

2020-05-12 Thread Thierry Reding
On Mon, May 11, 2020 at 07:20:15PM +0800, Samuel Zou wrote: > Fix the following sparse warning: > > drivers/staging/media/tegra-video/tegra210.c:589:33: warning: symbol > 'tegra210_video_formats' was not declared. > > The tegra210_video_formats has only call site within tegra210.c > It should be

[PATCH v2 15/17] staging: wfx: fix endianness of the field 'num_tx_confs'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The field 'num_tx_confs' from the struct hif_cnf_multi_transmit is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/hif_rx.c:82:9: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:87:29: warning:

[PATCH v2 13/17] staging: wfx: fix access to le32 attribute 'len'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller Sparse complains about the accesses to the field 'len' from struct hif_msg: drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:88:32: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:9

[PATCH v2 11/17] staging: wfx: declare the field 'packet_id' with native byte order

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The field packet_id is not interpreted by the device. It is only used as identifier for the device answer. So it is not necessary to declare it little endian. It fixes some warnings raised by Sparse without complexifying the code. Signed-off-by: Jérôme Pouiller --- driver

[PATCH v2 10/17] staging: wfx: fix access to le32 attribute 'indication_type'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The attribute indication_type is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/

[PATCH v2 00/17] staging: wfx: fix support for big-endian hosts

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller Hello, As already discussed here[1], this series improves support for big endian hosts. All warnings raised by sparse are now fixed. Note, this series aims to be applied on top of PR named "staging: wfx: fix Out-Of-Band IRQ" [1] https://lore.kernel.org/lkml/201920285

[PATCH v2 17/17] staging: wfx: update TODO

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller Update the TODO list associated to the wfx driver with the last progresses. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/TODO | 19 --- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO index fca333

[PATCH v2 05/17] staging: wfx: fix output of rx_stats on big endian hosts

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_rx_stats contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/driver

[PATCH v2 01/17] staging: wfx: fix use of cpu_to_le32 instead of le32_to_cpu

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller Sparse detected that le32_to_cpu should be used instead of cpu_to_le32. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hwio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c index d878cb3e

[PATCH v2 02/17] staging: wfx: take advantage of le32_to_cpup()

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller le32_to_cpu(*x) can be advantageously converted in le32_to_cpup(x). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index ac4ec4

[PATCH v2 04/17] staging: wfx: fix wrong bytes order

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The field wakeup_period_max from struct hif_mib_beacon_wake_up_period is a u8. So, assigning it a __le16 produces a nasty bug on big-endian architectures. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH v2 12/17] staging: wfx: fix endianness of the struct hif_ind_startup

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_ind_startup is received from the hardware. So it is declared as little endian. However, it is also stored in the main driver structure and used on different places in the driver. Sparse complains about that: drivers/staging/wfx/data_tx.c:388:43: warning:

[PATCH v2 16/17] staging: wfx: fix endianness of the field 'channel_number'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The field 'channel_number' from the structs hif_ind_rx and hif_req_start is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:95:55: warning: incorrect type in argument 1 (different base types) drivers/staging/wfx

[PATCH v2 03/17] staging: wfx: fix cast operator

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller Sparse detects that le16_to_cpup() expects a __le16 * as argument. Change the cast operator to be compliant with sparse. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/traces.h | 2 +- 2 files changed, 2 insertions(+), 2 delet

[PATCH v2 14/17] staging: wfx: fix endianness of the field 'status'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The field 'status' appears in most of structs returned by the hardware. This field is encoded as little endian. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:53:16: warning: restricted __le32 degrades to integer drivers

[PATCH v2 08/17] staging: wfx: fix access to le32 attribute 'ps_mode_error'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The attribute ps_mode_error is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/dri

[PATCH v2 09/17] staging: wfx: fix access to le32 attribute 'event_id'

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The attribute event_id is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/st

[PATCH v2 06/17] staging: wfx: fix endianness of fields media_delay and tx_queue_delay

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The struct hif_cnf_tx contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong access to fields media_delay and tx_queue_delay. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3

[PATCH v2 07/17] staging: wfx: fix endianness of hif_req_read_mib fields

2020-05-12 Thread Jerome Pouiller
From: Jérôme Pouiller The structs hif_{req,cnf}_read_mib contain only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong accesses to fields mib_id and length. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 1

Re: [PATCH RFC] drivers: most: add USB adapter driver

2020-05-12 Thread Christian.Gromm
On Mon, 2020-05-11 at 18:33 +0200, Greg KH wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > On Mon, May 11, 2020 at 02:46:58PM +, > christian.gr...@microchip.com wrote: > > On Mon, 2020-05-11 at 13:47 +0200, Greg KH wrote: > > > EXTERNA

Re: [PATCH 13/17] staging: wfx: fix endianness of the field 'len'

2020-05-12 Thread Jérôme Pouiller
On Tuesday 12 May 2020 09:43:34 CEST Geert Uytterhoeven wrote: > Hi Jerome, > > On Mon, May 11, 2020 at 5:53 PM Jerome Pouiller > wrote: > > From: Jérôme Pouiller > > > > The struct hif_msg is received from the hardware. So, it declared as > > little endian. However, it is also accessed from man

Re: [PATCH] staging: wfx: unlock on error path

2020-05-12 Thread Jérôme Pouiller
On Tuesday 12 May 2020 10:36:56 CEST Dan Carpenter wrote: > > We need to release the tx_lock on the error path before returning. > > Fixes: d1c015b4ef6f ("staging: wfx: rewrite wfx_hw_scan()") > Signed-off-by: Dan Carpenter > --- > From static analysis. Not tested. > > drivers/staging/wfx/sca

[PATCH v4 33/38] staging: tegra-vde: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function returns the number of the created entries in the DMA address space. However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and dma_unmap_sg must be called with the original number of the entries passed to the dma_

[PATCH v4 31/38] staging: ion: remove dead code

2020-05-12 Thread Marek Szyprowski
ion_heap_pages_zero() function is not used at all, so remove it to simplify the ion_heap_sglist_zero() function later. Signed-off-by: Marek Szyprowski --- For more information, see '[PATCH v4 00/38] DRM: fix struct sg_table nents vs. orig_nents misuse' thread: https://lore.kernel.org/dri-devel/20

[PATCH v4 32/38] staging: ion: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function returns the number of the created entries in the DMA address space. However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and dma_unmap_sg must be called with the original number of the entries passed to the dma_

[PATCH] staging: wfx: unlock on error path

2020-05-12 Thread Dan Carpenter
We need to release the tx_lock on the error path before returning. Fixes: d1c015b4ef6f ("staging: wfx: rewrite wfx_hw_scan()") Signed-off-by: Dan Carpenter --- >From static analysis. Not tested. drivers/staging/wfx/scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/d

Re: [PATCH RFC] drivers: most: add USB adapter driver

2020-05-12 Thread Greg KH
On Mon, May 11, 2020 at 02:46:58PM +, christian.gr...@microchip.com wrote: > On Mon, 2020-05-11 at 13:47 +0200, Greg KH wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you > > know the content is safe > > > > On Mon, May 11, 2020 at 11:51:15AM +0200, Christian Gromm wr

Re: [PATCH 13/17] staging: wfx: fix endianness of the field 'len'

2020-05-12 Thread Geert Uytterhoeven
Hi Jerome, On Mon, May 11, 2020 at 5:53 PM Jerome Pouiller wrote: > From: Jérôme Pouiller > > The struct hif_msg is received from the hardware. So, it declared as > little endian. However, it is also accessed from many places in the > driver. Sparse complains about that: > > drivers/staging/