* [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list
@ 2022-04-08 11:41 Paran Lee
2022-04-10 19:17 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Paran Lee @ 2022-04-08 11:41 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: linux-kernel, Craig Gallek, Austin Kim
Hello, I am Paran Lee.
Since we have a macro defined in our IRQ subsystem internal functions to
traverse the list of actions, how about refactoring this loop?
- genirq: Use a common macro to go through the actions list
(f944b5a7aff05a244a6c8cac297819af09a199e4)
have a good day!
Paran Lee.
Signed-off-by: Paran Lee <p4ranlee@gmail.com>
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 939d21cd55c3..34a0cefff712 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -246,12 +246,12 @@ static ssize_t actions_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj);
- struct irqaction *action;
+ struct irqaction *action = NULL;
ssize_t ret = 0;
char *p = "";
raw_spin_lock_irq(&desc->lock);
- for (action = desc->action; action != NULL; action = action->next) {
+ for_each_action_of_desc(desc, action) {
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
p, action->name);
p = ",";
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list
2022-04-08 11:41 [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list Paran Lee
@ 2022-04-10 19:17 ` Thomas Gleixner
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2022-04-10 19:17 UTC (permalink / raw)
To: Paran Lee; +Cc: linux-kernel, Craig Gallek, Austin Kim
Paran,
On Fri, Apr 08 2022 at 20:41, Paran Lee wrote:
thanks for providing this patch.
> Hello, I am Paran Lee.
>
> Since we have a macro defined in our IRQ subsystem internal functions to
> traverse the list of actions, how about refactoring this loop?
>
> - genirq: Use a common macro to go through the actions list
> (f944b5a7aff05a244a6c8cac297819af09a199e4)
>
> have a good day!
> Paran Lee.
Neither 'Hello' nor 'have a good day' are part of the change log.
Also please write the changelog in a factual way and not in form of a
question. If you want to add a reference to a git commit, then please
use the canonical form as described in Documentation/process, where you
also find the general patch submission rules. There is also a tip tree
specific chapter:
https://www.kernel.org/doc/html/latest/process/maintainer-tip.html?highlight=x86#patch-submission-notes
Following these rules makes everyones life simpler.
> Signed-off-by: Paran Lee <p4ranlee@gmail.com>
> ---
> kernel/irq/irqdesc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
> index 939d21cd55c3..34a0cefff712 100644
> --- a/kernel/irq/irqdesc.c
> +++ b/kernel/irq/irqdesc.c
> @@ -246,12 +246,12 @@ static ssize_t actions_show(struct kobject *kobj,
> struct kobj_attribute *attr, char *buf)
> {
> struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj);
> - struct irqaction *action;
> + struct irqaction *action = NULL;
There is no NULL initialization required.
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list
@ 2022-04-08 8:09 Paran Lee
0 siblings, 0 replies; 3+ messages in thread
From: Paran Lee @ 2022-04-08 8:09 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: linux-kernel, Craig Gallek, Austin Kim
Since we have a macro defined in our IRQ subsystem internal functions to traverse the list of actions, how about refactoring this loop?
- genirq: Use a common macro to go through the actions list (f944b5a7aff05a244a6c8cac297819af09a199e4)
Signed-off-by: Paran Lee <p4ranlee@gmail.com>
---
kernel/irq/irqdesc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 939d21cd55c3..34a0cefff712 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -246,12 +246,12 @@ static ssize_t actions_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj);
- struct irqaction *action;
+ struct irqaction *action = NULL;
ssize_t ret = 0;
char *p = "";
raw_spin_lock_irq(&desc->lock);
- for (action = desc->action; action != NULL; action = action->next) {
+ for_each_action_of_desc(desc, action) {
ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
p, action->name);
p = ",";
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-10 19:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 11:41 [PATCH] genirq: Refactor actions_show loop block using a common macro to go through the actions list Paran Lee
2022-04-10 19:17 ` Thomas Gleixner
-- strict thread matches above, loose matches on Subject: below --
2022-04-08 8:09 Paran Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).