Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Greg Kroah-Hartman
On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> fixed a sparse warning by changing the type in
> assignment from void [noderef] __user * to unsigned int *
> (different address space)
> 
> Signed-off-by: B K Karthik 
> ---
>  drivers/staging/comedi/comedi_fops.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/comedi_fops.c 
> b/drivers/staging/comedi/comedi_fops.c
> index 3f70e5dfac39..4cc012e231b7 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
>   cmd->scan_end_arg = v32.scan_end_arg;
>   cmd->stop_src = v32.stop_src;
>   cmd->stop_arg = v32.stop_arg;
> - cmd->chanlist = compat_ptr(v32.chanlist);
> + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
>   cmd->chanlist_len = v32.chanlist_len;
>   cmd->data = compat_ptr(v32.data);
>   cmd->data_len = v32.data_len;

Always run your patches through checkpatch before sending them, so you
do not have a grumpy maintainer telling you that you have to run
checkpatch on your patch before sending them.

thanks,

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


Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Greg KH
On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
> On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> > A coding alignment issue is found by checkpatch.pl.
> > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
> > 
> > Signed-off-by: Zhixu Zhao 
> 
> Hi, there~
> 
> Does anybody have any further comments on this?
> Can it be merged?

I never saw the first version of this, are you sure it got sent to the
mailing list?  It's not in any archives anywhere.

Also, 3 days is really fast for a simple coding style cleanup to be
worried about.  Give it usually at least 2 weeks.

thanks,

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


Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Joe Perches
On Wed, 2020-07-15 at 09:17 +0200, Greg KH wrote:
> On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
> > On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> > > A coding alignment issue is found by checkpatch.pl.
> > > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
> > > 
> > > Signed-off-by: Zhixu Zhao 
> > 
> > Hi, there~
> > 
> > Does anybody have any further comments on this?
> > Can it be merged?
> 
> I never saw the first version of this, are you sure it got sent to the
> mailing list?  It's not in any archives anywhere.

I saw it.  It's here:
https://lore.kernel.org/lkml/20200617161127.32006-1-zhixu...@126.com/

> Also, 3 days is really fast for a simple coding style cleanup to be
> worried about.  Give it usually at least 2 weeks.

Originally sent June 17.



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


Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Greg KH
On Wed, Jul 15, 2020 at 12:24:22AM -0700, Joe Perches wrote:
> On Wed, 2020-07-15 at 09:17 +0200, Greg KH wrote:
> > On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
> > > On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> > > > A coding alignment issue is found by checkpatch.pl.
> > > > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
> > > > 
> > > > Signed-off-by: Zhixu Zhao 
> > > 
> > > Hi, there~
> > > 
> > > Does anybody have any further comments on this?
> > > Can it be merged?
> > 
> > I never saw the first version of this, are you sure it got sent to the
> > mailing list?  It's not in any archives anywhere.
> 
> I saw it.  It's here:
> https://lore.kernel.org/lkml/20200617161127.32006-1-zhixu...@126.com/

Ah, doh, sorry.

Zhixu, please address the comments given to you on the series and resend
it as a new version.

thanks,

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 3:08 AM Greg Kroah-Hartman
 wrote:
>
> On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > fixed a sparse warning by changing the type in
> > assignment from void [noderef] __user * to unsigned int *
> > (different address space)
> >
> > Signed-off-by: B K Karthik 
> > ---
> >  drivers/staging/comedi/comedi_fops.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/comedi/comedi_fops.c 
> > b/drivers/staging/comedi/comedi_fops.c
> > index 3f70e5dfac39..4cc012e231b7 100644
> > --- a/drivers/staging/comedi/comedi_fops.c
> > +++ b/drivers/staging/comedi/comedi_fops.c
> > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
> >   cmd->scan_end_arg = v32.scan_end_arg;
> >   cmd->stop_src = v32.stop_src;
> >   cmd->stop_arg = v32.stop_arg;
> > - cmd->chanlist = compat_ptr(v32.chanlist);
> > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> >   cmd->chanlist_len = v32.chanlist_len;
> >   cmd->data = compat_ptr(v32.data);
> >   cmd->data_len = v32.data_len;
>
> Always run your patches through checkpatch before sending them, so you
> do not have a grumpy maintainer telling you that you have to run
> checkpatch on your patch before sending them.

I will, Sorry for that.

But this particular error which showed up after running checkpatch is
something 'git format-patch' does unintentionally.
It has been reported to the maintainers.

thanks,

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Greg Kroah-Hartman
On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> gre...@linuxfoundation.org> wrote:
> 
> > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > fixed a sparse warning by changing the type in
> > > assignment from void [noderef] __user * to unsigned int *
> > > (different address space)
> > >
> > > Signed-off-by: B K Karthik 
> > > ---
> > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > b/drivers/staging/comedi/comedi_fops.c
> > > index 3f70e5dfac39..4cc012e231b7 100644
> > > --- a/drivers/staging/comedi/comedi_fops.c
> > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
> > >   cmd->scan_end_arg = v32.scan_end_arg;
> > >   cmd->stop_src = v32.stop_src;
> > >   cmd->stop_arg = v32.stop_arg;
> > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > >   cmd->chanlist_len = v32.chanlist_len;
> > >   cmd->data = compat_ptr(v32.data);
> > >   cmd->data_len = v32.data_len;
> >
> > Always run your patches through checkpatch before sending them, so you
> > do not have a grumpy maintainer telling you that you have to run
> > checkpatch on your patch before sending them.
> >
> 
> I will. Sorry for that.
> 
> But the error that's being shown in this patch is something that comes up
> on its own.

No it is not.

> git format-patch leaves trailing whitespace in blank lines.

It does?  Where is any trailing whitespace here?  That's not the issue.

> It has been reported to the maintainers.

It was?  Where?

thanks,

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


Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Dan Carpenter
On Wed, Jul 15, 2020 at 09:57:55AM +0200, Greg KH wrote:
> On Wed, Jul 15, 2020 at 12:24:22AM -0700, Joe Perches wrote:
> > On Wed, 2020-07-15 at 09:17 +0200, Greg KH wrote:
> > > On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
> > > > On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> > > > > A coding alignment issue is found by checkpatch.pl.
> > > > > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
> > > > > 
> > > > > Signed-off-by: Zhixu Zhao 
> > > > 
> > > > Hi, there~
> > > > 
> > > > Does anybody have any further comments on this?
> > > > Can it be merged?
> > > 
> > > I never saw the first version of this, are you sure it got sent to the
> > > mailing list?  It's not in any archives anywhere.
> > 
> > I saw it.  It's here:
> > https://lore.kernel.org/lkml/20200617161127.32006-1-zhixu...@126.com/
> 
> Ah, doh, sorry.
> 
> Zhixu, please address the comments given to you on the series and resend
> it as a new version.

He responded but not as a reply to my email.  It turns out I made a
mistake.

Anyway, just resend, Zhixu.

regards,
dan carpenter

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
 wrote:
>
> On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > gre...@linuxfoundation.org> wrote:
> >
> > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > fixed a sparse warning by changing the type in
> > > > assignment from void [noderef] __user * to unsigned int *
> > > > (different address space)
> > > >
> > > > Signed-off-by: B K Karthik 
> > > > ---
> > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > b/drivers/staging/comedi/comedi_fops.c
> > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
> > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > >   cmd->stop_src = v32.stop_src;
> > > >   cmd->stop_arg = v32.stop_arg;
> > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > >   cmd->chanlist_len = v32.chanlist_len;
> > > >   cmd->data = compat_ptr(v32.data);
> > > >   cmd->data_len = v32.data_len;
> > >
> > > Always run your patches through checkpatch before sending them, so you
> > > do not have a grumpy maintainer telling you that you have to run
> > > checkpatch on your patch before sending them.
> > >
> >
> > I will. Sorry for that.
> >
> > But the error that's being shown in this patch is something that comes up
> > on its own.
>
> No it is not.
>
> > git format-patch leaves trailing whitespace in blank lines.
>
> It does?  Where is any trailing whitespace here?  That's not the issue.

To give you an example,
https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
was a patch i submitted recently.
This is what checkpatch has to say:

$ perl scripts/checkpatch.pl -f
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
ERROR: trailing whitespace
#21: FILE: 
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
+ $

ERROR: trailing whitespace
#23: FILE: 
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
+ $

ERROR: trailing whitespace
#30: FILE: 
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
+ $

ERROR: trailing whitespace
#37: FILE: 
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
+ $

ERROR: trailing whitespace
#44: FILE: 
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
+ $

ERROR: trailing whitespace
#51: FILE: 
../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
+-- $

total: 6 errors, 0 warnings, 53 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
  mechanically convert to the typical style using --fix or --fix-inplace.

NOTE: Whitespace errors detected.
  You may wish to use scripts/cleanpatch or scripts/cleanfile

../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
has style problems, please review.

NOTE: If any of the errors are false positives, please report
  them to the maintainer, see CHECKPATCH in MAINTAINERS.

Does this happen only to patches I make? Am I making a silly mistake
while making a patch?
I use 'git format-patch -1' to generate the patch file.
If I am going wrong somewhere, please let me know.

>
> > It has been reported to the maintainers.
>
> It was?  Where?

I am extremely sorry, I should have verified if it was indeed reported
before telling it out.
It has not been reported (yet).
I apologise for my mistake.

thanks,

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 4:41 AM B K Karthik  wrote:
>
> On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
>  wrote:
> >
> > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > gre...@linuxfoundation.org> wrote:
> > >
> > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > fixed a sparse warning by changing the type in
> > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > (different address space)
> > > > >
> > > > > Signed-off-by: B K Karthik 
> > > > > ---
> > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd 
> > > > > *cmd,
> > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > >   cmd->stop_src = v32.stop_src;
> > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > >   cmd->data = compat_ptr(v32.data);
> > > > >   cmd->data_len = v32.data_len;
> > > >
> > > > Always run your patches through checkpatch before sending them, so you
> > > > do not have a grumpy maintainer telling you that you have to run
> > > > checkpatch on your patch before sending them.
> > > >
> > >
> > > I will. Sorry for that.
> > >
> > > But the error that's being shown in this patch is something that comes up
> > > on its own.
> >
> > No it is not.
> >
> > > git format-patch leaves trailing whitespace in blank lines.
> >
> > It does?  Where is any trailing whitespace here?  That's not the issue.
>
> To give you an example,
> https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> was a patch i submitted recently.
> This is what checkpatch has to say:
>
> $ perl scripts/checkpatch.pl -f
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> ERROR: trailing whitespace
> #21: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> + $
>
> ERROR: trailing whitespace
> #23: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> + $
>
> ERROR: trailing whitespace
> #30: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> + $
>
> ERROR: trailing whitespace
> #37: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> + $
>
> ERROR: trailing whitespace
> #44: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> + $
>
> ERROR: trailing whitespace
> #51: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> +-- $
>
> total: 6 errors, 0 warnings, 53 lines checked
>
> NOTE: For some of the reported defects, checkpatch may be able to
>   mechanically convert to the typical style using --fix or --fix-inplace.
>
> NOTE: Whitespace errors detected.
>   You may wish to use scripts/cleanpatch or scripts/cleanfile
>
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> has style problems, please review.
>
> NOTE: If any of the errors are false positives, please report
>   them to the maintainer, see CHECKPATCH in MAINTAINERS.
>
> Does this happen only to patches I make? Am I making a silly mistake
> while making a patch?
> I use 'git format-patch -1' to generate the patch file.
> If I am going wrong somewhere, please let me know.

Also, The patch I sent (this thread):
$ perl scripts/checkpatch.pl -f
./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch
ERROR: trailing whitespace
#29: FILE: ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch:29:
+-- $

total: 1 errors, 0 warnings, 31 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
  mechanically convert to the typical style using --fix or --fix-inplace.

NOTE: Whitespace errors detected.
  You may wish to use scripts/cleanpatch or scripts/cleanfile

./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch has
style problems, please review.

NOTE: If any of the errors are false positives, please report
  them to the maintainer, see CHECKPATCH in MAINTAINERS.

Am I using 'git format-patch' or 'checkpatch.pl' the wrong way?

thanks,

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


Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Joe Perches
On Wed, 2020-07-15 at 11:37 +0300, Dan Carpenter wrote:
> On Wed, Jul 15, 2020 at 09:57:55AM +0200, Greg KH wrote:
> > On Wed, Jul 15, 2020 at 12:24:22AM -0700, Joe Perches wrote:
> > > On Wed, 2020-07-15 at 09:17 +0200, Greg KH wrote:
> > > > On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
> > > > > On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> > > > > > A coding alignment issue is found by checkpatch.pl.
> > > > > > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
> > > > > > 
> > > > > > Signed-off-by: Zhixu Zhao 
> > > > > 
> > > > > Hi, there~
> > > > > 
> > > > > Does anybody have any further comments on this?
> > > > > Can it be merged?
> > > > 
> > > > I never saw the first version of this, are you sure it got sent to the
> > > > mailing list?  It's not in any archives anywhere.
> > > 
> > > I saw it.  It's here:
> > > https://lore.kernel.org/lkml/20200617161127.32006-1-zhixu...@126.com/
> > 
> > Ah, doh, sorry.
> > 
> > Zhixu, please address the comments given to you on the series and resend
> > it as a new version.
> 
> He responded but not as a reply to my email.  It turns out I made a
> mistake.
> 
> Anyway, just resend, Zhixu.

It's a pity a resend is being requested.

It'd be a better process if the original patch could
be applied via the link akin to a git pull.


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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Greg Kroah-Hartman
On Wed, Jul 15, 2020 at 04:41:52AM -0400, B K Karthik wrote:
> On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
>  wrote:
> >
> > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > gre...@linuxfoundation.org> wrote:
> > >
> > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > fixed a sparse warning by changing the type in
> > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > (different address space)
> > > > >
> > > > > Signed-off-by: B K Karthik 
> > > > > ---
> > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd 
> > > > > *cmd,
> > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > >   cmd->stop_src = v32.stop_src;
> > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > >   cmd->data = compat_ptr(v32.data);
> > > > >   cmd->data_len = v32.data_len;
> > > >
> > > > Always run your patches through checkpatch before sending them, so you
> > > > do not have a grumpy maintainer telling you that you have to run
> > > > checkpatch on your patch before sending them.
> > > >
> > >
> > > I will. Sorry for that.
> > >
> > > But the error that's being shown in this patch is something that comes up
> > > on its own.
> >
> > No it is not.
> >
> > > git format-patch leaves trailing whitespace in blank lines.
> >
> > It does?  Where is any trailing whitespace here?  That's not the issue.
> 
> To give you an example,
> https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> was a patch i submitted recently.
> This is what checkpatch has to say:
> 
> $ perl scripts/checkpatch.pl -f
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> ERROR: trailing whitespace
> #21: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> + $
> 
> ERROR: trailing whitespace
> #23: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> + $
> 
> ERROR: trailing whitespace
> #30: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> + $
> 
> ERROR: trailing whitespace
> #37: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> + $
> 
> ERROR: trailing whitespace
> #44: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> + $
> 
> ERROR: trailing whitespace
> #51: FILE: 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> +-- $
> 
> total: 6 errors, 0 warnings, 53 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>   mechanically convert to the typical style using --fix or --fix-inplace.
> 
> NOTE: Whitespace errors detected.
>   You may wish to use scripts/cleanpatch or scripts/cleanfile
> 
> ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> has style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>   them to the maintainer, see CHECKPATCH in MAINTAINERS.
> 
> Does this happen only to patches I make? Am I making a silly mistake
> while making a patch?

I don't get that error at all, here's all I get with that patch:

$ ./scripts/checkpatch.pl x.patch
WARNING: Missing Signed-off-by: line by nominal patch author ''

total: 0 errors, 1 warnings, 0 checks, 30 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
  mechanically convert to the typical style using --fix or --fix-inplace.

x.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
  them to the maintainer, see CHECKPATCH in MAINTAINERS.



That warning is because I just saved the body of your email as a patch,
watch out when you try to check signed emails like you are doing here.

> I use 'git format-patch -1' to generate the patch file.
> If I am going wrong somewhere, please let me know.

Seems to work for me :)

thanks,

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Greg Kroah-Hartman
On Wed, Jul 15, 2020 at 04:47:48AM -0400, B K Karthik wrote:
> On Wed, Jul 15, 2020 at 4:41 AM B K Karthik  wrote:
> >
> > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
> >  wrote:
> > >
> > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > > gre...@linuxfoundation.org> wrote:
> > > >
> > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > > fixed a sparse warning by changing the type in
> > > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > > (different address space)
> > > > > >
> > > > > > Signed-off-by: B K Karthik 
> > > > > > ---
> > > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd 
> > > > > > *cmd,
> > > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > > >   cmd->stop_src = v32.stop_src;
> > > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > > >   cmd->data = compat_ptr(v32.data);
> > > > > >   cmd->data_len = v32.data_len;
> > > > >
> > > > > Always run your patches through checkpatch before sending them, so you
> > > > > do not have a grumpy maintainer telling you that you have to run
> > > > > checkpatch on your patch before sending them.
> > > > >
> > > >
> > > > I will. Sorry for that.
> > > >
> > > > But the error that's being shown in this patch is something that comes 
> > > > up
> > > > on its own.
> > >
> > > No it is not.
> > >
> > > > git format-patch leaves trailing whitespace in blank lines.
> > >
> > > It does?  Where is any trailing whitespace here?  That's not the issue.
> >
> > To give you an example,
> > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> > was a patch i submitted recently.
> > This is what checkpatch has to say:
> >
> > $ perl scripts/checkpatch.pl -f
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > ERROR: trailing whitespace
> > #21: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> > + $
> >
> > ERROR: trailing whitespace
> > #23: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> > + $
> >
> > ERROR: trailing whitespace
> > #30: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> > + $
> >
> > ERROR: trailing whitespace
> > #37: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> > + $
> >
> > ERROR: trailing whitespace
> > #44: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> > + $
> >
> > ERROR: trailing whitespace
> > #51: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> > +-- $
> >
> > total: 6 errors, 0 warnings, 53 lines checked
> >
> > NOTE: For some of the reported defects, checkpatch may be able to
> >   mechanically convert to the typical style using --fix or 
> > --fix-inplace.
> >
> > NOTE: Whitespace errors detected.
> >   You may wish to use scripts/cleanpatch or scripts/cleanfile
> >
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > has style problems, please review.
> >
> > NOTE: If any of the errors are false positives, please report
> >   them to the maintainer, see CHECKPATCH in MAINTAINERS.
> >
> > Does this happen only to patches I make? Am I making a silly mistake
> > while making a patch?
> > I use 'git format-patch -1' to generate the patch file.
> > If I am going wrong somewhere, please let me know.
> 
> Also, The patch I sent (this thread):
> $ perl scripts/checkpatch.pl -f
> ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch
> ERROR: trailing whitespace
> #29: FILE: 
> ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch:29:
> +-- $
> 
> total: 1 errors, 0 warnings, 31 lines checked
> 
> NOTE: For some of the reported defects, checkpatch may be able to
>   mechanically convert to the typical style using --fix or --fix-inplace.
> 
> NOTE: Whitespace errors detected.
>   You may wish to use scripts/cleanpatch or scripts/cleanfile
> 
> ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch has
> style problems, please review.
> 
> NOTE: If any of the errors are false positives, please report
>   them to the maintaine

Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 5:14 AM Greg Kroah-Hartman
 wrote:
>
> On Wed, Jul 15, 2020 at 04:41:52AM -0400, B K Karthik wrote:
> > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
> >  wrote:
> > >
> > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > > gre...@linuxfoundation.org> wrote:
> > > >
> > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > > fixed a sparse warning by changing the type in
> > > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > > (different address space)
> > > > > >
> > > > > > Signed-off-by: B K Karthik 
> > > > > > ---
> > > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd 
> > > > > > *cmd,
> > > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > > >   cmd->stop_src = v32.stop_src;
> > > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > > >   cmd->data = compat_ptr(v32.data);
> > > > > >   cmd->data_len = v32.data_len;
> > > > >
> > > > > Always run your patches through checkpatch before sending them, so you
> > > > > do not have a grumpy maintainer telling you that you have to run
> > > > > checkpatch on your patch before sending them.
> > > > >
> > > >
> > > > I will. Sorry for that.
> > > >
> > > > But the error that's being shown in this patch is something that comes 
> > > > up
> > > > on its own.
> > >
> > > No it is not.
> > >
> > > > git format-patch leaves trailing whitespace in blank lines.
> > >
> > > It does?  Where is any trailing whitespace here?  That's not the issue.
> >
> > To give you an example,
> > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> > was a patch i submitted recently.
> > This is what checkpatch has to say:
> >
> > $ perl scripts/checkpatch.pl -f
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > ERROR: trailing whitespace
> > #21: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> > + $
> >
> > ERROR: trailing whitespace
> > #23: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> > + $
> >
> > ERROR: trailing whitespace
> > #30: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> > + $
> >
> > ERROR: trailing whitespace
> > #37: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> > + $
> >
> > ERROR: trailing whitespace
> > #44: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> > + $
> >
> > ERROR: trailing whitespace
> > #51: FILE: 
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> > +-- $
> >
> > total: 6 errors, 0 warnings, 53 lines checked
> >
> > NOTE: For some of the reported defects, checkpatch may be able to
> >   mechanically convert to the typical style using --fix or 
> > --fix-inplace.
> >
> > NOTE: Whitespace errors detected.
> >   You may wish to use scripts/cleanpatch or scripts/cleanfile
> >
> > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > has style problems, please review.
> >
> > NOTE: If any of the errors are false positives, please report
> >   them to the maintainer, see CHECKPATCH in MAINTAINERS.
> >
> > Does this happen only to patches I make? Am I making a silly mistake
> > while making a patch?
>
> I don't get that error at all, here's all I get with that patch:
this particular patch or
>
> $ ./scripts/checkpatch.pl x.patch
> WARNING: Missing Signed-off-by: line by nominal patch author ''
>
> total: 0 errors, 1 warnings, 0 checks, 30 lines checked

sorry, you've probably done this a million times more than me, but can
you try "perl scripts/checkpatch.pl -f x.patch" ?
checkpatch seems to behave differently this way.

thanks,

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 5:19 AM Greg Kroah-Hartman
 wrote:
>
> On Wed, Jul 15, 2020 at 04:47:48AM -0400, B K Karthik wrote:
> > On Wed, Jul 15, 2020 at 4:41 AM B K Karthik  wrote:
> > >
> > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
> > >  wrote:
> > > >
> > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > > > gre...@linuxfoundation.org> wrote:
> > > > >
> > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > > > fixed a sparse warning by changing the type in
> > > > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > > > (different address space)
> > > > > > >
> > > > > > > Signed-off-by: B K Karthik 
> > > > > > > ---
> > > > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd 
> > > > > > > *cmd,
> > > > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > > > >   cmd->stop_src = v32.stop_src;
> > > > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > > > >   cmd->data = compat_ptr(v32.data);
> > > > > > >   cmd->data_len = v32.data_len;
> > > > > >
> > > > > > Always run your patches through checkpatch before sending them, so 
> > > > > > you
> > > > > > do not have a grumpy maintainer telling you that you have to run
> > > > > > checkpatch on your patch before sending them.
> > > > > >
> > > > >
> > > > > I will. Sorry for that.
> > > > >
> > > > > But the error that's being shown in this patch is something that 
> > > > > comes up
> > > > > on its own.
> > > >
> > > > No it is not.
> > > >
> > > > > git format-patch leaves trailing whitespace in blank lines.
> > > >
> > > > It does?  Where is any trailing whitespace here?  That's not the issue.
> > >
> > > To give you an example,
> > > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> > > was a patch i submitted recently.
> > > This is what checkpatch has to say:
> > >
> > > $ perl scripts/checkpatch.pl -f
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > > ERROR: trailing whitespace
> > > #21: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #23: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #30: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #37: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #44: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #51: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> > > +-- $
> > >
> > > total: 6 errors, 0 warnings, 53 lines checked
> > >
> > > NOTE: For some of the reported defects, checkpatch may be able to
> > >   mechanically convert to the typical style using --fix or 
> > > --fix-inplace.
> > >
> > > NOTE: Whitespace errors detected.
> > >   You may wish to use scripts/cleanpatch or scripts/cleanfile
> > >
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > > has style problems, please review.
> > >
> > > NOTE: If any of the errors are false positives, please report
> > >   them to the maintainer, see CHECKPATCH in MAINTAINERS.
> > >
> > > Does this happen only to patches I make? Am I making a silly mistake
> > > while making a patch?
> > > I use 'git format-patch -1' to generate the patch file.
> > > If I am going wrong somewhere, please let me know.
> >
> > Also, The patch I sent (this thread):
> > $ perl scripts/checkpatch.pl -f
> > ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch
> > ERROR: trailing whitespace
> > #29: FILE: 
> > ./0001-staging-comedi-comedi_fops.c-changed-void-__user-to-.patch:29:
> > +-- $
> >
> > total: 1 errors, 0 warnings, 31 lines checked
> >
> > NOTE: For some of the reported defects, checkpatch may be able to
> >   mechanically convert to the typical style using --fix or 
> > --fix-

Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Greg Kroah-Hartman
On Wed, Jul 15, 2020 at 05:21:01AM -0400, B K Karthik wrote:
> On Wed, Jul 15, 2020 at 5:14 AM Greg Kroah-Hartman
>  wrote:
> >
> > On Wed, Jul 15, 2020 at 04:41:52AM -0400, B K Karthik wrote:
> > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
> > >  wrote:
> > > >
> > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > > > gre...@linuxfoundation.org> wrote:
> > > > >
> > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > > > fixed a sparse warning by changing the type in
> > > > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > > > (different address space)
> > > > > > >
> > > > > > > Signed-off-by: B K Karthik 
> > > > > > > ---
> > > > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd 
> > > > > > > *cmd,
> > > > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > > > >   cmd->stop_src = v32.stop_src;
> > > > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > > > >   cmd->data = compat_ptr(v32.data);
> > > > > > >   cmd->data_len = v32.data_len;
> > > > > >
> > > > > > Always run your patches through checkpatch before sending them, so 
> > > > > > you
> > > > > > do not have a grumpy maintainer telling you that you have to run
> > > > > > checkpatch on your patch before sending them.
> > > > > >
> > > > >
> > > > > I will. Sorry for that.
> > > > >
> > > > > But the error that's being shown in this patch is something that 
> > > > > comes up
> > > > > on its own.
> > > >
> > > > No it is not.
> > > >
> > > > > git format-patch leaves trailing whitespace in blank lines.
> > > >
> > > > It does?  Where is any trailing whitespace here?  That's not the issue.
> > >
> > > To give you an example,
> > > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> > > was a patch i submitted recently.
> > > This is what checkpatch has to say:
> > >
> > > $ perl scripts/checkpatch.pl -f
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > > ERROR: trailing whitespace
> > > #21: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #23: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #30: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #37: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #44: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> > > + $
> > >
> > > ERROR: trailing whitespace
> > > #51: FILE: 
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> > > +-- $
> > >
> > > total: 6 errors, 0 warnings, 53 lines checked
> > >
> > > NOTE: For some of the reported defects, checkpatch may be able to
> > >   mechanically convert to the typical style using --fix or 
> > > --fix-inplace.
> > >
> > > NOTE: Whitespace errors detected.
> > >   You may wish to use scripts/cleanpatch or scripts/cleanfile
> > >
> > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > > has style problems, please review.
> > >
> > > NOTE: If any of the errors are false positives, please report
> > >   them to the maintainer, see CHECKPATCH in MAINTAINERS.
> > >
> > > Does this happen only to patches I make? Am I making a silly mistake
> > > while making a patch?
> >
> > I don't get that error at all, here's all I get with that patch:
> this particular patch or
> >
> > $ ./scripts/checkpatch.pl x.patch
> > WARNING: Missing Signed-off-by: line by nominal patch author ''
> >
> > total: 0 errors, 1 warnings, 0 checks, 30 lines checked
> 
> sorry, you've probably done this a million times more than me, but can
> you try "perl scripts/checkpatch.pl -f x.patch" ?
> checkpatch seems to behave differently this way.

Of course it would, "-f" means treat the next argument as a file, not as
a patch.  This is a patch, not a full file.

So you are running this incor

Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 5:29 AM Greg Kroah-Hartman
 wrote:
>
> On Wed, Jul 15, 2020 at 05:21:01AM -0400, B K Karthik wrote:
> > On Wed, Jul 15, 2020 at 5:14 AM Greg Kroah-Hartman
> >  wrote:
> > >
> > > On Wed, Jul 15, 2020 at 04:41:52AM -0400, B K Karthik wrote:
> > > > On Wed, Jul 15, 2020 at 4:31 AM Greg Kroah-Hartman
> > > >  wrote:
> > > > >
> > > > > On Wed, Jul 15, 2020 at 01:56:45PM +0530, B K Karthik wrote:
> > > > > > On Wed, Jul 15, 2020, 12:38 PM Greg Kroah-Hartman <
> > > > > > gre...@linuxfoundation.org> wrote:
> > > > > >
> > > > > > > On Wed, Jul 15, 2020 at 12:48:13AM -0400, B K Karthik wrote:
> > > > > > > > fixed a sparse warning by changing the type in
> > > > > > > > assignment from void [noderef] __user * to unsigned int *
> > > > > > > > (different address space)
> > > > > > > >
> > > > > > > > Signed-off-by: B K Karthik 
> > > > > > > > ---
> > > > > > > >  drivers/staging/comedi/comedi_fops.c | 2 +-
> > > > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > > >
> > > > > > > > diff --git a/drivers/staging/comedi/comedi_fops.c
> > > > > > > b/drivers/staging/comedi/comedi_fops.c
> > > > > > > > index 3f70e5dfac39..4cc012e231b7 100644
> > > > > > > > --- a/drivers/staging/comedi/comedi_fops.c
> > > > > > > > +++ b/drivers/staging/comedi/comedi_fops.c
> > > > > > > > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct 
> > > > > > > > comedi_cmd *cmd,
> > > > > > > >   cmd->scan_end_arg = v32.scan_end_arg;
> > > > > > > >   cmd->stop_src = v32.stop_src;
> > > > > > > >   cmd->stop_arg = v32.stop_arg;
> > > > > > > > - cmd->chanlist = compat_ptr(v32.chanlist);
> > > > > > > > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
> > > > > > > >   cmd->chanlist_len = v32.chanlist_len;
> > > > > > > >   cmd->data = compat_ptr(v32.data);
> > > > > > > >   cmd->data_len = v32.data_len;
> > > > > > >
> > > > > > > Always run your patches through checkpatch before sending them, 
> > > > > > > so you
> > > > > > > do not have a grumpy maintainer telling you that you have to run
> > > > > > > checkpatch on your patch before sending them.
> > > > > > >
> > > > > >
> > > > > > I will. Sorry for that.
> > > > > >
> > > > > > But the error that's being shown in this patch is something that 
> > > > > > comes up
> > > > > > on its own.
> > > > >
> > > > > No it is not.
> > > > >
> > > > > > git format-patch leaves trailing whitespace in blank lines.
> > > > >
> > > > > It does?  Where is any trailing whitespace here?  That's not the 
> > > > > issue.
> > > >
> > > > To give you an example,
> > > > https://lore.kernel.org/lkml/20200714132350.naekk4zqivpuaedi@pesu-pes-edu/
> > > > was a patch i submitted recently.
> > > > This is what checkpatch has to say:
> > > >
> > > > $ perl scripts/checkpatch.pl -f
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > > > ERROR: trailing whitespace
> > > > #21: FILE: 
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:21:
> > > > + $
> > > >
> > > > ERROR: trailing whitespace
> > > > #23: FILE: 
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:23:
> > > > + $
> > > >
> > > > ERROR: trailing whitespace
> > > > #30: FILE: 
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:30:
> > > > + $
> > > >
> > > > ERROR: trailing whitespace
> > > > #37: FILE: 
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:37:
> > > > + $
> > > >
> > > > ERROR: trailing whitespace
> > > > #44: FILE: 
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:44:
> > > > + $
> > > >
> > > > ERROR: trailing whitespace
> > > > #51: FILE: 
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch:51:
> > > > +-- $
> > > >
> > > > total: 6 errors, 0 warnings, 53 lines checked
> > > >
> > > > NOTE: For some of the reported defects, checkpatch may be able to
> > > >   mechanically convert to the typical style using --fix or 
> > > > --fix-inplace.
> > > >
> > > > NOTE: Whitespace errors detected.
> > > >   You may wish to use scripts/cleanpatch or scripts/cleanfile
> > > >
> > > > ../cbridge/1407d/1/0001-drivers-staging-media-atomisp-pci-css_2401_system-ho.patch
> > > > has style problems, please review.
> > > >
> > > > NOTE: If any of the errors are false positives, please report
> > > >   them to the maintainer, see CHECKPATCH in MAINTAINERS.
> > > >
> > > > Does this happen only to patches I make? Am I making a silly mistake
> > > > while making a patch?
> > >
> > > I don't get that error at all, here's all I get with that patch:
> > this particular patch or
> > >
> > > $ ./scripts/checkpatch.pl x.patch
> > > WARNING: Missing Signed-off-by: line by nominal patch author ''
> > >
> > > total: 0 errors, 1 warnings, 0 checks, 30 lines checked
> >
> > sorry, you'

Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Zhao
At 2020-06-18 03:10:02, "Dan Carpenter"  wrote:
>On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
>> diff --git a/drivers/staging/gasket/gasket_core.c 
>> b/drivers/staging/gasket/gasket_core.c
>> index 67325fbaf760..28dab302183b 100644
>> --- a/drivers/staging/gasket/gasket_core.c
>> +++ b/drivers/staging/gasket/gasket_core.c
>> @@ -261,6 +261,7 @@ static int gasket_map_pci_bar(struct gasket_dev 
>> *gasket_dev, int bar_num)
>>  const struct gasket_driver_desc *driver_desc =
>>  internal_desc->driver_desc;
>>  ulong desc_bytes = driver_desc->bar_descriptions[bar_num].size;
>   ^^^
>Get rid of this as well (below).
>
>> +struct gasket_bar_data *data;
>>  int ret;
>>  
>>  if (desc_bytes == 0)
>> @@ -270,31 +271,32 @@ static int gasket_map_pci_bar(struct gasket_dev 
>> *gasket_dev, int bar_num)
>>  /* not PCI: skip this entry */
>>  return 0;
>>  }
>> +
>> +data = &gasket_dev->bar_data[bar_num];
>
>It would be better to do this in the declaration block so you can change
>the earlier two uses in this function:
>
>+  struct gasket_bar_data *data = &gasket_dev->bar_data[bar_num];
>-  ulong desc_bytes = driver_desc->bar_descriptions[bar_num].size;
>+  ulong desc_bytes = data->size;
>
>...
>
>-  if (driver_desc->bar_descriptions[bar_num].type != PCI_BAR) {
>+  if (data->type != PCI_BAR) {
>
>regards,
>dan carpenter

This issue has been resolved in  
https://lore.kernel.org/lkml/20200618140327.GS4151@kadam/

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


Re:Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Zhao
At 2020-07-15 17:04:06, "Joe Perches"  wrote:
>On Wed, 2020-07-15 at 11:37 +0300, Dan Carpenter wrote:
>> On Wed, Jul 15, 2020 at 09:57:55AM +0200, Greg KH wrote:
>> > On Wed, Jul 15, 2020 at 12:24:22AM -0700, Joe Perches wrote:
>> > > On Wed, 2020-07-15 at 09:17 +0200, Greg KH wrote:
>> > > > On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
>> > > > > On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
>> > > > > > A coding alignment issue is found by checkpatch.pl.
>> > > > > > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
>> > > > > > 
>> > > > > > Signed-off-by: Zhixu Zhao 
>> > > > > 
>> > > > > Hi, there~
>> > > > > 
>> > > > > Does anybody have any further comments on this?
>> > > > > Can it be merged?
>> > > > 
>> > > > I never saw the first version of this, are you sure it got sent to the
>> > > > mailing list?  It's not in any archives anywhere.
>> > > 
>> > > I saw it.  It's here:
>> > > https://lore.kernel.org/lkml/20200617161127.32006-1-zhixu...@126.com/
>> > 
>> > Ah, doh, sorry.
>> > 
>> > Zhixu, please address the comments given to you on the series and resend
>> > it as a new version.
>> 
>> He responded but not as a reply to my email.  It turns out I made a
>> mistake.
>> 
>> Anyway, just resend, Zhixu.
>
>It's a pity a resend is being requested.
>
>It'd be a better process if the original patch could
>be applied via the link akin to a git pull.
>

Yes. All comments have been resolved by now. Patch v2 is sufficient.

As Dan said, there was a tailing thread because I mis-replied his mail.
 I just now replied that mail with a reference to the final resolution mail.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Re: [PATCH v2] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Dan Carpenter
On Wed, Jul 15, 2020 at 06:45:21PM +0800, Zhao wrote:
> At 2020-07-15 17:04:06, "Joe Perches"  wrote:
> >On Wed, 2020-07-15 at 11:37 +0300, Dan Carpenter wrote:
> >> On Wed, Jul 15, 2020 at 09:57:55AM +0200, Greg KH wrote:
> >> > On Wed, Jul 15, 2020 at 12:24:22AM -0700, Joe Perches wrote:
> >> > > On Wed, 2020-07-15 at 09:17 +0200, Greg KH wrote:
> >> > > > On Wed, Jul 15, 2020 at 07:44:40AM +0800, Zhixu Zhao wrote:
> >> > > > > On Thu, Jun 18, 2020 at 12:11:27AM +0800, Zhixu Zhao wrote:
> >> > > > > > A coding alignment issue is found by checkpatch.pl.
> >> > > > > > Fix it by using a temporary for gasket_dev->bar_data[bar_num].
> >> > > > > > 
> >> > > > > > Signed-off-by: Zhixu Zhao 
> >> > > > > 
> >> > > > > Hi, there~
> >> > > > > 
> >> > > > > Does anybody have any further comments on this?
> >> > > > > Can it be merged?
> >> > > > 
> >> > > > I never saw the first version of this, are you sure it got sent to 
> >> > > > the
> >> > > > mailing list?  It's not in any archives anywhere.
> >> > > 
> >> > > I saw it.  It's here:
> >> > > https://lore.kernel.org/lkml/20200617161127.32006-1-zhixu...@126.com/
> >> > 
> >> > Ah, doh, sorry.
> >> > 
> >> > Zhixu, please address the comments given to you on the series and resend
> >> > it as a new version.
> >> 
> >> He responded but not as a reply to my email.  It turns out I made a
> >> mistake.
> >> 
> >> Anyway, just resend, Zhixu.
> >
> >It's a pity a resend is being requested.
> >
> >It'd be a better process if the original patch could
> >be applied via the link akin to a git pull.
> >
> 
> Yes. All comments have been resolved by now. Patch v2 is sufficient.
> 
> As Dan said, there was a tailing thread because I mis-replied his mail.
>  I just now replied that mail with a reference to the final resolution mail.

Just resend.

regards,
dan carpenter

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


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Ian Abbott

On 15/07/2020 05:48, B K Karthik wrote:

fixed a sparse warning by changing the type in
assignment from void [noderef] __user * to unsigned int *
(different address space)

Signed-off-by: B K Karthik 
---
  drivers/staging/comedi/comedi_fops.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 3f70e5dfac39..4cc012e231b7 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
cmd->scan_end_arg = v32.scan_end_arg;
cmd->stop_src = v32.stop_src;
cmd->stop_arg = v32.stop_arg;
-   cmd->chanlist = compat_ptr(v32.chanlist);
+   cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);


That should be:

cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist);


cmd->chanlist_len = v32.chanlist_len;
cmd->data = compat_ptr(v32.data);
cmd->data_len = v32.data_len;



A reverse cast is required in put_compat_cmd():

v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist);

Those changes will get rid of the sparse warnings.

--
-=( Ian Abbott  || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:)=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread B K Karthik
On Wed, Jul 15, 2020 at 7:19 AM Ian Abbott  wrote:
>
> On 15/07/2020 05:48, B K Karthik wrote:
> > fixed a sparse warning by changing the type in
> > assignment from void [noderef] __user * to unsigned int *
> > (different address space)
> >
> > Signed-off-by: B K Karthik 
> > ---
> >   drivers/staging/comedi/comedi_fops.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/comedi/comedi_fops.c 
> > b/drivers/staging/comedi/comedi_fops.c
> > index 3f70e5dfac39..4cc012e231b7 100644
> > --- a/drivers/staging/comedi/comedi_fops.c
> > +++ b/drivers/staging/comedi/comedi_fops.c
> > @@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
> >   cmd->scan_end_arg = v32.scan_end_arg;
> >   cmd->stop_src = v32.stop_src;
> >   cmd->stop_arg = v32.stop_arg;
> > - cmd->chanlist = compat_ptr(v32.chanlist);
> > + cmd->chanlist = (unsigned int *) compat_ptr(v32.chanlist);
>
> That should be:
>
> cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist);
>
> >   cmd->chanlist_len = v32.chanlist_len;
> >   cmd->data = compat_ptr(v32.data);
> >   cmd->data_len = v32.data_len;
> >
>
> A reverse cast is required in put_compat_cmd():
>
> v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist);
>
> Those changes will get rid of the sparse warnings.

Thank you for the clarifications Ian. I will make the changes and submit a patch

thanks,

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


[PATCH v2] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings

2020-07-15 Thread B K Karthik
fixed sparse warnings by adding a cast in assignment from
void [noderef] __user * to unsigned int __force *
and a reverse cast in argument from
void [noderef] __user * to  unsigned int __user * .

Signed-off-by: B K Karthik 
---
 drivers/staging/comedi/comedi_fops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 3f70e5dfac39..9cdc1e8a022d 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2956,7 +2956,7 @@ static int get_compat_cmd(struct comedi_cmd *cmd,
cmd->scan_end_arg = v32.scan_end_arg;
cmd->stop_src = v32.stop_src;
cmd->stop_arg = v32.stop_arg;
-   cmd->chanlist = compat_ptr(v32.chanlist);
+   cmd->chanlist = (unsigned int __force *)compat_ptr(v32.chanlist);
cmd->chanlist_len = v32.chanlist_len;
cmd->data = compat_ptr(v32.data);
cmd->data_len = v32.data_len;
@@ -2983,7 +2983,7 @@ static int put_compat_cmd(struct comedi32_cmd_struct 
__user *cmd32,
v32.stop_src = cmd->stop_src;
v32.stop_arg = cmd->stop_arg;
/* Assume chanlist pointer is unchanged. */
-   v32.chanlist = ptr_to_compat(cmd->chanlist);
+   v32.chanlist = ptr_to_compat((unsigned int __user *)cmd->chanlist);
v32.chanlist_len = cmd->chanlist_len;
v32.data = ptr_to_compat(cmd->data);
v32.data_len = cmd->data_len;
-- 
2.20.1



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


Re: [PATCH] media: cedrus: Propagate OUTPUT resolution to CAPTURE

2020-07-15 Thread Ezequiel Garcia
It seems this one felt thru the cracks. Sorry for the delay.

On Thu, 2020-05-14 at 11:39 -0400, Nicolas Dufresne wrote:
> As per spec, the CAPTURE resolution should be automatically set based on
> the OTUPUT resolution. This patch properly propagate width/height to the
> capture when the OUTPUT format is set and override the user provided
> width/height with configured OUTPUT resolution when the CAPTURE fmt is
> updated.
> 
> This also prevents userspace from selecting a CAPTURE resolution that is
> too small, avoiding unwanted page faults.
> 
> Signed-off-by: Nicolas Dufresne 

This looks correct.

Reviewed-by: Ezequiel Garcia 

Thanks,
Ezequiel

> ---
>  drivers/staging/media/sunxi/cedrus/cedrus_video.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c 
> b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> index 16d82309e7b6..a6d6b15adc2e 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> @@ -247,6 +247,8 @@ static int cedrus_try_fmt_vid_cap(struct file *file, void 
> *priv,
>   return -EINVAL;
>  
>   pix_fmt->pixelformat = fmt->pixelformat;
> + pix_fmt->width = ctx->src_fmt.width;
> + pix_fmt->height = ctx->src_fmt.height;
>   cedrus_prepare_format(pix_fmt);
>  
>   return 0;
> @@ -319,11 +321,14 @@ static int cedrus_s_fmt_vid_out(struct file *file, void 
> *priv,
>   break;
>   }
>  
> - /* Propagate colorspace information to capture. */
> + /* Propagate format information to capture. */
>   ctx->dst_fmt.colorspace = f->fmt.pix.colorspace;
>   ctx->dst_fmt.xfer_func = f->fmt.pix.xfer_func;
>   ctx->dst_fmt.ycbcr_enc = f->fmt.pix.ycbcr_enc;
>   ctx->dst_fmt.quantization = f->fmt.pix.quantization;
> + ctx->dst_fmt.width = ctx->src_fmt.width;
> + ctx->dst_fmt.height = ctx->src_fmt.height;
> + cedrus_prepare_format(&ctx->dst_fmt);
>  
>   return 0;
>  }
> -- 
> 2.26.2
> 
> 


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


[PATCH v3] staging: gasket: core: Fix a coding style issue in gasket_core.c

2020-07-15 Thread Zhixu Zhao
A coding alignment issue is found by checkpatch.pl.
Fix it by using a temporary for gasket_dev->bar_data[bar_num].

Signed-off-by: Zhixu Zhao 
---

Changes in v2:
  - gasket_dev->bar_data[bar_num] was used everywhere. Now replace it
with a `struct gasket_bar_data *data`, making the code more elegant.
Thanks to Joe Perches.

About v3:
  - Resolved all comments in v2. Resending it...

 drivers/staging/gasket/gasket_core.c | 29 ++--
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c 
b/drivers/staging/gasket/gasket_core.c
index 67325fbaf760..28dab302183b 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -261,6 +261,7 @@ static int gasket_map_pci_bar(struct gasket_dev 
*gasket_dev, int bar_num)
const struct gasket_driver_desc *driver_desc =
internal_desc->driver_desc;
ulong desc_bytes = driver_desc->bar_descriptions[bar_num].size;
+   struct gasket_bar_data *data;
int ret;
 
if (desc_bytes == 0)
@@ -270,31 +271,32 @@ static int gasket_map_pci_bar(struct gasket_dev 
*gasket_dev, int bar_num)
/* not PCI: skip this entry */
return 0;
}
+
+   data = &gasket_dev->bar_data[bar_num];
+
/*
 * pci_resource_start and pci_resource_len return a "resource_size_t",
 * which is safely castable to ulong (which itself is the arg to
 * request_mem_region).
 */
-   gasket_dev->bar_data[bar_num].phys_base =
+   data->phys_base =
(ulong)pci_resource_start(gasket_dev->pci_dev, bar_num);
-   if (!gasket_dev->bar_data[bar_num].phys_base) {
+   if (!data->phys_base) {
dev_err(gasket_dev->dev, "Cannot get BAR%u base address\n",
bar_num);
return -EINVAL;
}
 
-   gasket_dev->bar_data[bar_num].length_bytes =
+   data->length_bytes =
(ulong)pci_resource_len(gasket_dev->pci_dev, bar_num);
-   if (gasket_dev->bar_data[bar_num].length_bytes < desc_bytes) {
+   if (data->length_bytes < desc_bytes) {
dev_err(gasket_dev->dev,
"PCI BAR %u space is too small: %lu; expected >= %lu\n",
-   bar_num, gasket_dev->bar_data[bar_num].length_bytes,
-   desc_bytes);
+   bar_num, data->length_bytes, desc_bytes);
return -ENOMEM;
}
 
-   if (!request_mem_region(gasket_dev->bar_data[bar_num].phys_base,
-   gasket_dev->bar_data[bar_num].length_bytes,
+   if (!request_mem_region(data->phys_base, data->length_bytes,
gasket_dev->dev_info.name)) {
dev_err(gasket_dev->dev,
"Cannot get BAR %d memory region %p\n",
@@ -302,10 +304,8 @@ static int gasket_map_pci_bar(struct gasket_dev 
*gasket_dev, int bar_num)
return -EINVAL;
}
 
-   gasket_dev->bar_data[bar_num].virt_base =
-   ioremap(gasket_dev->bar_data[bar_num].phys_base,
-   gasket_dev->bar_data[bar_num].length_bytes);
-   if (!gasket_dev->bar_data[bar_num].virt_base) {
+   data->virt_base = ioremap(data->phys_base, data->length_bytes);
+   if (!data->virt_base) {
dev_err(gasket_dev->dev,
"Cannot remap BAR %d memory region %p\n",
bar_num, &gasket_dev->pci_dev->resource[bar_num]);
@@ -319,9 +319,8 @@ static int gasket_map_pci_bar(struct gasket_dev 
*gasket_dev, int bar_num)
return 0;
 
 fail:
-   iounmap(gasket_dev->bar_data[bar_num].virt_base);
-   release_mem_region(gasket_dev->bar_data[bar_num].phys_base,
-  gasket_dev->bar_data[bar_num].length_bytes);
+   iounmap(data->virt_base);
+   release_mem_region(data->phys_base, data->length_bytes);
return ret;
 }
 
-- 
2.17.1

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


Re: [PATCH] media: cedrus: Propagate OUTPUT resolution to CAPTURE

2020-07-15 Thread Paul Kocialkowski
Hi,

On Wed 15 Jul 20, 08:57, Ezequiel Garcia wrote:
> It seems this one felt thru the cracks. Sorry for the delay.
> 
> On Thu, 2020-05-14 at 11:39 -0400, Nicolas Dufresne wrote:
> > As per spec, the CAPTURE resolution should be automatically set based on
> > the OTUPUT resolution. This patch properly propagate width/height to the
> > capture when the OUTPUT format is set and override the user provided
> > width/height with configured OUTPUT resolution when the CAPTURE fmt is
> > updated.
> > 
> > This also prevents userspace from selecting a CAPTURE resolution that is
> > too small, avoiding unwanted page faults.
> > 
> > Signed-off-by: Nicolas Dufresne 
> 
> This looks correct.

Looks like there's no issue with alignment (that will get applied as well),
which was a possible concern.

Thanks for reviewing!

Acked-by: Paul Kocialkowski 

Cheers,

Paul

> Reviewed-by: Ezequiel Garcia 
> 
> Thanks,
> Ezequiel
> 
> > ---
> >  drivers/staging/media/sunxi/cedrus/cedrus_video.c | 7 ++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c 
> > b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > index 16d82309e7b6..a6d6b15adc2e 100644
> > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
> > @@ -247,6 +247,8 @@ static int cedrus_try_fmt_vid_cap(struct file *file, 
> > void *priv,
> > return -EINVAL;
> >  
> > pix_fmt->pixelformat = fmt->pixelformat;
> > +   pix_fmt->width = ctx->src_fmt.width;
> > +   pix_fmt->height = ctx->src_fmt.height;
> > cedrus_prepare_format(pix_fmt);
> >  
> > return 0;
> > @@ -319,11 +321,14 @@ static int cedrus_s_fmt_vid_out(struct file *file, 
> > void *priv,
> > break;
> > }
> >  
> > -   /* Propagate colorspace information to capture. */
> > +   /* Propagate format information to capture. */
> > ctx->dst_fmt.colorspace = f->fmt.pix.colorspace;
> > ctx->dst_fmt.xfer_func = f->fmt.pix.xfer_func;
> > ctx->dst_fmt.ycbcr_enc = f->fmt.pix.ycbcr_enc;
> > ctx->dst_fmt.quantization = f->fmt.pix.quantization;
> > +   ctx->dst_fmt.width = ctx->src_fmt.width;
> > +   ctx->dst_fmt.height = ctx->src_fmt.height;
> > +   cedrus_prepare_format(&ctx->dst_fmt);
> >  
> > return 0;
> >  }
> > -- 
> > 2.26.2
> > 
> > 
> 
> 

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


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


Re: [PATCH] staging: rtl8188eu: core: fix coding style issues

2020-07-15 Thread Greg KH
On Wed, Jul 15, 2020 at 02:55:59AM +0530, Arpitha wrote:
> Fixing WARNING: Prefer using '"%s...", __func__' to using 'function_name'
> in a string in rtw_ioctl_set.c
> 
> Signed-off-by: Arpitha <98.a...@gmail.com>

We need a "full" name for kernel patches, what you use to sign
documents.

Same for the From: line.

thanks,

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


Re: [PATCH 0/6] staging: dpaa2-ethsw: cleanup of link state and MAC addresses

2020-07-15 Thread Greg KH
On Tue, Jul 14, 2020 at 04:34:25PM +0300, Ioana Ciornei wrote:
> This patch set is cleaning up the link state handling of the switch
> ports in patches 1-4. The last two patches are setting up the MAC
> addresses of the switch ports automatically so that the user is not
> forced to manually add them before adding them to a bridge.

This feels like adding new functionality to this code.  What is keeping
it from getting out of staging at this point in time?  I would prefer
for it to be moved out before adding new stuff to it.

thanks,

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


[PATCH v2] staging: rtl8188eu: core: fix coding style issues

2020-07-15 Thread Arpitha Raghunandan
Fixing WARNING: Prefer using '"%s...", __func__' to using 'function_name'
in a string in rtw_ioctl_set.c

Signed-off-by: Arpitha Raghunandan <98.a...@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 9cc77ab4fd6b..fa88e8b2852d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -44,12 +44,12 @@ u8 rtw_do_join(struct adapter *padapter)
 
if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
pmlmepriv->to_roaming > 0) {
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("rtw_do_join(): site survey if scanned_queue is empty\n."));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("%s: site survey if scanned_queue is empty\n.", __func__));
/*  submit site_survey_cmd */
ret = rtw_sitesurvey_cmd(padapter, 
&pmlmepriv->assoc_ssid, 1, NULL, 0);
if (ret != _SUCCESS) {
pmlmepriv->to_join = false;
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, 
_drv_err_, ("rtw_do_join(): site survey return error\n."));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, 
_drv_err_, ("%s: site survey return error\n.", __func__));
}
} else {
pmlmepriv->to_join = false;
@@ -313,7 +313,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter 
*padapter,
enum ndis_802_11_network_infra *pold_state = 
&cur_network->network.InfrastructureMode;
 
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
-("+rtw_set_802_11_infrastructure_mode: old =%d new =%d 
fw_state = 0x%08x\n",
+("+%s: old =%d new =%d fw_state = 0x%08x\n", __func__,
  *pold_state, networktype, get_fwstate(pmlmepriv)));
 
if (*pold_state != networktype) {
@@ -496,7 +496,7 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct 
ndis_802_11_wep *wep)
break;
}
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-("rtw_set_802_11_add_wep:before memcpy, wep->KeyLength = 0x%x 
wep->KeyIndex = 0x%x  keyid =%x\n",
+("%s:before memcpy, wep->KeyLength = 0x%x wep->KeyIndex = 0x%x 
 keyid =%x\n", __func__,
 wep->KeyLength, wep->KeyIndex, keyid));
 
memcpy(&psecuritypriv->dot11DefKey[keyid].skey[0],
@@ -507,7 +507,7 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct 
ndis_802_11_wep *wep)
psecuritypriv->dot11PrivacyKeyIndex = keyid;
 
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-("rtw_set_802_11_add_wep:security key material : %x %x %x %x 
%x %x %x %x %x %x %x %x %x\n",
+("%s:security key material : %x %x %x %x %x %x %x %x %x %x %x 
%x %x\n", __func__,
 psecuritypriv->dot11DefKey[keyid].skey[0],
 psecuritypriv->dot11DefKey[keyid].skey[1],
 psecuritypriv->dot11DefKey[keyid].skey[2],
-- 
2.25.1

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


RE: [PATCH 0/6] staging: dpaa2-ethsw: cleanup of link state and MAC addresses

2020-07-15 Thread Ioana Ciornei
> Subject: Re: [PATCH 0/6] staging: dpaa2-ethsw: cleanup of link state and MAC
> addresses
> 
> On Tue, Jul 14, 2020 at 04:34:25PM +0300, Ioana Ciornei wrote:
> > This patch set is cleaning up the link state handling of the switch
> > ports in patches 1-4. The last two patches are setting up the MAC
> > addresses of the switch ports automatically so that the user is not
> > forced to manually add them before adding them to a bridge.
> 
> This feels like adding new functionality to this code.  What is keeping it 
> from
> getting out of staging at this point in time?  I would prefer for it to be 
> moved out
> before adding new stuff to it.
> 
> thanks,
> 
> greg k-h

We still have some work do to on this driver before moving it out of staging 
unfortunately, mainly integrating the Rx/Tx functionality for switch ports[1] 
and general cleanup on the driver. Sorry I did not mention this in the cover 
letter.

This patch set just does some cleanup of the link state handling since the 
state showed to the user in the ifconfig output was not consistent all the time 
with what actually was happening in the hardware.

Thanks,
Ioana

[1] https://lkml.org/lkml/2019/11/5/548

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


Re: [PATCH v2] staging: rtl8188eu: core: fix coding style issues

2020-07-15 Thread Greg KH
On Wed, Jul 15, 2020 at 07:57:10PM +0530, Arpitha Raghunandan wrote:
> Fixing WARNING: Prefer using '"%s...", __func__' to using 'function_name'
> in a string in rtw_ioctl_set.c
> 
> Signed-off-by: Arpitha Raghunandan <98.a...@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

What changed from v1?

Always put that information below the --- line in the patch like the
documentation asks.

Can you fix this up and send v3?

thanks,

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


[PATCH v3] staging: rtl8188eu: core: fix coding style issues

2020-07-15 Thread Arpitha Raghunandan
Fixing WARNING: Prefer using '"%s...", __func__' to using 'function_name'
in a string in rtw_ioctl_set.c

Signed-off-by: Arpitha Raghunandan <98.a...@gmail.com>
---
Changes v2->v3:
- Added information about what changed from previous versions
Changes v1->v2:
- Added full name in From and Signed-off-by

 drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c 
b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
index 9cc77ab4fd6b..fa88e8b2852d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c
@@ -44,12 +44,12 @@ u8 rtw_do_join(struct adapter *padapter)
 
if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
pmlmepriv->to_roaming > 0) {
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("rtw_do_join(): site survey if scanned_queue is empty\n."));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, 
("%s: site survey if scanned_queue is empty\n.", __func__));
/*  submit site_survey_cmd */
ret = rtw_sitesurvey_cmd(padapter, 
&pmlmepriv->assoc_ssid, 1, NULL, 0);
if (ret != _SUCCESS) {
pmlmepriv->to_join = false;
-   RT_TRACE(_module_rtl871x_ioctl_set_c_, 
_drv_err_, ("rtw_do_join(): site survey return error\n."));
+   RT_TRACE(_module_rtl871x_ioctl_set_c_, 
_drv_err_, ("%s: site survey return error\n.", __func__));
}
} else {
pmlmepriv->to_join = false;
@@ -313,7 +313,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter 
*padapter,
enum ndis_802_11_network_infra *pold_state = 
&cur_network->network.InfrastructureMode;
 
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
-("+rtw_set_802_11_infrastructure_mode: old =%d new =%d 
fw_state = 0x%08x\n",
+("+%s: old =%d new =%d fw_state = 0x%08x\n", __func__,
  *pold_state, networktype, get_fwstate(pmlmepriv)));
 
if (*pold_state != networktype) {
@@ -496,7 +496,7 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct 
ndis_802_11_wep *wep)
break;
}
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-("rtw_set_802_11_add_wep:before memcpy, wep->KeyLength = 0x%x 
wep->KeyIndex = 0x%x  keyid =%x\n",
+("%s:before memcpy, wep->KeyLength = 0x%x wep->KeyIndex = 0x%x 
 keyid =%x\n", __func__,
 wep->KeyLength, wep->KeyIndex, keyid));
 
memcpy(&psecuritypriv->dot11DefKey[keyid].skey[0],
@@ -507,7 +507,7 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct 
ndis_802_11_wep *wep)
psecuritypriv->dot11PrivacyKeyIndex = keyid;
 
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
-("rtw_set_802_11_add_wep:security key material : %x %x %x %x 
%x %x %x %x %x %x %x %x %x\n",
+("%s:security key material : %x %x %x %x %x %x %x %x %x %x %x 
%x %x\n", __func__,
 psecuritypriv->dot11DefKey[keyid].skey[0],
 psecuritypriv->dot11DefKey[keyid].skey[1],
 psecuritypriv->dot11DefKey[keyid].skey[2],
-- 
2.25.1

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


[PATCH v2] staging: rtl8188eu: add blank line after declarations

2020-07-15 Thread Rahul Gottipati
Added a blank line after declarations in
drivers/staging/rtl8188eu/core/rtw_security.c to fix a
checkpatch.pl warning

Signed-off-by: Rahul Gottipati 
---
 drivers/staging/rtl8188eu/core/rtw_security.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c 
b/drivers/staging/rtl8188eu/core/rtw_security.c
index f9139f72b3a7..bf1582598f1c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -840,6 +840,7 @@ static void next_key(u8 *key, int round)
 static void byte_sub(u8 *in, u8 *out)
 {
int i;
+
for (i = 0; i < 16; i++)
out[i] = sbox(in[i]);
 }
-- 
2.25.1

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


[PATCH] staging: rtl*/security: Use static const in array declarations

2020-07-15 Thread Joe Perches
Use static const in declarations where appropriate.

Signed-off-by: Joe Perches 
---
 drivers/staging/rtl8188eu/core/rtw_security.c | 4 ++--
 drivers/staging/rtl8712/rtl871x_security.c| 2 +-
 drivers/staging/rtl8723bs/core/rtw_security.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c 
b/drivers/staging/rtl8188eu/core/rtw_security.c
index f9139f72b3a7..3483c3d9cb56 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -734,7 +734,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 
*precvframe)
 / SBOX Table */
 /*/
 
-static  u8 sbox_table[256] = {
+static const u8 sbox_table[256] = {
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
@@ -817,7 +817,7 @@ static void next_key(u8 *key, int round)
 {
u8 rcon;
u8 sbox_key[4];
-   u8 rcon_table[12] = {
+   static const u8 rcon_table[12] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
0x1b, 0x36, 0x36, 0x36
};
diff --git a/drivers/staging/rtl8712/rtl871x_security.c 
b/drivers/staging/rtl8712/rtl871x_security.c
index 73e3d5ef3af2..c05010d85212 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -762,7 +762,7 @@ static void next_key(u8 *key, sint round)
 {
u8 rcon;
u8 sbox_key[4];
-   u8 rcon_table[12] = {
+   static const u8 rcon_table[12] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
0x1b, 0x36, 0x36, 0x36
};
diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c 
b/drivers/staging/rtl8723bs/core/rtw_security.c
index ec9122070e58..7f74e1d05b3a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -10,7 +10,7 @@
 #include 
 #include 
 
-static const char *_security_type_str[] = {
+static const char * const _security_type_str[] = {
"N/A",
"WEP40",
"TKIP",
@@ -842,7 +842,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 
*precvframe)
 / SBOX Table */
 /*/
 
-   static  u8 sbox_table[256] = {
+   static const u8 sbox_table[256] = {
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
@@ -957,7 +957,7 @@ static void next_key(u8 *key, sint round)
 {
u8 rcon;
u8 sbox_key[4];
-   u8 rcon_table[12] = {
+   static const u8 rcon_table[12] = {
0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80,
0x1b, 0x36, 0x36, 0x36


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


[PATCH v8 00/12] PCI: brcmstb: enable PCIe for STB chips

2020-07-15 Thread Jim Quinlan
Patchset Summary:
  Enhance a PCIe host controller driver.  Because of its unusual design
  we are foced to change dev->dma_pfn_offset into a more general role
  allowing multiple offsets.  See the 'v1' notes below for more info.

v8:
  Commit: "device core: Introduce DMA range map, supplanting ..."
  -- To satisfy a specific m68 compile configuration, I moved the 'struct
 bus_dma_region; definition out of #ifdef CONFIG_HAS_DMA and also defined
 three inline functions for !CONFIG_HAS_DMA (kernel test robot).
  -- The sunXi drivers -- suc4i_csi, sun6i_csi, cedrus_hw -- set
 a pfn_offset outside of_dma_configure() but the code offers no 
 insight on the size of the translation window.  V7 had me using
 SIZE_MAX as the size.  I have since contacted the sunXi maintainer and
 he said that using a size of SZ_4G would cover sunXi configurations.

v7:
  Commit: "device core: Introduce DMA range map, supplanting ..."
  -- remove second kcalloc/copy in device.c (AndyS)
  -- use PTR_ERR_OR_ZERO() and PHYS_PFN() (AndyS)
  -- indentation, sizeof(struct ...) => sizeof(*r) (AndyS)
  -- add pfn.h definitions: PFN_DMA_ADDR(), DMA_ADDR_PFN() (AndyS)
  -- Fixed compile error in "sun6i_csi.c" (kernel test robot)
  Commit "ata: ahci_brcm: Fix use of BCM7216 reset controller"
  -- correct name of function in the commit msg (SergeiS)
  
v6:
  Commit "device core: Introduce DMA range map":
  -- of_dma_get_range() now takes a single argument and returns either
 NULL, a valid map, or an ERR_PTR. (Robin)
  -- offsets are no longer a PFN value but an actual address. (Robin)
  -- the bus_dma_region struct stores the range size instead of
 the cpu_end and pci_end values. (Robin)
  -- devices that were setting a single offset with no boundaries
 have been modified to have boundaries; in a few places
 where this informatino was unavilable a /* FIXME: ... */
 comment was added. (Robin)
  -- dma_attach_offset_range() can be called when an offset
 map already exists; if it's range is already present
 nothing is done and success is returned. (Robin)
  All commits:
  -- Man name/style/corrections/etc changed (Bjorn)
  -- rebase to Torvalds master

v5:
  Commit "device core: Introduce multiple dma pfn offsets"
  -- in of/address.c: "map_size = 0" => "*map_size = 0"
  -- use kcalloc instead of kzalloc (AndyS)
  -- use PHYS_ADDR_MAX instead of "~(phys_addr_t)0"
  Commit "PCI: brcmstb: Set internal memory viewport sizes"
  -- now gives error on missing dma-ranges property.
  Commit "dt-bindings: PCI: Add bindings for more Brcmstb chips"
  -- removed "Allof:" from brcm,scb-sizes definition (RobH)
  All Commits:
  -- indentation style, use max chars 100 (AndyS)
  -- rebased to torvalds master

v4:
  Commit "device core: Introduce multiple dma pfn offsets"
  -- of_dma_get_range() does not take a dev param but instead
 takes two "out" params: map and map_size.  We do this so
 that the code that parses dma-ranges is separate from
 the code that modifies 'dev'.   (Nicolas)
  -- the separate case of having a single pfn offset has
 been removed and is now processed by going through the
 map array. (Nicolas)
  -- move attach_uniform_dma_pfn_offset() from of/address.c to
 dma/mapping.c so that it does not depend on CONFIG_OF. (Nicolas)
  -- devm_kcalloc => devm_kzalloc (DanC)
  -- add/fix assignment to dev->dma_pfn_offset_map for func
 attach_uniform_dma_pfn_offset() (DanC, Nicolas)
  -- s/struct dma_pfn_offset_region/struct bus_dma_region/ (Nicolas)
  -- s/attach_uniform_dma_pfn_offset/dma_attach_uniform_pfn_offset/
  -- s/attach_dma_pfn_offset_map/dma_attach_pfn_offset_map/
  -- More use of PFN_{PHYS,DOWN,UP}. (AndyS)
  Commit "of: Include a dev param in of_dma_get_range()"
  -- this commit was sqaushed with "device core: Introduce ..."

v3:
  Commit "device core: Introduce multiple dma pfn offsets"
  Commit "arm: dma-mapping: Invoke dma offset func if needed"
  -- The above two commits have been squashed.  More importantly,
 the code has been modified so that the functionality for
 multiple pfn offsets subsumes the use of dev->dma_pfn_offset.
 In fact, dma_pfn_offset is removed and supplanted by
 dma_pfn_offset_map, which is a pointer to an array.  The
 more common case of a uniform offset is now handled as
 a map with a single entry, while cases requiring multiple
 pfn offsets use a map with multiple entries.  Code paths
 that used to do this:

 dev->dma_pfn_offset = mydrivers_pfn_offset;

 have been changed to do this:

 attach_uniform_dma_pfn_offset(dev, pfn_offset);

  Commit "dt-bindings: PCI: Add bindings for more Brcmstb chips"
  -- Add if/then clause for required props: resets, reset-names (RobH)
  -- Change compatible list from const to enum (RobH)
  -- Change list of u32-tuples to u64 (RobH)

  Commit "of: Include a dev param in of_dma_get_range()"
  -- modify of/unittests.c to add NULL param in of_dma_get_range()

[PATCH v8 08/12] device core: Introduce DMA range map, supplanting dma_pfn_offset

2020-07-15 Thread Jim Quinlan
The new field 'dma_range_map' in struct device is used to facilitate the
use of single or multiple offsets between mapping regions of cpu addrs and
dma addrs.  It subsumes the role of "dev->dma_pfn_offset" which was only
capable of holding a single uniform offset and had no region bounds
checking.

The function of_dma_get_range() has been modified so that it takes a single
argument -- the device node -- and returns a map, NULL, or an error code.
The map is an array that holds the information regarding the DMA regions.
Each range entry contains the address offset, the cpu_start address, the
dma_start address, and the size of the region.

of_dma_configure() is the typical manner to set range offsets but there are
a number of ad hoc assignments to "dev->dma_pfn_offset" in the kernel
driver code.  These cases now invoke the function
dma_attach_offset_range(dev, cpu_addr, dma_addr, size).

Signed-off-by: Jim Quinlan 
---
 arch/arm/include/asm/dma-mapping.h|  9 +-
 arch/arm/mach-keystone/keystone.c | 17 ++--
 arch/sh/drivers/pci/pcie-sh7786.c |  9 +-
 arch/sh/kernel/dma-coherent.c | 16 ++--
 arch/x86/pci/sta2x11-fixup.c  |  7 +-
 drivers/acpi/arm64/iort.c |  5 +-
 drivers/gpu/drm/sun4i/sun4i_backend.c |  5 +-
 drivers/iommu/io-pgtable-arm.c|  2 +-
 .../platform/sunxi/sun4i-csi/sun4i_csi.c  |  5 +-
 .../platform/sunxi/sun6i-csi/sun6i_csi.c  |  4 +-
 drivers/of/address.c  | 95 ++-
 drivers/of/device.c   | 47 +
 drivers/of/of_private.h   |  9 +-
 drivers/of/unittest.c | 35 +--
 drivers/remoteproc/remoteproc_core.c  |  2 +-
 .../staging/media/sunxi/cedrus/cedrus_hw.c|  7 +-
 drivers/usb/core/message.c|  4 +-
 drivers/usb/core/usb.c|  2 +-
 include/linux/device.h|  4 +-
 include/linux/dma-direct.h| 10 +-
 include/linux/dma-mapping.h   | 43 +
 include/linux/pfn.h   |  2 +
 kernel/dma/coherent.c | 10 +-
 kernel/dma/mapping.c  | 53 +++
 24 files changed, 278 insertions(+), 124 deletions(-)

diff --git a/arch/arm/include/asm/dma-mapping.h 
b/arch/arm/include/asm/dma-mapping.h
index bdd80ddbca34..b7cdde9fb83d 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -35,8 +35,9 @@ static inline const struct dma_map_ops 
*get_arch_dma_ops(struct bus_type *bus)
 #ifndef __arch_pfn_to_dma
 static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
 {
-   if (dev)
-   pfn -= dev->dma_pfn_offset;
+   if (dev && dev->dma_range_map)
+   pfn -= DMA_ADDR_PFN(dma_offset_from_phys_addr(dev, 
PFN_PHYS(pfn)));
+
return (dma_addr_t)__pfn_to_bus(pfn);
 }
 
@@ -44,8 +45,8 @@ static inline unsigned long dma_to_pfn(struct device *dev, 
dma_addr_t addr)
 {
unsigned long pfn = __bus_to_pfn(addr);
 
-   if (dev)
-   pfn += dev->dma_pfn_offset;
+   if (dev && dev->dma_range_map)
+   pfn += DMA_ADDR_PFN(dma_offset_from_dma_addr(dev, addr));
 
return pfn;
 }
diff --git a/arch/arm/mach-keystone/keystone.c 
b/arch/arm/mach-keystone/keystone.c
index 638808c4e122..a1a19781983b 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -8,6 +8,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -24,8 +25,6 @@
 
 #include "keystone.h"
 
-static unsigned long keystone_dma_pfn_offset __read_mostly;
-
 static int keystone_platform_notifier(struct notifier_block *nb,
  unsigned long event, void *data)
 {
@@ -38,9 +37,12 @@ static int keystone_platform_notifier(struct notifier_block 
*nb,
return NOTIFY_BAD;
 
if (!dev->of_node) {
-   dev->dma_pfn_offset = keystone_dma_pfn_offset;
-   dev_err(dev, "set dma_pfn_offset%08lx\n",
-   dev->dma_pfn_offset);
+   int ret = dma_attach_offset_range(dev, KEYSTONE_HIGH_PHYS_START,
+ KEYSTONE_LOW_PHYS_START,
+ KEYSTONE_HIGH_PHYS_SIZE);
+   dev_err(dev, "set dma_offset%08llx%s\n",
+   KEYSTONE_HIGH_PHYS_START - KEYSTONE_LOW_PHYS_START,
+   ret ? " failed" : "");
}
return NOTIFY_OK;
 }
@@ -51,11 +53,8 @@ static struct notifier_block platform_nb = {
 
 static void __init keystone_init(void)
 {
-   if (PHYS_OFFSET >= KEYSTONE_HIGH_PHYS_START) {
-   keystone_dma_pfn_offset = PFN_DOWN(KEYSTONE_HIGH_PHYS_START -
-  KEYSTONE_LOW_PHYS_START);
+   if (PHYS_OFFS

Re: [PATCH] Staging: speakup: Replace HTTP links with HTTPS ones

2020-07-15 Thread Samuel Thibault
Alexander A. Klimov, le lun. 13 juil. 2020 11:13:05 +0200, a ecrit:
> Rationale:
> Reduces attack surface on kernel devs opening the links for MITM
> as HTTPS traffic is much harder to manipulate.
> 
> Deterministic algorithm:
> For each file:
>   If not .svg:
> For each line:
>   If doesn't contain `\bxmlns\b`:
> For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
> If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
> If both the HTTP and HTTPS versions
> return 200 OK and serve the same content:
>   Replace HTTP with HTTPS.
> 
> Signed-off-by: Alexander A. Klimov 

Reviewed-by: Samuel Thibault 

Thanks!

> ---
>  Continuing my work started at 93431e0607e5.
>  See also: git log --oneline '--author=Alexander A. Klimov 
> ' v5.7..master
>  (Actually letting a shell for loop submit all this stuff for me.)
> 
>  If there are any URLs to be removed completely or at least not just 
> HTTPSified:
>  Just clearly say so and I'll *undo my change*.
>  See also: https://lkml.org/lkml/2020/6/27/64
> 
>  If there are any valid, but yet not changed URLs:
>  See: https://lkml.org/lkml/2020/6/26/837
> 
>  If you apply the patch, please let me know.
> 
>  Sorry again to all maintainers who complained about subject lines.
>  Now I realized that you want an actually perfect prefixes,
>  not just subsystem ones.
>  I tried my best...
>  And yes, *I could* (at least half-)automate it.
>  Impossible is nothing! :)
> 
> 
>  drivers/staging/speakup/spkguide.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/speakup/spkguide.txt 
> b/drivers/staging/speakup/spkguide.txt
> index 1e622cd34363..3782f6a09e97 100644
> --- a/drivers/staging/speakup/spkguide.txt
> +++ b/drivers/staging/speakup/spkguide.txt
> @@ -1531,7 +1531,7 @@ The Free Software Foundation may publish new, revised 
> versions
>  of the GNU Free Documentation License from time to time.  Such new
>  versions will be similar in spirit to the present version, but may
>  differ in detail to address new problems or concerns.  See
> -http://www.gnu.org/copyleft/.
> +https://www.gnu.org/copyleft/.
>  
>  Each version of the License is given a distinguishing version number.
>  If the Document specifies that a particular numbered version of this
> -- 
> 2.27.0
> 

-- 
Samuel
 J'ai un gros problème: j'ai cet exercice à rendre demain lundi, mais ma
 TI 89 ne sait pas le faire...
 Est-ce que quelqu'un pourrait m'aider??
 -+- OD In Guide du Neuneu Usenet : Comment ça ! Il faut réfléchir ?-+-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] binder: Don't use mmput() from shrinker function.

2020-07-15 Thread Tetsuo Handa
syzbot is reporting that mmput() from shrinker function has a risk of
deadlock [1]. Don't start synchronous teardown of mm when called from
shrinker function.

[1] 
https://syzkaller.appspot.com/bug?id=bc9e7303f537c41b2b0cc2dfcea3fc42964c2d45

Reported-by: syzbot 
Reported-by: syzbot 
Signed-off-by: Tetsuo Handa 
---
 drivers/android/binder_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
index 42c672f1584e..cbe6aa77d50d 100644
--- a/drivers/android/binder_alloc.c
+++ b/drivers/android/binder_alloc.c
@@ -947,7 +947,7 @@ enum lru_status binder_alloc_free_page(struct list_head 
*item,
trace_binder_unmap_user_end(alloc, index);
}
mmap_read_unlock(mm);
-   mmput(mm);
+   mmput_async(mm);
 
trace_binder_unmap_kernel_start(alloc, index);
 
-- 
2.18.4


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


[PATCH 0/3] Modernize tasklet callback API

2020-07-15 Thread Kees Cook
Hi,

This is the infrastructure changes to prepare the tasklet API for
conversion to passing the tasklet struct as the callback argument instead
of an arbitrary unsigned long. The first patch details why this is useful
(it's the same rationale as the timer_struct changes from a bit ago:
less abuse during memory corruption attacks, more in line with existing
ways of doing things in the kernel, save a little space in struct,
etc). Notably, the existing tasklet API use is much less messy, so there
is less to clean up.

It's not clear to me which tree this should go through... Greg since it
starts with a USB clean-up, -tip for timer or interrupt, or if I should
just carry it. I'm open to suggestions, but if I don't hear otherwise,
I'll just carry it.

My goal is to have this merged for v5.9-rc1 so that during the v5.10
development cycle the new API will be available. The entire tree of
changes is here[1] currently, but to split it up by maintainer the
infrastructure changes need to be landed first.

Review and Acks appreciated! :)

Thanks,

-Kees

[1] https://github.com/allenpais/tasklets/commits/tasklets_V2

Kees Cook (2):
  usb: gadget: udc: Avoid tasklet passing a global
  treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()

Romain Perier (1):
  tasklet: Introduce new initialization API

 drivers/input/keyboard/omap-keypad.c   |  2 +-
 drivers/input/serio/hil_mlc.c  |  2 +-
 drivers/net/wan/farsync.c  |  4 +--
 drivers/s390/crypto/ap_bus.c   |  2 +-
 drivers/staging/most/dim2/dim2.c   |  2 +-
 drivers/staging/octeon/ethernet-tx.c   |  2 +-
 drivers/tty/vt/keyboard.c  |  2 +-
 drivers/usb/gadget/udc/snps_udc_core.c |  6 ++---
 drivers/usb/host/fhci-sched.c  |  2 +-
 include/linux/interrupt.h  | 37 ++
 kernel/backtracetest.c |  2 +-
 kernel/debug/debug_core.c  |  2 +-
 kernel/irq/resend.c|  2 +-
 kernel/softirq.c   | 18 -
 net/atm/pppoatm.c  |  2 +-
 net/iucv/iucv.c|  2 +-
 sound/drivers/pcsp/pcsp_lib.c  |  2 +-
 17 files changed, 66 insertions(+), 25 deletions(-)

-- 
2.25.1

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


[PATCH 2/3] treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD()

2020-07-15 Thread Kees Cook
This converts all the existing DECLARE_TASKLET() (and ...DISABLED)
macros with DECLARE_TASKLET_OLD() in preparation for refactoring the
tasklet callback type. All existing DECLARE_TASKLET() users had a "0"
data argument, it has been removed here as well.

Signed-off-by: Kees Cook 
---
 drivers/input/keyboard/omap-keypad.c   |  2 +-
 drivers/input/serio/hil_mlc.c  |  2 +-
 drivers/net/wan/farsync.c  |  4 ++--
 drivers/s390/crypto/ap_bus.c   |  2 +-
 drivers/staging/most/dim2/dim2.c   |  2 +-
 drivers/staging/octeon/ethernet-tx.c   |  2 +-
 drivers/tty/vt/keyboard.c  |  2 +-
 drivers/usb/gadget/udc/snps_udc_core.c |  2 +-
 drivers/usb/host/fhci-sched.c  |  2 +-
 include/linux/interrupt.h  | 15 ++-
 kernel/backtracetest.c |  2 +-
 kernel/debug/debug_core.c  |  2 +-
 kernel/irq/resend.c|  2 +-
 net/atm/pppoatm.c  |  2 +-
 net/iucv/iucv.c|  2 +-
 sound/drivers/pcsp/pcsp_lib.c  |  2 +-
 16 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/drivers/input/keyboard/omap-keypad.c 
b/drivers/input/keyboard/omap-keypad.c
index 5fe7a5633e33..dbe836c7ff47 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -46,7 +46,7 @@ struct omap_kp {
unsigned short keymap[];
 };
 
-static DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0);
+static DECLARE_TASKLET_DISABLED_OLD(kp_tasklet, omap_kp_tasklet);
 
 static unsigned int *row_gpios;
 static unsigned int *col_gpios;
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index e1423f7648d6..65f4e9d62a67 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -77,7 +77,7 @@ static struct timer_list  hil_mlcs_kicker;
 static int hil_mlcs_probe;
 
 static void hil_mlcs_process(unsigned long unused);
-static DECLARE_TASKLET_DISABLED(hil_mlcs_tasklet, hil_mlcs_process, 0);
+static DECLARE_TASKLET_DISABLED_OLD(hil_mlcs_tasklet, hil_mlcs_process);
 
 
 /* #define HIL_MLC_DEBUG */
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 7916efce7188..f5198a391417 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -569,8 +569,8 @@ static void do_bottom_half_rx(struct fst_card_info *card);
 static void fst_process_tx_work_q(unsigned long work_q);
 static void fst_process_int_work_q(unsigned long work_q);
 
-static DECLARE_TASKLET(fst_tx_task, fst_process_tx_work_q, 0);
-static DECLARE_TASKLET(fst_int_task, fst_process_int_work_q, 0);
+static DECLARE_TASKLET_OLD(fst_tx_task, fst_process_tx_work_q);
+static DECLARE_TASKLET_OLD(fst_int_task, fst_process_int_work_q);
 
 static struct fst_card_info *fst_card_array[FST_MAX_CARDS];
 static spinlock_t fst_work_q_lock;
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index e71ca4a719a5..2589ccd257e3 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -93,7 +93,7 @@ static DECLARE_WORK(ap_scan_work, ap_scan_bus);
  * Tasklet & timer for AP request polling and interrupts
  */
 static void ap_tasklet_fn(unsigned long);
-static DECLARE_TASKLET(ap_tasklet, ap_tasklet_fn, 0);
+static DECLARE_TASKLET_OLD(ap_tasklet, ap_tasklet_fn);
 static DECLARE_WAIT_QUEUE_HEAD(ap_poll_wait);
 static struct task_struct *ap_poll_kthread;
 static DEFINE_MUTEX(ap_poll_thread_mutex);
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 8e0f27e61652..509c8012d20b 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(fcnt, "Num of frames per sub-buffer for sync 
channels as a powe
 static DEFINE_SPINLOCK(dim_lock);
 
 static void dim2_tasklet_fn(unsigned long data);
-static DECLARE_TASKLET(dim2_tasklet, dim2_tasklet_fn, 0);
+static DECLARE_TASKLET_OLD(dim2_tasklet, dim2_tasklet_fn);
 
 /**
  * struct hdm_channel - private structure to keep channel specific data
diff --git a/drivers/staging/octeon/ethernet-tx.c 
b/drivers/staging/octeon/ethernet-tx.c
index ab7dd8216006..9c71ad5af7b9 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -41,7 +41,7 @@
 #endif
 
 static void cvm_oct_tx_do_cleanup(unsigned long arg);
-static DECLARE_TASKLET(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup, 0);
+static DECLARE_TASKLET_OLD(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup);
 
 /* Maximum number of SKBs to try to free per xmit packet. */
 #define MAX_SKB_TO_FREE (MAX_OUT_QUEUE_DEPTH * 2)
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 568b2171f335..f80199984ee0 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -1236,7 +1236,7 @@ static void kbd_bh(unsigned long dummy)
}
 }
 
-DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
+DECLARE_TASKLET_DISABLED_OLD(keyboard_tasklet, kbd_bh);

[PATCH 3/3] tasklet: Introduce new initialization API

2020-07-15 Thread Kees Cook
From: Romain Perier 

Nowadays, modern kernel subsystems that use callbacks pass the data
structure associated with a given callback as argument to the callback.
The tasklet subsystem remains one which passes an arbitrary unsigned
long to the callback function. This has several problems:

- This keeps an extra field for storing the argument in each tasklet
  data structure, it bloats the tasklet_struct structure with a redundant
  .data field

- No type checking can be performed on this argument. Instead of
  using container_of() like other callback subsystems, it forces callbacks
  to do explicit type cast of the unsigned long argument into the required
  object type.

- Buffer overflows can overwrite the .func and the .data field, so
  an attacker can easily overwrite the function and its first argument
  to whatever it wants.

Add a new tasklet initialization API, via DECLARE_TASKLET() and
tasklet_setup(), which will replace the existing ones.

This work is greatly inspired by the timer_struct conversion series,
see commit e99e88a9d2b0 ("treewide: setup_timer() -> timer_setup()")

To avoid problems with both -Wcast-function-type (which is enabled in
the kernel via -Wextra is several subsystems), and with mismatched
function prototypes when build with Control Flow Integrity enabled,
this adds the "use_callback" member to let the tasklet caller choose
which union member to call through. Once all old API uses are removed,
this and the .data member will be removed as well. (On 64-bit this does
not grow the struct size as the new member fills the hole after atomic_t,
which is also "int" sized.)

Signed-off-by: Romain Perier 
Co-developed-by: Allen Pais 
Signed-off-by: Allen Pais 
Co-developed-by: Kees Cook 
Signed-off-by: Kees Cook 
---
 include/linux/interrupt.h | 24 +++-
 kernel/softirq.c  | 18 +-
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index b911196f03eb..15570b237e53 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -608,10 +608,30 @@ struct tasklet_struct
struct tasklet_struct *next;
unsigned long state;
atomic_t count;
-   void (*func)(unsigned long);
+   bool use_callback;
+   union {
+   void (*func)(unsigned long data);
+   void (*callback)(struct tasklet_struct *t);
+   };
unsigned long data;
 };
 
+#define DECLARE_TASKLET(name, _callback)   \
+struct tasklet_struct name = { \
+   .count = ATOMIC_INIT(0),\
+   .callback = _callback,  \
+   .use_callback = true,   \
+}
+
+#define DECLARE_TASKLET_DISABLED(name, _callback)  \
+struct tasklet_struct name = { \
+   .count = ATOMIC_INIT(1),\
+   .callback = _callback,  \
+}
+
+#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
+   container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
+
 #define DECLARE_TASKLET_OLD(name, _func)   \
 struct tasklet_struct name = { \
.count = ATOMIC_INIT(0),\
@@ -691,6 +711,8 @@ extern void tasklet_kill(struct tasklet_struct *t);
 extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
 extern void tasklet_init(struct tasklet_struct *t,
 void (*func)(unsigned long), unsigned long data);
+extern void tasklet_setup(struct tasklet_struct *t,
+ void (*callback)(struct tasklet_struct *));
 
 /*
  * Autoprobing for irqs:
diff --git a/kernel/softirq.c b/kernel/softirq.c
index c4201b7f42b1..292e7c2d2333 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -547,7 +547,10 @@ static void tasklet_action_common(struct softirq_action *a,
if (!test_and_clear_bit(TASKLET_STATE_SCHED,
&t->state))
BUG();
-   t->func(t->data);
+   if (t->use_callback)
+   t->callback(t);
+   else
+   t->func(t->data);
tasklet_unlock(t);
continue;
}
@@ -573,6 +576,18 @@ static __latent_entropy void tasklet_hi_action(struct 
softirq_action *a)
tasklet_action_common(a, this_cpu_ptr(&tasklet_hi_vec), HI_SOFTIRQ);
 }
 
+void tasklet_setup(struct tasklet_struct *t,
+  void (*callback)(struct tasklet_struct *))
+{
+   t->next = NULL;
+   t->state = 0;
+   atomic_set(&t->count, 0);
+   t->callback = callback;
+   t->use_callback = true;
+   t->data = 0;
+}
+EXPORT_SYMBOL(t

[PATCH 1/3] usb: gadget: udc: Avoid tasklet passing a global

2020-07-15 Thread Kees Cook
There's no reason for the tasklet callback to set an argument since it
always uses a global. Instead, use the global directly, in preparation
for converting the tasklet subsystem to modern callback conventions.

Signed-off-by: Kees Cook 
---
 drivers/usb/gadget/udc/snps_udc_core.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/snps_udc_core.c 
b/drivers/usb/gadget/udc/snps_udc_core.c
index 3fcded31405a..afdd28f332ce 100644
--- a/drivers/usb/gadget/udc/snps_udc_core.c
+++ b/drivers/usb/gadget/udc/snps_udc_core.c
@@ -96,9 +96,7 @@ static int stop_pollstall_timer;
 static DECLARE_COMPLETION(on_pollstall_exit);
 
 /* tasklet for usb disconnect */
-static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect,
-   (unsigned long) &udc);
-
+static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, 0);
 
 /* endpoint names used for print */
 static const char ep0_string[] = "ep0in";
@@ -1661,7 +1659,7 @@ static void usb_disconnect(struct udc *dev)
 /* Tasklet for disconnect to be outside of interrupt context */
 static void udc_tasklet_disconnect(unsigned long par)
 {
-   struct udc *dev = (struct udc *)(*((struct udc **) par));
+   struct udc *dev = udc;
u32 tmp;
 
DBG(dev, "Tasklet disconnect\n");
-- 
2.25.1

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


Re: [PATCH 1/1] staging: android: ashmem: Fix lockdep warning for write operation

2020-07-15 Thread Eric Biggers
On Wed, Jul 15, 2020 at 07:45:27PM -0700, Suren Baghdasaryan wrote:
> syzbot report [1] describes a deadlock when write operation against an
> ashmem fd executed at the time when ashmem is shrinking its cache results
> in the following lock sequence:
> 
> Possible unsafe locking scenario:
> 
> CPU0CPU1
> 
>lock(fs_reclaim);
> lock(&sb->s_type->i_mutex_key#13);
> lock(fs_reclaim);
>lock(&sb->s_type->i_mutex_key#13);
> 
> kswapd takes fs_reclaim and then inode_lock while generic_perform_write
> takes inode_lock and then fs_reclaim. However ashmem does not support
> writing into backing shmem with a write syscall. The only way to change
> its content is to mmap it and operate on mapped memory. Therefore the race
> that lockdep is warning about is not valid. Resolve this by introducing a
> separate lockdep class for the backing shmem inodes.
> 
> [1]: https://lkml.kernel.org/lkml/0b5f9d059aa20...@google.com/
> 
> Signed-off-by: Suren Baghdasaryan 

Please add proper tags:

Reported-by: syzbot+7a0d9d0b26efefe61...@syzkaller.appspotmail.com
Fixes: ...
Cc: sta...@vger.kernel.org


The Reported-by tag to use was given in the original syzbot report.

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


[PATCH] staging: rtl8712: Fixes coding style in several headers

2020-07-15 Thread Qiu Wenbo
This patch fixes warnings in several headers found by the checkpatch.pl tool.

Signed-off-by: Qiu Wenbo 
---
 drivers/staging/rtl8712/rtl871x_event.h   | 15 ++-
 drivers/staging/rtl8712/rtl871x_io.h  |  3 ++-
 drivers/staging/rtl8712/rtl871x_pwrctrl.h | 15 ++-
 drivers/staging/rtl8712/rtl871x_xmit.h| 15 ++-
 4 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
b/drivers/staging/rtl8712/rtl871x_event.h
index d9a5476d2426..0e59d0ee6aae 100644
--- a/drivers/staging/rtl8712/rtl871x_event.h
+++ b/drivers/staging/rtl8712/rtl871x_event.h
@@ -78,13 +78,16 @@ struct event_node {
unsigned char *node;
unsigned char evt_code;
unsigned short evt_sz;
-   /*volatile*/ int *caller_ff_tail;
+   /*volatile*/
+   int *caller_ff_tail;
int caller_ff_sz;
 };
 
 struct c2hevent_queue {
-   /*volatile*/ inthead;
-   /*volatile*/ inttail;
+   /*volatile*/
+   int head;
+   /*volatile*/
+   int tail;
struct  event_node  nodes[C2HEVENT_SZ];
unsigned char   seq;
 };
@@ -92,8 +95,10 @@ struct c2hevent_queue {
 #define NETWORK_QUEUE_SZ   4
 
 struct network_queue {
-   /*volatile*/ inthead;
-   /*volatile*/ inttail;
+   /*volatile*/
+   int head;
+   /*volatile*/
+   int tail;
struct wlan_bssid_ex networks[NETWORK_QUEUE_SZ];
 };
 
diff --git a/drivers/staging/rtl8712/rtl871x_io.h 
b/drivers/staging/rtl8712/rtl871x_io.h
index c20dd5a6bbd1..2e269b71072c 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
+++ b/drivers/staging/rtl8712/rtl871x_io.h
@@ -101,7 +101,8 @@ struct  _io_ops {
 struct io_req {
struct list_head list;
u32 addr;
-   /*volatile*/ u32val;
+   /*volatile*/
+   u32 val;
u32 command;
u32 status;
u8  *pbuf;
diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h 
b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index dd5a79f90b1a..e6b740c09120 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -77,14 +77,19 @@ struct reportpwrstate_parm {
 
 struct pwrctrl_priv {
struct mutex mutex_lock;
-   /*volatile*/ u8 rpwm; /* requested power state for fw */
+   /*volatile*/
+   u8 rpwm; /* requested power state for fw */
/* fw current power state. updated when 1. read from HCPWM or
 * 2. driver lowers power level
 */
-   /*volatile*/ u8 cpwm;
-   /*volatile*/ u8 tog; /* toggling */
-   /*volatile*/ u8 cpwm_tog; /* toggling */
-   /*volatile*/ u8 tgt_rpwm; /* wanted power state */
+   /*volatile*/
+   u8 cpwm;
+   /*volatile*/
+   u8 tog; /* toggling */
+   /*volatile*/
+   u8 cpwm_tog; /* toggling */
+   /*volatile*/
+   u8 tgt_rpwm; /* wanted power state */
uint pwr_mode;
uint smart_ps;
uint alives;
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.h 
b/drivers/staging/rtl8712/rtl871x_xmit.h
index f227828094bf..6d2e12b35670 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.h
+++ b/drivers/staging/rtl8712/rtl871x_xmit.h
@@ -182,11 +182,16 @@ struct sta_xmit_priv {
 };
 
 struct hw_txqueue {
-   /*volatile*/ sint   head;
-   /*volatile*/ sint   tail;
-   /*volatile*/ sint   free_sz;/*in units of 64 bytes*/
-   /*volatile*/ sint  free_cmdsz;
-   /*volatile*/ sinttxsz[8];
+   /*volatile*/
+   sinthead;
+   /*volatile*/
+   sinttail;
+   /*volatile*/
+   sintfree_sz;/*in units of 64 bytes*/
+   /*volatile*/
+   sint  free_cmdsz;
+   /*volatile*/
+   sint txsz[8];
uintff_hwaddr;
uintcmd_hwaddr;
sintac_tag;
-- 
2.27.0

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