* [PATCH v2 0/2] Staging: media: Using set_up timer
@ 2015-02-18 16:52 Vaishali Thakkar
2015-02-18 16:52 ` [PATCH v2 1/2] Staging: media: lirc: Use setup_timer Vaishali Thakkar
2015-02-18 16:52 ` [PATCH v2 2/2] Staging: media: Change data value in setup_timer function Vaishali Thakkar
0 siblings, 2 replies; 3+ messages in thread
From: Vaishali Thakkar @ 2015-02-18 16:52 UTC (permalink / raw)
To: outreachy-kernel
This patch-set introduces the use of function setup_timer
instead of structure assignments as it is the preferred
way to setup and set the timer. This change is done using
Coccinelle. Also, data value of setup_timer function is
changed here.
Vaishali Thakkar (2):
Staging: media: lirc: Use setup_timer
Staging: media: Change data value in setup_timer
drivers/staging/media/lirc/lirc_sir.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] Staging: media: lirc: Use setup_timer
2015-02-18 16:52 [PATCH v2 0/2] Staging: media: Using set_up timer Vaishali Thakkar
@ 2015-02-18 16:52 ` Vaishali Thakkar
2015-02-18 16:52 ` [PATCH v2 2/2] Staging: media: Change data value in setup_timer function Vaishali Thakkar
1 sibling, 0 replies; 3+ messages in thread
From: Vaishali Thakkar @ 2015-02-18 16:52 UTC (permalink / raw)
To: outreachy-kernel
This patch introduces the use of function setup_timer
instead of structure assignments as it is the preferred
way to setup and set the timer.
This is done using Coccinelle and semantic patch used is
as follows:
@@
expression x,y,z;
@@
- init_timer (&x);
+ setup_timer (&x, y, z);
- x.function = y;
- x.data = z;
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
Changes in v2:
-Changed commit log
drivers/staging/media/lirc/lirc_sir.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c
index 39f4733..d1ada8c 100644
--- a/drivers/staging/media/lirc/lirc_sir.c
+++ b/drivers/staging/media/lirc/lirc_sir.c
@@ -683,9 +683,7 @@ static int init_port(void)
}
pr_info("I/O port 0x%.4x, IRQ %d.\n", io, irq);
- init_timer(&timerlist);
- timerlist.function = sir_timeout;
- timerlist.data = 0xabadcafe;
+ setup_timer(&timerlist, sir_timeout, 0xabadcafe);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] Staging: media: Change data value in setup_timer function
2015-02-18 16:52 [PATCH v2 0/2] Staging: media: Using set_up timer Vaishali Thakkar
2015-02-18 16:52 ` [PATCH v2 1/2] Staging: media: lirc: Use setup_timer Vaishali Thakkar
@ 2015-02-18 16:52 ` Vaishali Thakkar
1 sibling, 0 replies; 3+ messages in thread
From: Vaishali Thakkar @ 2015-02-18 16:52 UTC (permalink / raw)
To: outreachy-kernel
Here, data value 0xabadcafe in function setup_timer
seems like a nonsense value and timer handler function
is not using it anyway. So, change it to 0.
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
---
Changes in v2:
-Add this change as a seperate patch
-Here, I could make a private structure for the
driver to hold the various global variables but
that would be a major change and may be need a
lot of work. So, I am proposing a simple change
here. I can go for those changes if Greg thinks
its good for this driver as I don't know the goal
of this driver.
drivers/staging/media/lirc/lirc_sir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c
index d1ada8c..29087f6 100644
--- a/drivers/staging/media/lirc/lirc_sir.c
+++ b/drivers/staging/media/lirc/lirc_sir.c
@@ -683,7 +683,7 @@ static int init_port(void)
}
pr_info("I/O port 0x%.4x, IRQ %d.\n", io, irq);
- setup_timer(&timerlist, sir_timeout, 0xabadcafe);
+ setup_timer(&timerlist, sir_timeout, 0);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-18 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 16:52 [PATCH v2 0/2] Staging: media: Using set_up timer Vaishali Thakkar
2015-02-18 16:52 ` [PATCH v2 1/2] Staging: media: lirc: Use setup_timer Vaishali Thakkar
2015-02-18 16:52 ` [PATCH v2 2/2] Staging: media: Change data value in setup_timer function Vaishali Thakkar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.