Re: [PATCH] vme: Fix wrong pointer utilization in ca91cx42_slave_get
On 10 January 2017 at 10:45, Augusto Mecking Caringi wrote: > In ca91cx42_slave_get function, the value pointed by vme_base pointer is > set through: > > *vme_base = ioread32(bridge->base + CA91CX42_VSI_BS[i]); > > So it must be dereferenced to be used in calculation of pci_base: > > *pci_base = (dma_addr_t)*vme_base + pci_offset; > > This bug was caught thanks to the following gcc warning: > > drivers/vme/bridges/vme_ca91cx42.c: In function ‘ca91cx42_slave_get’: > drivers/vme/bridges/vme_ca91cx42.c:467:14: warning: cast from pointer to > integer of different size [-Wpointer-to-int-cast] > *pci_base = (dma_addr_t)vme_base + pci_offset; > > Signed-off-by: Augusto Mecking Caringi Acked-By: Martyn Welch > --- > drivers/vme/bridges/vme_ca91cx42.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vme/bridges/vme_ca91cx42.c > b/drivers/vme/bridges/vme_ca91cx42.c > index 6b5ee89..7cc5122 100644 > --- a/drivers/vme/bridges/vme_ca91cx42.c > +++ b/drivers/vme/bridges/vme_ca91cx42.c > @@ -464,7 +464,7 @@ static int ca91cx42_slave_get(struct vme_slave_resource > *image, int *enabled, > vme_bound = ioread32(bridge->base + CA91CX42_VSI_BD[i]); > pci_offset = ioread32(bridge->base + CA91CX42_VSI_TO[i]); > > - *pci_base = (dma_addr_t)vme_base + pci_offset; > + *pci_base = (dma_addr_t)*vme_base + pci_offset; > *size = (unsigned long long)((vme_bound - *vme_base) + granularity); > > *enabled = 0; > -- > 2.7.4 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: greybus: loopback_test: fix checkpatch bad function definition error
On Wed, Jan 11, 2017 at 01:29:36AM +, Abdul Rauf wrote: > Fix the following Errors: > Bad function definition - void abort() should probably be void abort(void) > > Signed-off-by: Abdul Rauf Acked-by: Johan Hovold ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] greybus: checkpatch: Change parameter type unsigned to unsigned int
Note that this patch does not fix all checkpatch warnings for the affected files. Signed-off-by: Christian Bewermeyer Signed-off-by: Roman Sommer --- drivers/staging/greybus/gpio.c | 24 drivers/staging/greybus/loopback.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index 250caa0..558550c 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -410,21 +410,21 @@ static int gb_gpio_request_handler(struct gb_operation *op) return 0; } -static int gb_gpio_request(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_request(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); return gb_gpio_activate_operation(ggc, (u8)offset); } -static void gb_gpio_free(struct gpio_chip *chip, unsigned offset) +static void gb_gpio_free(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); gb_gpio_deactivate_operation(ggc, (u8)offset); } -static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); u8 which; @@ -438,22 +438,22 @@ static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned offset) return ggc->lines[which].direction ? 1 : 0; } -static int gb_gpio_direction_input(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); return gb_gpio_direction_in_operation(ggc, (u8)offset); } -static int gb_gpio_direction_output(struct gpio_chip *chip, unsigned offset, - int value) +static int gb_gpio_direction_output(struct gpio_chip *chip, unsigned int offset, + int value) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); return gb_gpio_direction_out_operation(ggc, (u8)offset, !!value); } -static int gb_gpio_get(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_get(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); u8 which; @@ -467,15 +467,15 @@ static int gb_gpio_get(struct gpio_chip *chip, unsigned offset) return ggc->lines[which].value; } -static void gb_gpio_set(struct gpio_chip *chip, unsigned offset, int value) +static void gb_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); gb_gpio_set_value_operation(ggc, (u8)offset, !!value); } -static int gb_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, - unsigned debounce) +static int gb_gpio_set_debounce(struct gpio_chip *chip, unsigned int offset, + unsigned int debounce) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); u16 usec; @@ -593,7 +593,7 @@ static int gb_gpio_irqchip_add(struct gpio_chip *chip, { struct gb_gpio_controller *ggc; unsigned int offset; - unsigned irq_base; + unsigned int irq_base; if (!chip || !irqchip) return -EINVAL; @@ -625,7 +625,7 @@ static int gb_gpio_irqchip_add(struct gpio_chip *chip, return 0; } -static int gb_gpio_to_irq(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 7882306..3ad8c64 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -124,7 +124,7 @@ static DEFINE_IDA(loopback_ida); #define GB_LOOPBACK_FIFO_DEFAULT 8192 -static unsigned kfifo_depth = GB_LOOPBACK_FIFO_DEFAULT; +static unsigned int kfifo_depth = GB_LOOPBACK_FIFO_DEFAULT; module_param(kfifo_depth, uint, 0444); /* Maximum size of any one send data buffer we support */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] greybus: checkpatch: Change parameter type unsigned to unsigned int
On Wed, Jan 11, 2017 at 02:48:38PM +0100, Roman Sommer wrote: > Note that this patch does not fix all checkpatch warnings for the > affected files. > > Signed-off-by: Christian Bewermeyer > Signed-off-by: Roman Sommer You forgot to fix the Subject prefix ("staging: greybus: "). Care to fix that up and resend? Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 0/5] fbtft: make it work with DMA enabled SPI
On Tue, 2017-01-03 at 20:29 +0200, Andy Shevchenko wrote: > This series enables 64x48 OLED display and fixes the driver to work > with DMA > enabled SPI properly. > > Has been tested on Intel Edison board with Adafruit 2'8" and SSD1306 > 64x48 > (Sparkfun for Intel Edison) OLED displays at their maximum speed > (25MHz and > 10MHz). Noralf, are you okay with this version of series? > > Since v2: > - fix kbuild bot warning > - remove duplication of might_sleep() (Noralf) > - re-do DMA appoach based on Noralf's suggestion > - append Noralf's tags > > Andy Shevchenko (5): > staging: fbtft: convert fbtft_reset() to be non-atomic > staging: fbtft: remove custom DMA mapped buffer > staging: fbtft: propagate error code from kstrto*() > staging: fbtft: fb_ssd1306: Support smaller screen sizes > staging: fbtft: fb_ssd1306: Refactor write_vmem() > > drivers/staging/fbtft/fb_ra8875.c | 4 > drivers/staging/fbtft/fb_ssd1306.c | 37 > - > drivers/staging/fbtft/fbtft-core.c | 30 ++ > > drivers/staging/fbtft/fbtft-io.c| 4 > drivers/staging/fbtft/fbtft-sysfs.c | 7 +-- > drivers/staging/fbtft/fbtft.h | 1 - > 6 files changed, 35 insertions(+), 48 deletions(-) > -- Andy Shevchenko Intel Finland Oy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] greybus: checkpatch: Change parameter type unsigned to unsigned int
> You forgot to fix the Subject prefix ("staging: greybus: "). > > Care to fix that up and resend? > > Thanks, > Johan > As I added the fix for loopback.c, I did not include the "gpio" prefix. This is what I thought was correct after reading your last mail. Apparently I misunderstood. What should the prefix be in this case? Thanks, Roman ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] greybus: checkpatch: Change parameter type unsigned to unsigned int
>> You forgot to fix the Subject prefix ("staging: greybus: "). >> >> Care to fix that up and resend? >> >> Thanks, >> Johan >> > > As I added the fix for loopback.c, I did not include the "gpio" prefix. > This is what I thought was correct after reading your last mail. > Apparently I misunderstood. > > What should the prefix be in this case? > Oh, I see, I forgot the "staging". I will fix that. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: greybus: checkpatch: Change parameter type unsigned to unsigned int
Note that this patch does not fix all checkpatch warnings for the affected files. Signed-off-by: Christian Bewermeyer Signed-off-by: Roman Sommer --- drivers/staging/greybus/gpio.c | 24 drivers/staging/greybus/loopback.c | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index 250caa0..558550c 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -410,21 +410,21 @@ static int gb_gpio_request_handler(struct gb_operation *op) return 0; } -static int gb_gpio_request(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_request(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); return gb_gpio_activate_operation(ggc, (u8)offset); } -static void gb_gpio_free(struct gpio_chip *chip, unsigned offset) +static void gb_gpio_free(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); gb_gpio_deactivate_operation(ggc, (u8)offset); } -static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); u8 which; @@ -438,22 +438,22 @@ static int gb_gpio_get_direction(struct gpio_chip *chip, unsigned offset) return ggc->lines[which].direction ? 1 : 0; } -static int gb_gpio_direction_input(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); return gb_gpio_direction_in_operation(ggc, (u8)offset); } -static int gb_gpio_direction_output(struct gpio_chip *chip, unsigned offset, - int value) +static int gb_gpio_direction_output(struct gpio_chip *chip, unsigned int offset, + int value) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); return gb_gpio_direction_out_operation(ggc, (u8)offset, !!value); } -static int gb_gpio_get(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_get(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); u8 which; @@ -467,15 +467,15 @@ static int gb_gpio_get(struct gpio_chip *chip, unsigned offset) return ggc->lines[which].value; } -static void gb_gpio_set(struct gpio_chip *chip, unsigned offset, int value) +static void gb_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); gb_gpio_set_value_operation(ggc, (u8)offset, !!value); } -static int gb_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, - unsigned debounce) +static int gb_gpio_set_debounce(struct gpio_chip *chip, unsigned int offset, + unsigned int debounce) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); u16 usec; @@ -593,7 +593,7 @@ static int gb_gpio_irqchip_add(struct gpio_chip *chip, { struct gb_gpio_controller *ggc; unsigned int offset; - unsigned irq_base; + unsigned int irq_base; if (!chip || !irqchip) return -EINVAL; @@ -625,7 +625,7 @@ static int gb_gpio_irqchip_add(struct gpio_chip *chip, return 0; } -static int gb_gpio_to_irq(struct gpio_chip *chip, unsigned offset) +static int gb_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) { struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip); diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 7882306..3ad8c64 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -124,7 +124,7 @@ static DEFINE_IDA(loopback_ida); #define GB_LOOPBACK_FIFO_DEFAULT 8192 -static unsigned kfifo_depth = GB_LOOPBACK_FIFO_DEFAULT; +static unsigned int kfifo_depth = GB_LOOPBACK_FIFO_DEFAULT; module_param(kfifo_depth, uint, 0444); /* Maximum size of any one send data buffer we support */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: greybus: checkpatch: Change parameter type unsigned to unsigned int
On Wed, Jan 11, 2017 at 04:00:35PM +0100, Roman Sommer wrote: > Note that this patch does not fix all checkpatch warnings for the > affected files. > > Signed-off-by: Christian Bewermeyer > Signed-off-by: Roman Sommer Next time I suggest you drop "checkpatch: " from your subject since that's not a (greybus) component. You could have rephrased the summary as "fix checkpatch unsigned warnings" or similar instead. Reviewed-by: Johan Hovold Thanks, Johan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl: fix possible NULL pointer dereference
gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with a destination argument that an earlier function call may have set to NULL: staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr': staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull] staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr': staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull] I'm fixing this by adding a NULL pointer check and returning failure from the function, which is hopefully already handled properly. This seems to date back to when the drivers were originally added, so backporting the fix to stable seems appropriate. There are other related realtek drivers in the kernel, but none of them contain a function with a similar name or produce this warning. Cc: sta...@vger.kernel.org Fixes: 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5") Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel") Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8188eu/core/rtw_recv.c | 2 ++ drivers/staging/rtl8712/rtl871x_recv.c| 7 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 1bc7b97bf2ad..f2021fed704c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1313,6 +1313,8 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe) pattrib->eth_type = eth_type; ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0))); + if (!ptr) + return _FAIL; memcpy(ptr, pattrib->dst, ETH_ALEN); memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN); diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 4388ddf02b2c..147b75beea73 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -640,11 +640,16 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) /* append rx status for mp test packets */ ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2) - 24); + if (!ptr) + return _FAIL; memcpy(ptr, get_rxmem(precvframe), 24); ptr += 24; - } else + } else { ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0))); + if (!ptr) + return _FAIL; + } memcpy(ptr, pattrib->dst, ETH_ALEN); memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN); -- 2.9.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 0/5] fbtft: make it work with DMA enabled SPI
Den 11.01.2017 15:43, skrev Andy Shevchenko: On Tue, 2017-01-03 at 20:29 +0200, Andy Shevchenko wrote: This series enables 64x48 OLED display and fixes the driver to work with DMA enabled SPI properly. Has been tested on Intel Edison board with Adafruit 2'8" and SSD1306 64x48 (Sparkfun for Intel Edison) OLED displays at their maximum speed (25MHz and 10MHz). Noralf, are you okay with this version of series? Yes, Greg applies them without my ack, unless it touches core stuff. Series: Acked-by: Noralf Trønnes Since v2: - fix kbuild bot warning - remove duplication of might_sleep() (Noralf) - re-do DMA appoach based on Noralf's suggestion - append Noralf's tags Andy Shevchenko (5): staging: fbtft: convert fbtft_reset() to be non-atomic staging: fbtft: remove custom DMA mapped buffer staging: fbtft: propagate error code from kstrto*() staging: fbtft: fb_ssd1306: Support smaller screen sizes staging: fbtft: fb_ssd1306: Refactor write_vmem() drivers/staging/fbtft/fb_ra8875.c | 4 drivers/staging/fbtft/fb_ssd1306.c | 37 - drivers/staging/fbtft/fbtft-core.c | 30 ++ drivers/staging/fbtft/fbtft-io.c| 4 drivers/staging/fbtft/fbtft-sysfs.c | 7 +-- drivers/staging/fbtft/fbtft.h | 1 - 6 files changed, 35 insertions(+), 48 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: android/ion: Fix coding style issues
Fix following checkpatch warnings: - Lines over 80 characters - void function with return statement - Unaligned comment mark - Header function prototypes missing variable names Signed-off-by: Bogdan Purcareata --- drivers/staging/android/ion/ion-ioctl.c | 3 ++- drivers/staging/android/ion/ion_of.c| 1 - drivers/staging/android/ion/ion_priv.h | 40 - 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c index 7e7431d..e28fffb 100644 --- a/drivers/staging/android/ion/ion-ioctl.c +++ b/drivers/staging/android/ion/ion-ioctl.c @@ -111,7 +111,8 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) struct ion_handle *handle; mutex_lock(&client->lock); - handle = ion_handle_get_by_id_nolock(client, data.handle.handle); + handle = ion_handle_get_by_id_nolock(client, + data.handle.handle); if (IS_ERR(handle)) { mutex_unlock(&client->lock); return PTR_ERR(handle); diff --git a/drivers/staging/android/ion/ion_of.c b/drivers/staging/android/ion/ion_of.c index 46b2bb9..7791c70 100644 --- a/drivers/staging/android/ion/ion_of.c +++ b/drivers/staging/android/ion/ion_of.c @@ -161,7 +161,6 @@ static int rmem_ion_device_init(struct reserved_mem *rmem, struct device *dev) static void rmem_ion_device_release(struct reserved_mem *rmem, struct device *dev) { - return; } static const struct reserved_mem_ops rmem_dma_ops = { diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index 3c3b324..444a1a1 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -54,7 +54,7 @@ * handle, used for debugging * @pid: pid of last client to reference this buffer in a * handle, used for debugging -*/ + */ struct ion_buffer { struct kref ref; union { @@ -287,10 +287,10 @@ void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap); * some helpers for common operations on buffers using the sg_table * and vaddr fields */ -void *ion_heap_map_kernel(struct ion_heap *, struct ion_buffer *); -void ion_heap_unmap_kernel(struct ion_heap *, struct ion_buffer *); -int ion_heap_map_user(struct ion_heap *, struct ion_buffer *, - struct vm_area_struct *); +void *ion_heap_map_kernel(struct ion_heap *heap, struct ion_buffer *buffer); +void ion_heap_unmap_kernel(struct ion_heap *heap, struct ion_buffer *buffer); +int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, + struct vm_area_struct *vma); int ion_heap_buffer_zero(struct ion_buffer *buffer); int ion_heap_pages_zero(struct page *page, size_t size, pgprot_t pgprot); @@ -371,21 +371,21 @@ size_t ion_heap_freelist_size(struct ion_heap *heap); * heaps as appropriate. */ -struct ion_heap *ion_heap_create(struct ion_platform_heap *); -void ion_heap_destroy(struct ion_heap *); -struct ion_heap *ion_system_heap_create(struct ion_platform_heap *); -void ion_system_heap_destroy(struct ion_heap *); +struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data); +void ion_heap_destroy(struct ion_heap *heap); +struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused); +void ion_system_heap_destroy(struct ion_heap *heap); -struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *); -void ion_system_contig_heap_destroy(struct ion_heap *); +struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *heap); +void ion_system_contig_heap_destroy(struct ion_heap *heap); -struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *); -void ion_carveout_heap_destroy(struct ion_heap *); +struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data); +void ion_carveout_heap_destroy(struct ion_heap *heap); -struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *); -void ion_chunk_heap_destroy(struct ion_heap *); -struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *); -void ion_cma_heap_destroy(struct ion_heap *); +struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data); +void ion_chunk_heap_destroy(struct ion_heap *heap); +struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data); +void ion_cma_heap_destroy(struct ion_heap *heap); /** * functions for creating and destroying a heap pool -- allows you @@ -427,9 +427,9 @@ struct ion_page_pool { struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order, bool cached); -void ion_page_pool_destroy(struct ion_page_pool *); -struct page *ion_page_pool_alloc(
Re: [PATCH] staging: rtl: fix possible NULL pointer dereference
On 01/11/2017 08:53 AM, Arnd Bergmann wrote: gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with a destination argument that an earlier function call may have set to NULL: staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr': staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull] staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr': staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull] I'm fixing this by adding a NULL pointer check and returning failure from the function, which is hopefully already handled properly. This seems to date back to when the drivers were originally added, so backporting the fix to stable seems appropriate. There are other related realtek drivers in the kernel, but none of them contain a function with a similar name or produce this warning. Aced-by: Larry Finger Arnd, Please let me now if gcc-7 shows any warnings for the code in drivers/net/wireless/realtek/rtlwifi/. My distro supplies gcc-4.8, and it wouod be a lot of work to implement gcc-7. Larry Cc: sta...@vger.kernel.org Fixes: 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5") Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel") Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8188eu/core/rtw_recv.c | 2 ++ drivers/staging/rtl8712/rtl871x_recv.c| 7 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 1bc7b97bf2ad..f2021fed704c 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -1313,6 +1313,8 @@ static int wlanhdr_to_ethhdr(struct recv_frame *precvframe) pattrib->eth_type = eth_type; ptr = recvframe_pull(precvframe, (rmv_len-sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0))); + if (!ptr) + return _FAIL; memcpy(ptr, pattrib->dst, ETH_ALEN); memcpy(ptr+ETH_ALEN, pattrib->src, ETH_ALEN); diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index 4388ddf02b2c..147b75beea73 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -640,11 +640,16 @@ sint r8712_wlanhdr_to_ethhdr(union recv_frame *precvframe) /* append rx status for mp test packets */ ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + 2) - 24); + if (!ptr) + return _FAIL; memcpy(ptr, get_rxmem(precvframe), 24); ptr += 24; - } else + } else { ptr = recvframe_pull(precvframe, (rmv_len - sizeof(struct ethhdr) + (bsnaphdr ? 2 : 0))); + if (!ptr) + return _FAIL; + } memcpy(ptr, pattrib->dst, ETH_ALEN); memcpy(ptr + ETH_ALEN, pattrib->src, ETH_ALEN); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] tty_port: checkpatch: Refactored file to linux style guides
The tty_port.c file is now accordingly to the linux style guidelines. Signed-off-by: Fabian Arnold Signed-off-by: Philip Thiemann --- drivers/tty/tty_port.c | 38 +++--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index c3f9d93..bc931a1 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -44,7 +44,7 @@ EXPORT_SYMBOL(tty_port_init); * tty_register_driver. */ void tty_port_link_device(struct tty_port *port, - struct tty_driver *driver, unsigned index) + struct tty_driver *driver, unsigned int index) { if (WARN_ON(index >= driver->num)) return; @@ -64,7 +64,7 @@ EXPORT_SYMBOL_GPL(tty_port_link_device); * Call tty_port_link_device as a last resort. */ struct device *tty_port_register_device(struct tty_port *port, - struct tty_driver *driver, unsigned index, + struct tty_driver *driver, unsigned int index, struct device *device) { tty_port_link_device(port, driver, index); @@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(tty_port_register_device); * (or both). Call tty_port_link_device as a last resort. */ struct device *tty_port_register_device_attr(struct tty_port *port, - struct tty_driver *driver, unsigned index, + struct tty_driver *driver, unsigned int index, struct device *device, void *drvdata, const struct attribute_group **attr_grp) { @@ -363,8 +363,10 @@ int tty_port_block_til_ready(struct tty_port *port, unsigned long flags; DEFINE_WAIT(wait); - /* if non-blocking mode is set we can pass directly to open unless - the port has just hung up or is in another error state */ + /* +* if non-blocking mode is set we can pass directly to open unless +* the port has just hung up or is in another error state +*/ if (tty_io_error(tty)) { tty_port_set_active(port, 1); return 0; @@ -380,10 +382,11 @@ int tty_port_block_til_ready(struct tty_port *port, if (C_CLOCAL(tty)) do_clocal = 1; - /* Block waiting until we can proceed. We may need to wait for the - carrier, but we must also wait for any close that is in progress - before the next open may complete */ - + /* +* Block waiting until we can proceed. We may need to wait for the +* carrier, but we must also wait for any close that is in progress +* before the next open may complete +*/ retval = 0; /* The port lock protects the port counts */ @@ -398,8 +401,10 @@ int tty_port_block_til_ready(struct tty_port *port, tty_port_raise_dtr_rts(port); prepare_to_wait(&port->open_wait, &wait, TASK_INTERRUPTIBLE); - /* Check for a hangup or uninitialised port. - Return accordingly */ + /* +* Check for a hangup or uninitialised port. +* Return accordingly +*/ if (tty_hung_up_p(filp) || !tty_port_initialized(port)) { if (port->flags & ASYNC_HUP_NOTIFY) retval = -EAGAIN; @@ -425,8 +430,10 @@ int tty_port_block_til_ready(struct tty_port *port, } finish_wait(&port->open_wait, &wait); - /* Update counts. A parallel hangup will have set count to zero and - we must not mess that up further */ + /* +* Update counts. A parallel hangup will have set count to zero and +* we must not mess that up further +*/ spin_lock_irqsave(&port->lock, flags); if (!tty_hung_up_p(filp)) port->count++; @@ -583,6 +591,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, clear_bit(TTY_IO_ERROR, &tty->flags); if (port->ops->activate) { int retval = port->ops->activate(port, tty); + if (retval) { mutex_unlock(&port->mutex); return retval; @@ -593,5 +602,4 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, mutex_unlock(&port->mutex); return tty_port_block_til_ready(port, tty, filp); } - EXPORT_SYMBOL(tty_port_open); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8192u: Add character '*' in all lines of the block comments.
Correct code style error. Add a character in every line of the comment block. Signed-off-by: Javier Rodriguez --- drivers/staging/rtl8192u/r8180_93cx6.h | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h b/drivers/staging/rtl8192u/r8180_93cx6.h index 9cf7f58..8e48b24 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.h +++ b/drivers/staging/rtl8192u/r8180_93cx6.h @@ -1,17 +1,17 @@ /* - This is part of rtl8187 OpenSource driver - Copyright (C) Andrea Merello 2004-2005 - Released under the terms of GPL (General Public Licence) - - Parts of this driver are based on the GPL part of the - official realtek driver - Parts of this driver are based on the rtl8180 driver skeleton - from Patric Schenke & Andres Salomon - Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver - - We want to thank the Authors of such projects and the Ndiswrapper - project Authors. -*/ + * This is part of rtl8187 OpenSource driver + * Copyright (C) Andrea Merello 2004-2005 + * Released under the terms of GPL (General Public Licence) + * + * Parts of this driver are based on the GPL part of the + * official realtek driver + * Parts of this driver are based on the rtl8180 driver skeleton + * from Patric Schenke & Andres Salomon + * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver + * + * We want to thank the Authors of such projects and the Ndiswrapper + * project Authors. + */ /*This files contains card eeprom (93c46 or 93c56) programming routines*/ /*memory is addressed by WORDS*/ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 00/24] i.MX Media Driver
On Fri, Jan 6, 2017 at 6:11 PM, Steve Longerbeam wrote: > In version 3: > > Changes suggested by Rob Herring : > > - prepended FIM node properties with vendor prefix "fsl,". > > - make mipi csi-2 receiver compatible string SoC specific: > "fsl,imx6-mipi-csi2" instead of "fsl,imx-mipi-csi2". > > - redundant "_clk" removed from mipi csi-2 receiver clock-names property. > > - removed board-specific info from the media driver binding doc. These > were all related to sensor bindings, which already are (adv7180) > or will be (ov564x) covered in separate binding docs. All reference > board info not related to DT bindings has been moved to > Documentation/media/v4l-drivers/imx.rst. > > - removed "_mipi" from the OV5640 compatible string. > > Changes suggested by Vladimir Zapolskiy : > > Mostly cosmetic/non-functional changes which I won't list here, except > for the following: > > - spin_lock_irqsave() changed to spin_lock() in a couple interrupt handlers. > > - fixed some unnecessary of_node_put()'s in for_each_child_of_node() loops. > > - check/handle return code from required reg property of CSI port nodes. > > - check/handle return code from clk_prepare_enable(). > > Changes suggested by Fabio Estevam : > > - switch to VGEN3 Analog Vdd supply assuming rev. C SabreSD boards. > > - finally got around to passing valid IOMUX pin config values to the > pin groups. > > Other changes: > > - removed the FIM properties that overrided the v4l2 FIM control defaults > values. This was left-over from a requirement of a customer and is not > necessary here. > > - The FIM must be explicitly enabled in the fim child node under the CSI > port nodes, using the status property. If not enabled, FIM v4l2 controls > will not appear in the video capture driver. > > - brought in additional media types patch from Philipp Zabel. Use new > MEDIA_ENT_F_VID_IF_BRIDGE in mipi csi-2 receiver subdev. > > - brought in latest platform generic video multiplexer subdevice driver > from Philipp Zabel (squashed with patch that uses new MEDIA_ENT_F_MUX). > > - removed imx-media-of.h, moved those prototypes into imx-media.h. > > Hi Steve, I took a stab at testing this today on a gw51xx which has an adv7180 hooked up as follows: - i2c3@0x20 - 8bit data bus from DAT12 to DAT19, HSYNC, VSYNC, PIXCLK on CSI0 pads (CSI0_IPU1) - PWRDWN# on MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 - IRQ# on MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 - all three analog inputs available to off-board connector My patch to the imx6qdl-gw51xx dtsi is: diff --git a/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi index afec2c7..2583d72 100644 --- a/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi +++ b/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi @@ -165,6 +174,52 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; + + camera: adv7180@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpio = <&gpio5 20 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio5>; + interrupts = <23 GPIO_ACTIVE_LOW>; + inputs = <0x00 0x01 0x02>; + input-names = "ADV7180 Composite on Ain1", + "ADV7180 Composite on Ain2", + "ADV7180 Composite on Ain3"; + + port { + adv7180_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi0_mux>; + bus-width = <8>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; + + /* enable frame interval monitor on this port */ + fim { + status = "okay"; + }; }; &pcie { @@ -236,6 +291,13 @@ &iomuxc { imx6qdl-gw51xx { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 0x0001b0b0 /* VIDDEC_IRQ# */ + MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x4001b0b0 /* VIDDEC_EN */ + >; + }; + pinctrl_enet: enetgrp { fsl,pins = < MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b030 @@ -306,6 +368,22 @@ >; }; + pinctrl_ipu1_csi0: ipu1csi0grp { /* IPU1_CSI0: 8-bit input */ + fsl,pins = < + MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA120x1b0b0 + MX6QDL_PAD_CSI0_DAT13__IPU
[PATCH 2/2] staging: rtl8192u: Removed multiple white lines.
Remove one unnecessary white line. Signed-off-by: Javier Rodriguez --- drivers/staging/rtl8192u/r8180_93cx6.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8192u/r8180_93cx6.h b/drivers/staging/rtl8192u/r8180_93cx6.h index 8e48b24..643d465 100644 --- a/drivers/staging/rtl8192u/r8180_93cx6.h +++ b/drivers/staging/rtl8192u/r8180_93cx6.h @@ -39,5 +39,4 @@ #define EPROM_TXPW2 0x1b #define EPROM_TXPW1 0x3d - int eprom_read(struct net_device *dev, u32 addr); /* reads a 16 bits word */ -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 01/18] Drivers: hv: vmbus: Move the definition of hv_x64_msr_hypercall_contents
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Tuesday, January 10, 2017 9:27 AM > To: KY Srinivasan > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com; > jasow...@redhat.com; leann.ogasaw...@canonical.com; > rka...@virtuozzo.com; x...@kernel.org; t...@linutronix.de; h...@zytor.com > Subject: Re: [PATCH 01/18] Drivers: hv: vmbus: Move the definition of > hv_x64_msr_hypercall_contents > > On Fri, Dec 30, 2016 at 01:35:55PM -0800, k...@exchange.microsoft.com > wrote: > > From: K. Y. Srinivasan > > > > As part of the effort to separate out architecture specific code, move the > > definition of hv_x64_msr_hypercall_contents to x86 specific header file. > > > > Signed-off-by: K. Y. Srinivasan > > --- > > arch/x86/include/asm/mshyperv.h | 12 > > drivers/hv/hyperv_vmbus.h | 15 --- > > 2 files changed, 12 insertions(+), 15 deletions(-) > > This series doesn't apply against my tree. Can you please refresh it > and resend? Will do. K. Y > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 00/24] i.MX Media Driver
Hi Tim, On 01/11/2017 03:14 PM, Tim Harvey wrote: Hi Steve, I took a stab at testing this today on a gw51xx which has an adv7180 hooked up as follows: - i2c3@0x20 - 8bit data bus from DAT12 to DAT19, HSYNC, VSYNC, PIXCLK on CSI0 pads (CSI0_IPU1) - PWRDWN# on MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 - IRQ# on MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 - all three analog inputs available to off-board connector My patch to the imx6qdl-gw51xx dtsi is: As long as you used the patch to imx6qdl-sabreauto.dtsti that adds the adv7180 support as a guide, you should be ok here. On an IMX6Q I'm getting the following when the adv7180 module loads: [ 12.862477] adv7180 2-0020: chip found @ 0x20 (21a8000.i2c) [ 12.907767] imx-media: Registered subdev adv7180 2-0020 [ 12.907793] imx-media soc:media@0: Entity type for entity adv7180 2-0020 was not initialized! [ 12.907867] imx-media: imx_media_create_link: adv7180 2-0020:0 -> ipu1_csi0_mux:1 Is the warning that adv7180 was not initialized expected and or an issue? Yeah it's still a bug in the adv7180 driver, needs fixing. Now that your driver is hooking into the current media framework, I'm not at all clear on how to link and configure the media entities. It's all documented at Documentation/media/v4l-drivers/imx.rst. Follow the SabreAuto pipeline setup example. Additionally I've found that on an IMX6S/IMX6DL we crash while registering the media-ic subdev's: [3.975473] imx-media: Registered subdev ipu1_csi1_mux [3.980921] imx-media: Registered subdev ipu1_csi0_mux [4.003205] imx-media: Registered subdev ipu1_ic_prpenc [4.025373] imx-media: Registered subdev ipu1_ic_prpvf [4.037944] [ cut here ] [4.042571] Kernel BUG at c06717dc [verbose debug info unavailable] [4.048845] Internal error: Oops - BUG: 0 [#1] SMP ARM [4.053990] Modules linked in: [4.057076] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0-rc6-00524-g84dad6e-dirty #446 [4.065260] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) ... [4.296250] [] (v4l2_subdev_init) from [] (imx_ic_probe+0x94/0x1ac) [4.304271] [] (imx_ic_probe) from [] (platform_drv_probe+0x54/0xb8) [4.312373] r9:c0d5e858 r8: r7:fdfb r6:c0e5dbf8 r5:da603810 r4:c16738d8 [4.320129] [] (platform_drv_probe) from [] (driver_probe_device+0x20c/0x2c0) [4.329010] r7:c0e5dbf8 r6: r5:da603810 r4:c16738d8 [4.334681] [] (driver_probe_device) from [] (__driver_attach+0xc8/0xcc) [4.343129] r9:c0d5e858 r8: r7: r6:da603844 r5:c0e5dbf8 r4:da603810 [4.350889] [] (__driver_attach) from [] (bus_for_each_dev+0x74/0xa8) [4.359078] r7: r6:c0515a2c r5:c0e5dbf8 r4: [4.364753] [] (bus_for_each_dev) from [] (driver_attach+0x20/0x28) I assume there is an iteration that needs a test on a missing pointer only available on chips with both IPU's or PRP Yep, I only have quad boards here so I haven't gotten around to testing on S/DL. But it looks like I forgot to clear out the csi subdev pointer array before passing it to imx_media_of_parse(). I think that might explain the OOPS above. Try this patch: diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index 357654d..0cf2d61 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -379,7 +379,7 @@ static int imx_media_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; - struct imx_media_subdev *csi[4]; + struct imx_media_subdev *csi[4] = {0}; struct imx_media_dev *imxmd; int ret; Steve ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/7] staging:wilc1000:wilc_debugfs.c Removes multiple blank lines
Fixes checkpatch CHECK: Please don't use multiple blank lines Signed-off-by: Scott Matheina --- drivers/staging/wilc1000/wilc_debugfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index 52aac75..7d32de9 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -17,7 +17,6 @@ #include "wilc_wlan_if.h" - static struct dentry *wilc_dir; /* @@ -36,7 +35,6 @@ EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL); * */ - static ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { char buf[128]; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/7] staging:wilc1000:wilc_sdio.c Deleted un-needed blank lines
Fixes checkpatch CHECK: Blank lines aren't necessary before a close brace '}' Please don't use multiple blank lines Signed-off-by: Scott Matheina --- drivers/staging/wilc1000/wilc_sdio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index e48cebe..cd6b8ba 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -81,7 +81,6 @@ static int wilc_sdio_cmd52(struct wilc *wilc, struct sdio_cmd52 *cmd) return ret; } - static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd) { struct sdio_func *func = container_of(wilc->dev, struct sdio_func, dev); @@ -915,7 +914,6 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val) __LINE__); goto _fail_; } - } } else { if (g_sdio.irq_gpio) { @@ -945,7 +943,6 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val) __LINE__); goto _fail_; } - } if (!ret) break; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/7] staging:wilc1000:wilc_debugfs.c Aligns code to match open parenthesis
Fixes checkpatch CHECK: Alignment should match open parenthesis Signed-off-by: Scott Matheina --- drivers/staging/wilc1000/wilc_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index 07260c4..52aac75 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -52,7 +52,7 @@ static ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf, si } static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { int flag = 0; int ret; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/7] staging:wilc1000:wilc_sdio.c Aligns code match open parenthesis
Fixes checkpatch CHECK: Alignment should match open parenthesis Signed-off-by: Scott Matheina --- drivers/staging/wilc1000/wilc_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 3ad7cec..e48cebe 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -127,7 +127,7 @@ static int linux_sdio_probe(struct sdio_func *func, dev_dbg(&func->dev, "Initializing netdev\n"); ret = wilc_netdev_init(&wilc, &func->dev, HIF_SDIO, gpio, -&wilc_hif_sdio); + &wilc_hif_sdio); if (ret) { dev_err(&func->dev, "Couldn't initialize netdev\n"); return ret; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging:wlan-ng:cfg80211.c Aligned code with open parenthesis
Fixed Alignment should match open parenthesis checkpatch CHECK. Signed-off-by: Scott Matheina --- drivers/staging/wlan-ng/cfg80211.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index aa0e5a3..11870cb 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -483,8 +483,8 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, msg_join.authtype.data = P80211ENUM_authalg_sharedkey; else netdev_warn(dev, - "Unhandled authorisation type for connect (%d)\n", - sme->auth_type); + "Unhandled authorisation type for connect (%d)\n", + sme->auth_type); /* Set the encryption - we only support wep */ if (is_wep) { @@ -667,7 +667,7 @@ void prism2_disconnected(struct wlandevice *wlandev) void prism2_roamed(struct wlandevice *wlandev) { cfg80211_roamed(wlandev->netdev, NULL, wlandev->bssid, - NULL, 0, NULL, 0, GFP_KERNEL); + NULL, 0, NULL, 0, GFP_KERNEL); } /* Structures for declaring wiphy interface */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/7] staging:wilc1000:host_interface.c Added braces {} on else statemement
Fixes checkpatch warning: braces {} should be used on all arms of this statement Signed-off-by: Scott Matheina --- drivers/staging/wilc1000/host_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b00ea75..c307cce 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3998,8 +3998,9 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) pNewJoinBssParam->rsn_found = true; index += pu8IEs[index + 1] + 2; continue; - } else + } else { index += pu8IEs[index + 1] + 2; + } } } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] staging:wilc1000:linux_wlan.c Align code to match open parenthesis
Fixes checkpatch CHECK: Alignment should match open parenthesis Signed-off-by: Scott Matheina --- drivers/staging/wilc1000/linux_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 185fcd1..9ab4393 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -364,7 +364,7 @@ static int linux_wlan_start_firmware(struct net_device *dev) return ret; if (!wait_for_completion_timeout(&wilc->sync_event, - msecs_to_jiffies(5000))) +msecs_to_jiffies(5000))) return -ETIME; return 0; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND] Staging: greybus: style fix, permissions as octal
Changed permissions to be in octal style. Found by checkpatch. Signed-off-by: Derek Robson --- drivers/staging/greybus/camera.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 0ee291ca2c72..a64517eabff4 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -1067,22 +1067,22 @@ struct gb_camera_debugfs_entry { static const struct gb_camera_debugfs_entry gb_camera_debugfs_entries[] = { { .name = "capabilities", - .mask = S_IFREG | S_IRUGO, + .mask = S_IFREG | 0444, .buffer = GB_CAMERA_DEBUGFS_BUFFER_CAPABILITIES, .execute = gb_camera_debugfs_capabilities, }, { .name = "configure_streams", - .mask = S_IFREG | S_IRUGO | S_IWUGO, + .mask = S_IFREG | 0666, .buffer = GB_CAMERA_DEBUGFS_BUFFER_STREAMS, .execute = gb_camera_debugfs_configure_streams, }, { .name = "capture", - .mask = S_IFREG | S_IRUGO | S_IWUGO, + .mask = S_IFREG | 0666, .buffer = GB_CAMERA_DEBUGFS_BUFFER_CAPTURE, .execute = gb_camera_debugfs_capture, }, { .name = "flush", - .mask = S_IFREG | S_IRUGO | S_IWUGO, + .mask = S_IFREG | 0666, .buffer = GB_CAMERA_DEBUGFS_BUFFER_FLUSH, .execute = gb_camera_debugfs_flush, }, @@ -1097,7 +1097,7 @@ static ssize_t gb_camera_debugfs_read(struct file *file, char __user *buf, ssize_t ret; /* For read-only entries the operation is triggered by a read. */ - if (!(op->mask & S_IWUGO)) { + if (!(op->mask & 0222)) { ret = op->execute(gcam, NULL, 0); if (ret < 0) return ret; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [greybus-dev] [PATCH v3] staging: greybus: checkpatch: Change parameter type unsigned to unsigned int
On 11-01-17, 16:00, Roman Sommer wrote: > Note that this patch does not fix all checkpatch warnings for the > affected files. > > Signed-off-by: Christian Bewermeyer > Signed-off-by: Roman Sommer > > --- > drivers/staging/greybus/gpio.c | 24 > drivers/staging/greybus/loopback.c | 2 +- > 2 files changed, 13 insertions(+), 13 deletions(-) I think checkpatch should rather not warn about it. Using 'unsigned' instead of 'unsigned int' isn't that bad :) Acked-by: Viresh Kumar -- viresh ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: greybus: checkpatch: Change parameter type unsigned to unsigned int
On Wed, Jan 11, 2017 at 04:00:35PM +0100, Roman Sommer wrote: > Note that this patch does not fix all checkpatch warnings for the > affected files. > A lot of ways that display git commits put the changelog and the summary far apart. The changelog is pretty useless by itself in this case. https://lkml.org/lkml/2017/1/11/308 See how it puts the date in between? marc.info is even worse but google hasn't indexed it yet and I'm too lazy to look it up. So people read the summary or the changelog but not necessarily both. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: android/ion: Fix coding style issues
On Wed, Jan 11, 2017 at 11:20:39PM +0200, Bogdan Purcareata wrote: > Fix following checkpatch warnings: > - Lines over 80 characters > - void function with return statement > - Unaligned comment mark > - Header function prototypes missing variable names That's a lot of different things to be doing all in one patch. Please break this up into "one-logical-thing-per-patch" and send this as a patch series. And no, "fix coding style issues" is not "one logical thing". thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] tty_port: checkpatch: Refactored file to linux style guides
On Wed, Jan 11, 2017 at 10:39:22PM +0100, Fabian Arnold wrote: > The tty_port.c file is now accordingly to the linux style guidelines. That's the vaguest changelog text ever :( Please describe what you did here, and why you did it. And if you fixed more than one "type" of style issue, you need to break this up into multiple patches. And finally, why are you doing checkpatch cleanup on core kernel code? Please start in drivers/staging/ where it's more appreciated and you can learn how to do it correctly, that's what that code is there for. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: android/ion: Don't use return in void function
Signed-off-by: Bogdan Purcareata --- drivers/staging/android/ion/ion_of.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_of.c b/drivers/staging/android/ion/ion_of.c index 46b2bb9..7791c70 100644 --- a/drivers/staging/android/ion/ion_of.c +++ b/drivers/staging/android/ion/ion_of.c @@ -161,7 +161,6 @@ static int rmem_ion_device_init(struct reserved_mem *rmem, struct device *dev) static void rmem_ion_device_release(struct reserved_mem *rmem, struct device *dev) { - return; } static const struct reserved_mem_ops rmem_dma_ops = { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: android/ion: Use variable names in header
Populate header function signatures with variable names as well, not just variable types. Signed-off-by: Bogdan Purcareata --- drivers/staging/android/ion/ion_priv.h | 38 +- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index 00d8b53..444a1a1 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -287,10 +287,10 @@ void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap); * some helpers for common operations on buffers using the sg_table * and vaddr fields */ -void *ion_heap_map_kernel(struct ion_heap *, struct ion_buffer *); -void ion_heap_unmap_kernel(struct ion_heap *, struct ion_buffer *); -int ion_heap_map_user(struct ion_heap *, struct ion_buffer *, - struct vm_area_struct *); +void *ion_heap_map_kernel(struct ion_heap *heap, struct ion_buffer *buffer); +void ion_heap_unmap_kernel(struct ion_heap *heap, struct ion_buffer *buffer); +int ion_heap_map_user(struct ion_heap *heap, struct ion_buffer *buffer, + struct vm_area_struct *vma); int ion_heap_buffer_zero(struct ion_buffer *buffer); int ion_heap_pages_zero(struct page *page, size_t size, pgprot_t pgprot); @@ -371,21 +371,21 @@ size_t ion_heap_freelist_size(struct ion_heap *heap); * heaps as appropriate. */ -struct ion_heap *ion_heap_create(struct ion_platform_heap *); -void ion_heap_destroy(struct ion_heap *); -struct ion_heap *ion_system_heap_create(struct ion_platform_heap *); -void ion_system_heap_destroy(struct ion_heap *); +struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data); +void ion_heap_destroy(struct ion_heap *heap); +struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused); +void ion_system_heap_destroy(struct ion_heap *heap); -struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *); -void ion_system_contig_heap_destroy(struct ion_heap *); +struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *heap); +void ion_system_contig_heap_destroy(struct ion_heap *heap); -struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *); -void ion_carveout_heap_destroy(struct ion_heap *); +struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data); +void ion_carveout_heap_destroy(struct ion_heap *heap); -struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *); -void ion_chunk_heap_destroy(struct ion_heap *); -struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *); -void ion_cma_heap_destroy(struct ion_heap *); +struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data); +void ion_chunk_heap_destroy(struct ion_heap *heap); +struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data); +void ion_cma_heap_destroy(struct ion_heap *heap); /** * functions for creating and destroying a heap pool -- allows you @@ -427,9 +427,9 @@ struct ion_page_pool { struct ion_page_pool *ion_page_pool_create(gfp_t gfp_mask, unsigned int order, bool cached); -void ion_page_pool_destroy(struct ion_page_pool *); -struct page *ion_page_pool_alloc(struct ion_page_pool *); -void ion_page_pool_free(struct ion_page_pool *, struct page *); +void ion_page_pool_destroy(struct ion_page_pool *pool); +struct page *ion_page_pool_alloc(struct ion_page_pool *pool); +void ion_page_pool_free(struct ion_page_pool *pool, struct page *page); /** ion_page_pool_shrink - shrinks the size of the memory cached in the pool * @pool: the pool -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel