mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
ipmi: Use LIST_HEAD() to initialize on stack list head
Use LIST_HEAD to initialize on stack list head. No intentional functional impact. Change generated with below coccinelle script: @@ identifier name; @@ - struct list_head name; + LIST_HEAD(name); ... when != name - INIT_LIST_HEAD(&name); Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Message-ID: <20260519055722.13161-1-jszhang@kernel.org> Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
parent
d08048d4e0
commit
cc3f0c6618
|
|
@ -1610,14 +1610,12 @@ int ipmi_set_gets_events(struct ipmi_user *user, bool val)
|
|||
{
|
||||
struct ipmi_smi *intf = user->intf;
|
||||
struct ipmi_recv_msg *msg, *msg2;
|
||||
struct list_head msgs;
|
||||
LIST_HEAD(msgs);
|
||||
|
||||
user = acquire_ipmi_user(user);
|
||||
if (!user)
|
||||
return -ENODEV;
|
||||
|
||||
INIT_LIST_HEAD(&msgs);
|
||||
|
||||
mutex_lock(&intf->events_mutex);
|
||||
if (user->gets_events == val)
|
||||
goto out;
|
||||
|
|
@ -3785,10 +3783,9 @@ static void cleanup_smi_msgs(struct ipmi_smi *intf)
|
|||
struct seq_table *ent;
|
||||
struct ipmi_smi_msg *msg;
|
||||
struct list_head *entry;
|
||||
struct list_head tmplist;
|
||||
LIST_HEAD(tmplist);
|
||||
|
||||
/* Clear out our transmit queues and hold the messages. */
|
||||
INIT_LIST_HEAD(&tmplist);
|
||||
list_splice_tail(&intf->hp_xmit_msgs, &tmplist);
|
||||
list_splice_tail(&intf->xmit_msgs, &tmplist);
|
||||
|
||||
|
|
@ -4442,7 +4439,7 @@ static int handle_read_event_rsp(struct ipmi_smi *intf,
|
|||
struct ipmi_smi_msg *msg)
|
||||
{
|
||||
struct ipmi_recv_msg *recv_msg, *recv_msg2;
|
||||
struct list_head msgs;
|
||||
LIST_HEAD(msgs);
|
||||
struct ipmi_user *user;
|
||||
int rv = 0, deliver_count = 0;
|
||||
|
||||
|
|
@ -4457,8 +4454,6 @@ static int handle_read_event_rsp(struct ipmi_smi *intf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&msgs);
|
||||
|
||||
mutex_lock(&intf->events_mutex);
|
||||
|
||||
ipmi_inc_stat(intf, events);
|
||||
|
|
@ -5101,7 +5096,7 @@ static void check_msg_timeout(struct ipmi_smi *intf, struct seq_table *ent,
|
|||
static bool ipmi_timeout_handler(struct ipmi_smi *intf,
|
||||
unsigned long timeout_period)
|
||||
{
|
||||
struct list_head timeouts;
|
||||
LIST_HEAD(timeouts);
|
||||
struct ipmi_recv_msg *msg, *msg2;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
|
@ -5120,7 +5115,6 @@ static bool ipmi_timeout_handler(struct ipmi_smi *intf,
|
|||
* have timed out, putting them in the timeouts
|
||||
* list.
|
||||
*/
|
||||
INIT_LIST_HEAD(&timeouts);
|
||||
mutex_lock(&intf->seq_lock);
|
||||
if (intf->ipmb_maintenance_mode_timeout) {
|
||||
if (intf->ipmb_maintenance_mode_timeout <= timeout_period)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user