<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/input/touchscreen/touchwin.c, branch v6.12.80</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>Input: touchscreen - use sizeof(*pointer) instead of sizeof(type)</title>
<updated>2024-06-09T21:38:38+00:00</updated>
<author>
<name>Erick Archer</name>
<email>erick.archer@outlook.com</email>
</author>
<published>2024-06-08T14:34:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=f81d03d43965261056d963572d0335645008a8e8'/>
<id>f81d03d43965261056d963572d0335645008a8e8</id>
<content type='text'>
It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter).

The refactoring is mostly trivial except for "usbtouchscreen.c"
file. Here, in the "mtouch_alloc" and "nexio_alloc" functions,
it is necessary to use a variable with a predefined type instead
of the "usbtouch-&gt;priv" variable (void * type). This way, the
"sizeof" operator can now know the correct size. Moreover, we
need to set the "usbtouch-&gt;priv" pointer after the memory
allocation since now the "kmalloc" return value is not assigned
directly.

This patch has no effect on runtime behavior.

Signed-off-by: Erick Archer &lt;erick.archer@outlook.com&gt;
Link: https://lore.kernel.org/r/AS8PR02MB723708364CC0DF2EAAFEE5968BC42@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter).

The refactoring is mostly trivial except for "usbtouchscreen.c"
file. Here, in the "mtouch_alloc" and "nexio_alloc" functions,
it is necessary to use a variable with a predefined type instead
of the "usbtouch-&gt;priv" variable (void * type). This way, the
"sizeof" operator can now know the correct size. Moreover, we
need to set the "usbtouch-&gt;priv" pointer after the memory
allocation since now the "kmalloc" return value is not assigned
directly.

This patch has no effect on runtime behavior.

Signed-off-by: Erick Archer &lt;erick.archer@outlook.com&gt;
Link: https://lore.kernel.org/r/AS8PR02MB723708364CC0DF2EAAFEE5968BC42@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500</title>
<updated>2019-06-19T15:09:55+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-04T08:11:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d2912cb15bdda8ba4a5dd73396ad62641af2f520'/>
<id>d2912cb15bdda8ba4a5dd73396ad62641af2f520</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: touchwin - constify serio_device_id</title>
<updated>2017-08-19T00:15:37+00:00</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2017-08-19T00:12:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a110a953bbe3ee338301fdd30783a2a8033bff11'/>
<id>a110a953bbe3ee338301fdd30783a2a8033bff11</id>
<content type='text'>
serio_device_id are not supposed to change at runtime. All functions
working with serio_device_id provided by &lt;linux/serio.h&gt; work with
const serio_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
serio_device_id are not supposed to change at runtime. All functions
working with serio_device_id provided by &lt;linux/serio.h&gt; work with
const serio_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Input: delete non-required instances of include &lt;linux/init.h&gt;</title>
<updated>2014-01-07T07:23:57+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2014-01-06T18:27:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=bf9a9f8e5105b13cea954b254008f383ed0b4045'/>
<id>bf9a9f8e5105b13cea954b254008f383ed0b4045</id>
<content type='text'>
None of these files are actually using any __init type directives
and hence don't need to include &lt;linux/init.h&gt;.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
None of these files are actually using any __init type directives
and hence don't need to include &lt;linux/init.h&gt;.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: serio - use module_serio_driver</title>
<updated>2012-04-04T16:25:43+00:00</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@gmail.com</email>
</author>
<published>2012-04-04T06:50:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=65ac9f7a23c934ee8c40dc20955e75db4924bfea'/>
<id>65ac9f7a23c934ee8c40dc20955e75db4924bfea</id>
<content type='text'>
This patch converts the drivers in drivers/input/* to use
module_serio_driver() macro which makes the code smaller and
a bit simpler.

Signed-off-by: Axel Lin &lt;axel.lin@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch converts the drivers in drivers/input/* to use
module_serio_driver() macro which makes the code smaller and
a bit simpler.

Signed-off-by: Axel Lin &lt;axel.lin@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>get rid of input BIT* duplicate defines</title>
<updated>2007-10-19T18:53:42+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2007-10-19T06:40:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=7b19ada2ed3c1eccb9fe94d74b05e1428224663d'/>
<id>7b19ada2ed3c1eccb9fe94d74b05e1428224663d</id>
<content type='text'>
get rid of input BIT* duplicate defines

use newly global defined macros for input layer. Also remove includes of
input.h from non-input sources only for BIT macro definiton. Define the
macro temporarily in local manner, all those local definitons will be
removed further in this patchset (to not break bisecting).
BIT macro will be globally defined (1&lt;&lt;x)

Signed-off-by: Jiri Slaby &lt;jirislaby@gmail.com&gt;
Cc: &lt;dtor@mail.ru&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: &lt;lenb@kernel.org&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: &lt;perex@suse.cz&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Cc: &lt;vernux@us.ibm.com&gt;
Cc: &lt;malattia@linux.it&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
get rid of input BIT* duplicate defines

use newly global defined macros for input layer. Also remove includes of
input.h from non-input sources only for BIT macro definiton. Define the
macro temporarily in local manner, all those local definitons will be
removed further in this patchset (to not break bisecting).
BIT macro will be globally defined (1&lt;&lt;x)

Signed-off-by: Jiri Slaby &lt;jirislaby@gmail.com&gt;
Cc: &lt;dtor@mail.ru&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: &lt;lenb@kernel.org&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: &lt;perex@suse.cz&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Cc: &lt;vernux@us.ibm.com&gt;
Cc: &lt;malattia@linux.it&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: touchscreens - switch to using input_dev-&gt;dev.parent</title>
<updated>2007-04-12T05:35:14+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@insightbb.com</email>
</author>
<published>2007-04-12T05:35:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a5394fb075a80212765ee3cd4a7842bdccf5fc0a'/>
<id>a5394fb075a80212765ee3cd4a7842bdccf5fc0a</id>
<content type='text'>
In preparation for struct class_device -&gt; struct device input
core conversion, switch to using input_dev-&gt;dev.parent when
specifying device position in sysfs tree.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In preparation for struct class_device -&gt; struct device input
core conversion, switch to using input_dev-&gt;dev.parent when
specifying device position in sysfs tree.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: drivers/input/touchscreen - don't access dev-&gt;private directly</title>
<updated>2007-04-12T05:34:08+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@insightbb.com</email>
</author>
<published>2007-04-12T05:34:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=40b9b0b82e664bfdf26fd33014d52e23ff80b9f4'/>
<id>40b9b0b82e664bfdf26fd33014d52e23ff80b9f4</id>
<content type='text'>
Use input_get_drvdata() and input_set_drvdata() instead.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use input_get_drvdata() and input_set_drvdata() instead.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Input: handle serio_register_driver() errors</title>
<updated>2006-11-24T04:35:10+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2006-11-24T04:35:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=153a9df01c0d1ecdc56161c7a0f830325145dd64'/>
<id>153a9df01c0d1ecdc56161c7a0f830325145dd64</id>
<content type='text'>
Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>IRQ: Maintain regs pointer globally rather than passing to IRQ handlers</title>
<updated>2006-10-05T14:10:12+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-10-05T13:55:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=7d12e780e003f93433d49ce78cfedf4b4c52adc5'/>
<id>7d12e780e003f93433d49ce78cfedf4b4c52adc5</id>
<content type='text'>
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
</pre>
</div>
</content>
</entry>
</feed>
