Re: [PATCH RFT/RFC 01/49] staging: media: Revert "media: zoran: remove deprecated driver"

2020-09-22 Thread LABBE Corentin
On Tue, Sep 22, 2020 at 06:16:01AM +0100, Christoph Hellwig wrote:
> > +   fh->buffers.buffer[i].v4l.fbuffer = mem;
> > +   fh->buffers.buffer[i].v4l.fbuffer_phys = virt_to_phys(mem);
> > +   fh->buffers.buffer[i].v4l.fbuffer_bus = virt_to_bus(mem);
> > +   for (off = 0; off < fh->buffers.buffer_size;
> > +off += PAGE_SIZE)
> > +   SetPageReserved(virt_to_page(mem + off));
> 
> This messing with SetPageReserved needs to go away before we bring
> back the driver, even for staging.

The whole old buffer management (with some virt_to_phys, virt_to_bus, 
SetPageReserved, etc...) is removed in "zoran: convert to vb2".

Regards
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFT/RFC 37/49] staging: media: zoran: add fallthrough keyword

2020-09-24 Thread LABBE Corentin
On Mon, Sep 21, 2020 at 01:59:45PM +0300, Dan Carpenter wrote:
> On Mon, Sep 21, 2020 at 10:20:12AM +, Corentin Labbe wrote:
> > This patch adds fallthrough keyword where appropriate.
> > 
> > Signed-off-by: Corentin Labbe 
> > ---
> >  drivers/staging/media/zoran/zoran_device.c | 6 ++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/staging/media/zoran/zoran_device.c 
> > b/drivers/staging/media/zoran/zoran_device.c
> > index 9558bafdde7d..7634d94f9359 100644
> > --- a/drivers/staging/media/zoran/zoran_device.c
> > +++ b/drivers/staging/media/zoran/zoran_device.c
> > @@ -268,7 +268,9 @@ static void zr36057_adjust_vfe(struct zoran *zr, enum 
> > zoran_codec_mode mode)
> > btwrite(reg, ZR36057_VFEHCR);
> > break;
> > case BUZ_MODE_MOTION_COMPRESS:
> > +   fallthrough;
> > case BUZ_MODE_IDLE:
> > +   fallthrough;
> > default:
> 
> Hopefully, we don't need fallthrough labels for empty switch statements
> like this?
> 

I have removed this patch and nothing warn about fallthrough missing.
But this is strange, if I have added them, it is because something (checkpatch 
?) complained.

Anyway, nothing complains now, it is cleaner without them.

Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] media: zoran: get rid of an unused var

2020-10-02 Thread LABBE Corentin
On Thu, Oct 01, 2020 at 11:28:14AM +0200, Mauro Carvalho Chehab wrote:
> The jpeg_error in lowercase is not used anywhere. Drop it.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/staging/media/zoran/zoran.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/staging/media/zoran/zoran.h 
> b/drivers/staging/media/zoran/zoran.h
> index 7217a64fe59b..945502becd60 100644
> --- a/drivers/staging/media/zoran/zoran.h
> +++ b/drivers/staging/media/zoran/zoran.h
> @@ -264,7 +264,6 @@ struct zoran {
>  
>   /* Additional stuff for testing */
>   unsigned int ghost_int;
> - int jpeg_error;
>   int intr_counter_GIRQ1;
>   int intr_counter_GIRQ0;
>   int intr_counter_CodRepIRQ;
> -- 
> 2.26.2
> 

Acked-by: Corentin Labbe 

Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/3] media: zoran: fix mixed case on vars

2020-10-02 Thread LABBE Corentin
On Thu, Oct 01, 2020 at 11:28:15AM +0200, Mauro Carvalho Chehab wrote:
> Use this small script to replace CamelCase and wrong case
> on vars:
> 
> 
> FILES=$(find "$1" -type f|grep -e '.c$' -e '.h$')
> CAMEL_VARS=$(cat tags|perl -ne 'print "$1\n" if 
> (m/^(\w*[A-Z]\w*[a-z]\w*)\s/)')
> for i in $CAMEL_VARS; do
> new=$(perl -e '
> my $s = $ARGV[0];
> $s =~ s{([^a-zA-Z]?)([A-Z]*)([A-Z])([a-z]?)}{
> my $fc = pos($s)==0;
> my ($p0,$p1,$p2,$p3) = ($1,lc$2,lc$3,$4);
> my $t = $p0 || $fc ? $p0 : '_';
> $t .= $p3 ? $p1 ? "${p1}_$p2$p3" : "$p2$p3" : 
> "$p1$p2";
> $t;
> }ge;
> print $s;' "$i")
> for j in $FILES; do
> sed -E "s,\b$i\b,$new,g" -i $j
> done
> done
> for i in $(git grep "#define zr" drivers/staging/media/zoran/*.[ch]|perl -ne 
> 'print "$1\n" if (m/#define\s+(zr\S+)/)'); do j=$(echo $i|tr [a-z] [A-Z]); 
> sed "s,\b$i\b,$j,g" -i drivers/staging/media/zoran/*.[ch]; done
> 
> 
> This should solve almost all warnings reported by checkpatch.pl
> in strict mode.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/staging/media/zoran/videocodec.h   |   2 +-
>  drivers/staging/media/zoran/zoran.h|  30 +--
>  drivers/staging/media/zoran/zoran_card.c   |  52 ++---
>  drivers/staging/media/zoran/zoran_device.c | 242 ++---
>  drivers/staging/media/zoran/zoran_driver.c |  94 
>  drivers/staging/media/zoran/zr36016.c  |  14 +-
>  drivers/staging/media/zoran/zr36050.c  |   2 +-
>  drivers/staging/media/zoran/zr36057.h  | 122 +--
>  drivers/staging/media/zoran/zr36060.c  |  76 +++
>  drivers/staging/media/zoran/zr36060.h  |  66 +++---
>  10 files changed, 350 insertions(+), 350 deletions(-)

Acked-by: Corentin Labbe 

Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] media: zoran.rst: place it at the right place this time

2020-10-04 Thread LABBE Corentin
On Sun, Oct 04, 2020 at 06:00:30PM +0200, Mauro Carvalho Chehab wrote:
> I was too quick moving zoran.rst... it ends that the original
> patch didn't do the right thing and forgot to update the files
> that references it.
> 
> Fix it.
> 
> Fixes: 6b90346919d4 ("media: zoran: move documentation file to the right 
> place")
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  .../driver-api/media/drivers/{v4l-drivers => }/zoran.rst| 0
>  MAINTAINERS | 2 +-
>  drivers/staging/media/zoran/Kconfig | 2 +-
>  3 files changed, 2 insertions(+), 2 deletions(-)
>  rename Documentation/driver-api/media/drivers/{v4l-drivers => }/zoran.rst 
> (100%)
> 
> diff --git a/Documentation/driver-api/media/drivers/v4l-drivers/zoran.rst 
> b/Documentation/driver-api/media/drivers/zoran.rst
> similarity index 100%
> rename from Documentation/driver-api/media/drivers/v4l-drivers/zoran.rst
> rename to Documentation/driver-api/media/drivers/zoran.rst
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ba5eb1dff9c2..7a12633747c8 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -19247,7 +19247,7 @@ L:linux-me...@vger.kernel.org
>  S:   Maintained
>  W:   http://mjpeg.sourceforge.net/driver-zoran/
>  Q:   https://patchwork.linuxtv.org/project/linux-media/list/
> -F:   Documentation/media/v4l-drivers/zoran.rst
> +F:   Documentation/driver-api/media/drivers/zoran.rst
>  F:   drivers/staging/media/zoran/
>  
>  ZPOOL COMPRESSED PAGE STORAGE API
> diff --git a/drivers/staging/media/zoran/Kconfig 
> b/drivers/staging/media/zoran/Kconfig
> index 492507030276..7874842033ca 100644
> --- a/drivers/staging/media/zoran/Kconfig
> +++ b/drivers/staging/media/zoran/Kconfig
> @@ -8,7 +8,7 @@ config VIDEO_ZORAN
> 36057/36067 PCI controller chipset. This includes the Iomega
> Buz, Pinnacle DC10+ and the Linux Media Labs LML33. There is
> a driver homepage at . For
> -   more information, check 
> .
> +   more information, check 
> .
>  
> To compile this driver as a module, choose M here: the
> module will be called zr36067.
> -- 
> 2.26.2
> 
Hello

Acked-by: Corentin Labbe 

Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH][next] media: zoran: fix spelling mistake and make error message more meaningful

2020-10-05 Thread LABBE Corentin
On Fri, Oct 02, 2020 at 11:16:20AM +0100, Colin King wrote:
> From: Colin Ian King 
> 
> There is a spelling mistake in a pci_err error message. Fix this and
> make the error message a little more meaningful.
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/staging/media/zoran/zoran_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/zoran/zoran_driver.c 
> b/drivers/staging/media/zoran/zoran_driver.c
> index 808196ea5b81..d9f8b21edf6a 100644
> --- a/drivers/staging/media/zoran/zoran_driver.c
> +++ b/drivers/staging/media/zoran/zoran_driver.c
> @@ -666,7 +666,7 @@ static int zoran_g_selection(struct file *file, void 
> *__fh, struct v4l2_selectio
>  
>   if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT &&
>   sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
> - pci_err(zr->pci_dev, "%s invalid combinaison\n", __func__);
> + pci_err(zr->pci_dev, "%s invalid selection type combination\n", 
> __func__);
>   return -EINVAL;
>   }
>  
> -- 
> 2.27.0
> 

Hello

Acked-by: Corentin Labbe 

Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging:media:zoran: Fixed grammar issue

2020-11-30 Thread LABBE Corentin
On Mon, Nov 30, 2020 at 05:06:59PM -0600, Travis Carter wrote:
> Removed repeated word 'in'
> 
> Signed-off-by: Travis Carter 
> ---
>  drivers/staging/media/zoran/zoran_card.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/zoran/zoran_card.c 
> b/drivers/staging/media/zoran/zoran_card.c
> index dfc60e2e9dd7..c77aa458b6d2 100644
> --- a/drivers/staging/media/zoran/zoran_card.c
> +++ b/drivers/staging/media/zoran/zoran_card.c
> @@ -39,7 +39,7 @@ MODULE_PARM_DESC(card, "Card type");
>  /*
>   * The video mem address of the video card. The driver has a little database 
> for some videocards
>   * to determine it from there. If your video card is not in there you have 
> either to give it to
> - * the driver as a parameter or set in in a VIDIOCSFBUF ioctl
> + * the driver as a parameter or set in a VIDIOCSFBUF ioctl
>   */
>  
>  static unsigned long vidmem; /* default = 0 - Video memory base address */
> -- 
> 2.17.1
> 

Hello

Acked-by: Corentin Labbe 

Thanks
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH -next] media: zoran: use resource_size

2021-01-06 Thread LABBE Corentin
Le Wed, Jan 06, 2021 at 05:51:00PM +0300, Dan Carpenter a écrit :
> On Wed, Jan 06, 2021 at 09:17:02PM +0800, Zheng Yongjun wrote:
> > Use resource_size rather than a verbose computation on
> > the end and start fields.
> > 
> > Signed-off-by: Zheng Yongjun 
> > ---
> >  drivers/staging/media/zoran/zoran_driver.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/zoran/zoran_driver.c 
> > b/drivers/staging/media/zoran/zoran_driver.c
> > index 808196ea5b81..d60b4c73ea80 100644
> > --- a/drivers/staging/media/zoran/zoran_driver.c
> > +++ b/drivers/staging/media/zoran/zoran_driver.c
> > @@ -1020,7 +1020,7 @@ int zoran_queue_init(struct zoran *zr, struct 
> > vb2_queue *vq)
> > vq->buf_struct_size = sizeof(struct zr_buffer);
> > vq->ops = &zr_video_qops;
> > vq->mem_ops = &vb2_dma_contig_memops;
> > -   vq->gfp_flags = GFP_DMA32,
> > +   vq->gfp_flags = GFP_DMA32;
> 
> The commit doesn't match the patch.  Also this driver is in
> staging because it's going to be deleted soon so there probably isn't
> much point doing cleanups.
> 

No, the driver just came back in staging since I fixed the videobuf2 conversion.
One of the reason it is kept in staging is that media maintainer want to test 
it with its own zoran card but covid19 delayed the physical recovery of it.

So the patch need to be resent, please.

Regards
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 -next] media: zoran: convert comma to semicolon

2021-01-10 Thread LABBE Corentin
Le Fri, Jan 08, 2021 at 05:21:19PM +0800, Zheng Yongjun a écrit :
> Replace a comma between expression statements by a semicolon.
> 
> Signed-off-by: Zheng Yongjun 
> ---
>  drivers/staging/media/zoran/zoran_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/zoran/zoran_driver.c 
> b/drivers/staging/media/zoran/zoran_driver.c
> index 808196ea5b81..d60b4c73ea80 100644
> --- a/drivers/staging/media/zoran/zoran_driver.c
> +++ b/drivers/staging/media/zoran/zoran_driver.c
> @@ -1020,7 +1020,7 @@ int zoran_queue_init(struct zoran *zr, struct vb2_queue 
> *vq)
>   vq->buf_struct_size = sizeof(struct zr_buffer);
>   vq->ops = &zr_video_qops;
>   vq->mem_ops = &vb2_dma_contig_memops;
> - vq->gfp_flags = GFP_DMA32,
> + vq->gfp_flags = GFP_DMA32;
>   vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
>   vq->min_buffers_needed = 9;
>   vq->lock = &zr->lock;
> -- 
> 2.22.0
> 

Acked-by: Corentin Labbe 

Thanks!
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: Annotate user buffer with __user

2014-09-04 Thread LABBE Corentin
Fix the warning reported by sparse on 
drivers/staging/lustre/lnet/lnet/router_proc.c
warning: incorrect type in argument 4 (different address spaces)
The correction is to annotate all user buffer variable by __user

Signed-off-by: LABBE Corentin 
---
 .../staging/lustre/include/linux/libcfs/libcfs_debug.h  |  6 +++---
 drivers/staging/lustre/lnet/lnet/router_proc.c  | 13 +++--
 drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c | 17 +
 drivers/staging/lustre/lustre/libcfs/tracefile.c| 12 ++--
 drivers/staging/lustre/lustre/libcfs/tracefile.h| 10 +-
 5 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index 30098f3..aa9222c 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -265,9 +265,9 @@ int libcfs_debug_vmsg2(struct libcfs_debug_msg_data 
*msgdata,
 
 /* other external symbols that tracefile provides: */
 int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
-  const char *usr_buffer, int usr_buffer_nob);
-int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob,
-   const char *knl_buffer, char *append);
+   const char __user *usr_buffer, int usr_buffer_nob);
+int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob,
+   const char *knl_buffer, char *append);
 
 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
 
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c 
b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 166c1e6..6e8f7e2 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -90,9 +90,10 @@ enum {
 
 #define LNET_PROC_VERSION(v)   ((unsigned int)((v) & LNET_PROC_VER_MASK))
 
-static int proc_call_handler(void *data, int write, loff_t *ppos, void *buffer,
-size_t *lenp, int (*handler)(void *data, int write,
-loff_t pos, void *buffer, int len))
+static int proc_call_handler(void *data, int write, loff_t *ppos,
+   void __user *buffer, size_t *lenp,
+   int (*handler)(void *data, int write,
+   loff_t pos, void __user *buffer, int len))
 {
int rc = handler(data, write, *ppos, buffer, *lenp);
 
@@ -109,7 +110,7 @@ static int proc_call_handler(void *data, int write, loff_t 
*ppos, void *buffer,
 }
 
 static int __proc_lnet_stats(void *data, int write,
-loff_t pos, void *buffer, int nob)
+loff_t pos, void __user *buffer, int nob)
 {
int   rc;
lnet_counters_t *ctrs;
@@ -592,7 +593,7 @@ int proc_lnet_peers(struct ctl_table *table, int write, 
void __user *buffer,
 }
 
 static int __proc_lnet_buffers(void *data, int write,
-  loff_t pos, void *buffer, int nob)
+  loff_t pos, void __user *buffer, int nob)
 {
char*s;
char*tmpstr;
@@ -815,7 +816,7 @@ static struct lnet_portal_rotorsportal_rotors[] = {
 extern int portal_rotor;
 
 static int __proc_lnet_portal_rotor(void *data, int write,
-   loff_t pos, void *buffer, int nob)
+   loff_t pos, void __user *buffer, int nob)
 {
const int   buf_len = 128;
char*buf;
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
index 13a9266..bbe2c68 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
@@ -98,9 +98,10 @@ enum {
PSDEV_LNET_FAIL_VAL,  /* userdata for fail loc */
 };
 
-static int proc_call_handler(void *data, int write, loff_t *ppos, void *buffer,
-size_t *lenp, int (*handler)(void *data, int write,
-loff_t pos, void *buffer, int len))
+static int proc_call_handler(void *data, int write, loff_t *ppos,
+   void __user *buffer, size_t *lenp,
+   int (*handler)(void *data, int write,
+   loff_t pos, void __user *buffer, int len))
 {
int rc = handler(data, write, *ppos, buffer, *lenp);
 
@@ -117,7 +118,7 @@ static int proc_call_handler(void *data, int write, loff_t 
*ppos, void *buffer,
 }
 
 static int __proc_dobitmasks(void *data, int write,
-loff_t pos, void *buffer, int nob)
+loff_t pos, void __user *buffer, int nob)
 {
const int tmpstrlen = 512;
char *tmpstr;
@@ -168,7 +169,7 @@ static int min_watchdog_ratelimit = 0;/* disable 
ratelimiting 

[PATCH 1/4] Solves some problems reported by checkpatch

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 75ca15e..177e4b9 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -155,7 +155,7 @@ struct sep_queue_info *sep_queue_status_add(
unsigned long lck_flags;
struct sep_queue_info *my_elem = NULL;
 
-   my_elem = kzalloc(sizeof(struct sep_queue_info), GFP_KERNEL);
+   my_elem = kzalloc(sizeof(*my_elem), GFP_KERNEL);
 
if (!my_elem)
return NULL;
@@ -1006,8 +1006,8 @@ static int sep_crypto_dma(
return -ENOMEM;
}
 
-   sep_dma = kmalloc(sizeof(struct sep_dma_map) *
-   count_mapped, GFP_ATOMIC);
+   sep_dma = kmalloc_array(count_mapped, sizeof(struct sep_dma_map),
+   GFP_ATOMIC);
 
if (sep_dma == NULL) {
dev_dbg(&sep->pdev->dev, "Cannot allocate dma_maps\n");
@@ -1070,7 +1070,8 @@ static int sep_crypto_lli(
 
sep_map = *maps;
 
-   sep_lli = kmalloc(sizeof(struct sep_lli_entry) * nbr_ents, GFP_ATOMIC);
+   sep_lli = kmalloc_array(nbr_ents, sizeof(struct sep_lli_entry),
+   GFP_ATOMIC);
 
if (sep_lli == NULL) {
dev_dbg(&sep->pdev->dev, "Cannot allocate lli_maps\n");
@@ -3398,7 +3399,7 @@ static ssize_t sep_create_dcb_dmatables_context(struct 
sep_device *sep,
}
 
/* Allocate thread-specific memory for DCB */
-   *dcb_region = kzalloc(num_dcbs * sizeof(struct sep_dcblock),
+   *dcb_region = kcalloc(num_dcbs, sizeof(struct sep_dcblock),
  GFP_KERNEL);
if (!(*dcb_region)) {
error = -ENOMEM;
@@ -3480,7 +3481,7 @@ int sep_create_dcb_dmatables_context_kernel(struct 
sep_device *sep,
current->pid, num_dcbs);
 
/* Allocate thread-specific memory for DCB */
-   *dcb_region = kzalloc(num_dcbs * sizeof(struct sep_dcblock),
+   *dcb_region = kcalloc(num_dcbs, sizeof(struct sep_dcblock),
  GFP_KERNEL);
if (!(*dcb_region)) {
error = -ENOMEM;
@@ -4090,7 +4091,7 @@ static int sep_probe(struct pci_dev *pdev,
}
 
/* Allocate the sep_device structure for this device */
-   sep_dev = kzalloc(sizeof(struct sep_device), GFP_ATOMIC);
+   sep_dev = kzalloc(sizeof(*sep_dev), GFP_ATOMIC);
if (sep_dev == NULL) {
error = -ENOMEM;
goto end_function_disable_device;
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Fix blank lines issue reported by checkpatch

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 47 --
 1 file changed, 4 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 6f98881..89a1d53 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -492,7 +492,6 @@ int sep_free_dma_table_data_handler(struct sep_device *sep,
 * memory is not available to the o/s at all.
 */
if (!(*dma_ctx)->secure_dma && dma->out_map_array) {
-
for (count = 0; count < dma->out_num_pages; count++) {
dma_unmap_page(&sep->pdev->dev,
dma->out_map_array[count].dma_addr,
@@ -513,7 +512,6 @@ int sep_free_dma_table_data_handler(struct sep_device *sep,
 
/* Again, we do this only for non secure dma */
if (!(*dma_ctx)->secure_dma && dma->out_page_array) {
-
for (count = 0; count < dma->out_num_pages; count++) {
if (!PageReserved(dma->out_page_array[count]))
 
@@ -633,7 +631,6 @@ static int sep_end_transaction_handler(struct sep_device 
*sep,
return 0;
 }
 
-
 /**
  * sep_release - close a SEP device
  * @inode: inode of SEP device
@@ -766,7 +763,6 @@ static unsigned int sep_poll(struct file *filp, poll_table 
*wait)
goto end_function;
}
 
-
/* Add the event to the polling wait table */
dev_dbg(&sep->pdev->dev, "[PID%d] poll: calling wait sep_event\n",
current->pid);
@@ -856,7 +852,6 @@ static unsigned long sep_set_time(struct sep_device *sep)
struct timeval time;
u32 *time_addr; /* Address of time as seen by the kernel */
 
-
do_gettimeofday(&time);
 
/* Set value in the SYSTEM MEMORY offset */
@@ -905,7 +900,6 @@ int sep_send_command_handler(struct sep_device *sep)
msg_pool += 1;
if ((*msg_pool < 2) ||
(*msg_pool > SEP_DRIVER_MAX_MESSAGE_SIZE_IN_BYTES)) {
-
dev_warn(&sep->pdev->dev, "invalid message size\n");
error = -EPROTO;
goto end_function;
@@ -1023,7 +1017,6 @@ static int sep_crypto_dma(
 
*dma_maps = sep_dma;
return count_mapped;
-
 }
 
 /**
@@ -1053,7 +1046,6 @@ static int sep_crypto_lli(
u32 data_size,
enum dma_data_direction direction)
 {
-
int ct1;
struct sep_lli_entry *sep_lli;
struct sep_dma_map *sep_map;
@@ -1318,7 +1310,6 @@ static int sep_lock_user_pages(struct sep_device *sep,
(unsigned long)lli_array[0].bus_address,
lli_array[0].block_size);
 
-
/* Check the size of the last page */
if (num_pages > 1) {
lli_array[num_pages - 1].block_size =
@@ -1663,7 +1654,6 @@ static void sep_build_lli_table(struct sep_device *sep,
 
/* Set the output parameter */
*num_processed_entries_ptr += array_counter;
-
 }
 
 /**
@@ -1747,7 +1737,6 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
/* Print entries of the table (without info entry) */
for (entries_count = 0; entries_count < num_table_entries;
entries_count++, lli_table_ptr++) {
-
dev_dbg(&sep->pdev->dev,
"[PID%d] lli_table_ptr address is %08lx\n",
current->pid,
@@ -1773,7 +1762,6 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
current->pid,
(unsigned long)lli_table_ptr->bus_address);
 
-
table_data_size = lli_table_ptr->block_size & 0xff;
num_table_entries = (lli_table_ptr->block_size >> 24) & 0xff;
 
@@ -1796,7 +1784,6 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
 #endif
 }
 
-
 /**
  * sep_prepare_empty_lli_table - create a blank LLI table
  * @sep: pointer to struct sep_device
@@ -1972,7 +1959,6 @@ static int sep_prepare_input_dma_table(struct sep_device 
*sep,
 
/* Loop till all the entries in in array are processed */
while (current_entry < sep_lli_entries) {
-
/* Set the new input and output tables */
in_lli_table_ptr =
(struct sep_lli_entry *)lli_table_alloc_addr;
@@ -1988,10 +1974,8 @@ static int sep_prepare_input_dma_table(struct sep_device 
*sep,
((void *)sep->shared_addr +
SYNCHRONIC_DMA_TABLES_AREA_OFFSET_BYTES +
SYNCHRONIC_DMA_TABLES_AREA_SIZE_BYTES)) {
-
error = 

[PATCH 3/4] Fix misceanellous problems reported by checkpatch

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 1580d95f..6f98881 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -130,7 +130,6 @@ void sep_queue_status_remove(struct sep_device *sep,
 
dev_dbg(&sep->pdev->dev, "[PID%d] sep_queue_status_remove return\n",
current->pid);
-   return;
 }
 
 /**
@@ -1737,7 +1736,7 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
return;
}
 
-   while ((unsigned long) lli_table_ptr->bus_address != 0x) {
+   while ((unsigned long)lli_table_ptr->bus_address != 0x) {
dev_dbg(&sep->pdev->dev,
"[PID%d] lli table %08lx, table_data_size is (hex) 
%lx\n",
current->pid, table_count, table_data_size);
@@ -1752,7 +1751,7 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
dev_dbg(&sep->pdev->dev,
"[PID%d] lli_table_ptr address is %08lx\n",
current->pid,
-   (unsigned long) lli_table_ptr);
+   (unsigned long)lli_table_ptr);
 
dev_dbg(&sep->pdev->dev,
"[PID%d] phys address is %08lx block size is 
(hex) %x\n",
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Fix issues reported by checkpatch

2014-07-19 Thread LABBE Corentin
Hello

The drivers/staging/sep/sep_main.c have lots of checkpatch issue.
This patch series solves them and since there are many, I have splitted 
corrections in 4 patch.

Note that this work is done for the Eudyptulla Challenge.

Best regards

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] No else is necessary after a break (reported by checkpatch)

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 177e4b9..1580d95f 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -2881,12 +2881,11 @@ static int sep_free_dma_tables_and_dcb(struct 
sep_device *sep, bool isapplet,
if (is_kva) {
error = -ENODEV;
break;
-   } else {
-   error_temp = copy_to_user(
+   }
+   error_temp = copy_to_user(
(void __user *)tail_pt,
dcb_table_ptr->tail_data,
dcb_table_ptr->tail_data_size);
-   }
if (error_temp) {
/* Release the DMA resource */
error = -EFAULT;
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: sep: Fix issues reported by checkpatch

2014-07-19 Thread LABBE Corentin
Hello

The drivers/staging/sep/sep_main.c have lots of checkpatch issue.
This patch series solves them and since there are many, I have splitted 
corrections in 4 patch.

Note that this work is done for the Eudyptulla Challenge.

Best regards

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] staging: sep: No else is necessary after a break (reported by checkpatch)

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 177e4b9..1580d95f 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -2881,12 +2881,11 @@ static int sep_free_dma_tables_and_dcb(struct 
sep_device *sep, bool isapplet,
if (is_kva) {
error = -ENODEV;
break;
-   } else {
-   error_temp = copy_to_user(
+   }
+   error_temp = copy_to_user(
(void __user *)tail_pt,
dcb_table_ptr->tail_data,
dcb_table_ptr->tail_data_size);
-   }
if (error_temp) {
/* Release the DMA resource */
error = -EFAULT;
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] staging: sep: Fix misceanellous problems reported by checkpatch

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 1580d95f..6f98881 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -130,7 +130,6 @@ void sep_queue_status_remove(struct sep_device *sep,
 
dev_dbg(&sep->pdev->dev, "[PID%d] sep_queue_status_remove return\n",
current->pid);
-   return;
 }
 
 /**
@@ -1737,7 +1736,7 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
return;
}
 
-   while ((unsigned long) lli_table_ptr->bus_address != 0x) {
+   while ((unsigned long)lli_table_ptr->bus_address != 0x) {
dev_dbg(&sep->pdev->dev,
"[PID%d] lli table %08lx, table_data_size is (hex) 
%lx\n",
current->pid, table_count, table_data_size);
@@ -1752,7 +1751,7 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
dev_dbg(&sep->pdev->dev,
"[PID%d] lli_table_ptr address is %08lx\n",
current->pid,
-   (unsigned long) lli_table_ptr);
+   (unsigned long)lli_table_ptr);
 
dev_dbg(&sep->pdev->dev,
"[PID%d] phys address is %08lx block size is 
(hex) %x\n",
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] staging: sep: Solves some problems reported by checkpatch

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 75ca15e..177e4b9 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -155,7 +155,7 @@ struct sep_queue_info *sep_queue_status_add(
unsigned long lck_flags;
struct sep_queue_info *my_elem = NULL;
 
-   my_elem = kzalloc(sizeof(struct sep_queue_info), GFP_KERNEL);
+   my_elem = kzalloc(sizeof(*my_elem), GFP_KERNEL);
 
if (!my_elem)
return NULL;
@@ -1006,8 +1006,8 @@ static int sep_crypto_dma(
return -ENOMEM;
}
 
-   sep_dma = kmalloc(sizeof(struct sep_dma_map) *
-   count_mapped, GFP_ATOMIC);
+   sep_dma = kmalloc_array(count_mapped, sizeof(struct sep_dma_map),
+   GFP_ATOMIC);
 
if (sep_dma == NULL) {
dev_dbg(&sep->pdev->dev, "Cannot allocate dma_maps\n");
@@ -1070,7 +1070,8 @@ static int sep_crypto_lli(
 
sep_map = *maps;
 
-   sep_lli = kmalloc(sizeof(struct sep_lli_entry) * nbr_ents, GFP_ATOMIC);
+   sep_lli = kmalloc_array(nbr_ents, sizeof(struct sep_lli_entry),
+   GFP_ATOMIC);
 
if (sep_lli == NULL) {
dev_dbg(&sep->pdev->dev, "Cannot allocate lli_maps\n");
@@ -3398,7 +3399,7 @@ static ssize_t sep_create_dcb_dmatables_context(struct 
sep_device *sep,
}
 
/* Allocate thread-specific memory for DCB */
-   *dcb_region = kzalloc(num_dcbs * sizeof(struct sep_dcblock),
+   *dcb_region = kcalloc(num_dcbs, sizeof(struct sep_dcblock),
  GFP_KERNEL);
if (!(*dcb_region)) {
error = -ENOMEM;
@@ -3480,7 +3481,7 @@ int sep_create_dcb_dmatables_context_kernel(struct 
sep_device *sep,
current->pid, num_dcbs);
 
/* Allocate thread-specific memory for DCB */
-   *dcb_region = kzalloc(num_dcbs * sizeof(struct sep_dcblock),
+   *dcb_region = kcalloc(num_dcbs, sizeof(struct sep_dcblock),
  GFP_KERNEL);
if (!(*dcb_region)) {
error = -ENOMEM;
@@ -4090,7 +4091,7 @@ static int sep_probe(struct pci_dev *pdev,
}
 
/* Allocate the sep_device structure for this device */
-   sep_dev = kzalloc(sizeof(struct sep_device), GFP_ATOMIC);
+   sep_dev = kzalloc(sizeof(*sep_dev), GFP_ATOMIC);
if (sep_dev == NULL) {
error = -ENOMEM;
goto end_function_disable_device;
-- 
1.8.5.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] staging: sep: Fix blank lines issue reported by checkpatch

2014-07-19 Thread LABBE Corentin
Signed-off-by: LABBE Corentin 
---
 drivers/staging/sep/sep_main.c | 47 --
 1 file changed, 4 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index 6f98881..89a1d53 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -492,7 +492,6 @@ int sep_free_dma_table_data_handler(struct sep_device *sep,
 * memory is not available to the o/s at all.
 */
if (!(*dma_ctx)->secure_dma && dma->out_map_array) {
-
for (count = 0; count < dma->out_num_pages; count++) {
dma_unmap_page(&sep->pdev->dev,
dma->out_map_array[count].dma_addr,
@@ -513,7 +512,6 @@ int sep_free_dma_table_data_handler(struct sep_device *sep,
 
/* Again, we do this only for non secure dma */
if (!(*dma_ctx)->secure_dma && dma->out_page_array) {
-
for (count = 0; count < dma->out_num_pages; count++) {
if (!PageReserved(dma->out_page_array[count]))
 
@@ -633,7 +631,6 @@ static int sep_end_transaction_handler(struct sep_device 
*sep,
return 0;
 }
 
-
 /**
  * sep_release - close a SEP device
  * @inode: inode of SEP device
@@ -766,7 +763,6 @@ static unsigned int sep_poll(struct file *filp, poll_table 
*wait)
goto end_function;
}
 
-
/* Add the event to the polling wait table */
dev_dbg(&sep->pdev->dev, "[PID%d] poll: calling wait sep_event\n",
current->pid);
@@ -856,7 +852,6 @@ static unsigned long sep_set_time(struct sep_device *sep)
struct timeval time;
u32 *time_addr; /* Address of time as seen by the kernel */
 
-
do_gettimeofday(&time);
 
/* Set value in the SYSTEM MEMORY offset */
@@ -905,7 +900,6 @@ int sep_send_command_handler(struct sep_device *sep)
msg_pool += 1;
if ((*msg_pool < 2) ||
(*msg_pool > SEP_DRIVER_MAX_MESSAGE_SIZE_IN_BYTES)) {
-
dev_warn(&sep->pdev->dev, "invalid message size\n");
error = -EPROTO;
goto end_function;
@@ -1023,7 +1017,6 @@ static int sep_crypto_dma(
 
*dma_maps = sep_dma;
return count_mapped;
-
 }
 
 /**
@@ -1053,7 +1046,6 @@ static int sep_crypto_lli(
u32 data_size,
enum dma_data_direction direction)
 {
-
int ct1;
struct sep_lli_entry *sep_lli;
struct sep_dma_map *sep_map;
@@ -1318,7 +1310,6 @@ static int sep_lock_user_pages(struct sep_device *sep,
(unsigned long)lli_array[0].bus_address,
lli_array[0].block_size);
 
-
/* Check the size of the last page */
if (num_pages > 1) {
lli_array[num_pages - 1].block_size =
@@ -1663,7 +1654,6 @@ static void sep_build_lli_table(struct sep_device *sep,
 
/* Set the output parameter */
*num_processed_entries_ptr += array_counter;
-
 }
 
 /**
@@ -1747,7 +1737,6 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
/* Print entries of the table (without info entry) */
for (entries_count = 0; entries_count < num_table_entries;
entries_count++, lli_table_ptr++) {
-
dev_dbg(&sep->pdev->dev,
"[PID%d] lli_table_ptr address is %08lx\n",
current->pid,
@@ -1773,7 +1762,6 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
current->pid,
(unsigned long)lli_table_ptr->bus_address);
 
-
table_data_size = lli_table_ptr->block_size & 0xff;
num_table_entries = (lli_table_ptr->block_size >> 24) & 0xff;
 
@@ -1796,7 +1784,6 @@ static void sep_debug_print_lli_tables(struct sep_device 
*sep,
 #endif
 }
 
-
 /**
  * sep_prepare_empty_lli_table - create a blank LLI table
  * @sep: pointer to struct sep_device
@@ -1972,7 +1959,6 @@ static int sep_prepare_input_dma_table(struct sep_device 
*sep,
 
/* Loop till all the entries in in array are processed */
while (current_entry < sep_lli_entries) {
-
/* Set the new input and output tables */
in_lli_table_ptr =
(struct sep_lli_entry *)lli_table_alloc_addr;
@@ -1988,10 +1974,8 @@ static int sep_prepare_input_dma_table(struct sep_device 
*sep,
((void *)sep->shared_addr +
SYNCHRONIC_DMA_TABLES_AREA_OFFSET_BYTES +
SYNCHRONIC_DMA_TABLES_AREA_SIZE_BYTES)) {
-
error = 

Re: [PATCH] staging: media: remove unused VIDEO_ATOMISP_OV8858 kconfig

2018-01-26 Thread LABBE Corentin
On Tue, Jan 23, 2018 at 07:20:12PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Jan 23, 2018 at 07:31:27PM +0200, Andy Shevchenko wrote:
> > On Tue, Jan 23, 2018 at 4:37 PM, Corentin Labbe  wrote:
> > > Nothing in kernel use VIDEO_ATOMISP_OV8858 since commit 3a81c7660f80 
> > > ("media: staging: atomisp: Remove IMX sensor support")
> > > Lets remove this kconfig option.
> > 
> > First of all, I hardly understand how that change is related.
> > Second, did you check Makefile?
> 
> I don't see it being used in any Makefile, what file do you see it:
>   $ git grep VIDEO_ATOMISP_OV8858
>   drivers/staging/media/atomisp/i2c/Kconfig:config VIDEO_ATOMISP_OV8858
> 
> So it should be removed.
> 
> thanks,
> 

Hello

I just see that 3a81c7660f80 left ov8858.c so do you agree that I send a v2 
which remove also this file ?
av8858.c is useless without dw9718.c and vcm.c which 3a81c7660f80 removed.

Regards
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: media: atomisp2: remove unused headers

2018-01-29 Thread LABBE Corentin
On Mon, Jan 29, 2018 at 03:22:33PM +0200, Andy Shevchenko wrote:
> On Mon, Jan 29, 2018 at 3:11 PM, Corentin Labbe  wrote:
> > All thoses headers are not used by any source files.
> > Lets just remove them.
> 
> How did you test this?
> 
> P.S. I like the patch, but since driver in a state of coma vigil, I'm
> afraid you may do something which shouldn't be done for working
> driver.
> 

For testing I have:
- successfully compiling the driver
- for each file, grepping its name in tree to be sure that no one uses it.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel