hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/char/ipmi/ipmi_devintf.c
....@@ -29,7 +29,6 @@
2929 struct ipmi_user *user;
3030 spinlock_t recv_msg_lock;
3131 struct list_head recv_msgs;
32
- struct file *file;
3332 struct fasync_struct *fasync_queue;
3433 wait_queue_head_t wait;
3534 struct mutex recv_mutex;
....@@ -94,8 +93,6 @@
9493 priv = kmalloc(sizeof(*priv), GFP_KERNEL);
9594 if (!priv)
9695 return -ENOMEM;
97
-
98
- priv->file = file;
9996
10097 rv = ipmi_create_user(if_num,
10198 &ipmi_hndlrs,
....@@ -207,7 +204,7 @@
207204 struct list_head *entry;
208205 struct ipmi_recv_msg *msg;
209206 unsigned long flags;
210
- int rv = 0;
207
+ int rv = 0, rv2 = 0;
211208
212209 /* We claim a mutex because we don't want two
213210 users getting something from the queue at a time.
....@@ -250,7 +247,7 @@
250247
251248 if (msg->msg.data_len > 0) {
252249 if (rsp->msg.data_len < msg->msg.data_len) {
253
- rv = -EMSGSIZE;
250
+ rv2 = -EMSGSIZE;
254251 if (trunc)
255252 msg->msg.data_len = rsp->msg.data_len;
256253 else
....@@ -274,7 +271,7 @@
274271
275272 mutex_unlock(&priv->recv_mutex);
276273 ipmi_free_recv_msg(msg);
277
- return 0;
274
+ return rv2;
278275
279276 recv_putback_on_err:
280277 /* If we got an error, put the message back onto
....@@ -818,8 +815,7 @@
818815
819816 entry = kmalloc(sizeof(*entry), GFP_KERNEL);
820817 if (!entry) {
821
- printk(KERN_ERR "ipmi_devintf: Unable to create the"
822
- " ipmi class device link\n");
818
+ pr_err("ipmi_devintf: Unable to create the ipmi class device link\n");
823819 return;
824820 }
825821 entry->dev = dev;
....@@ -861,18 +857,18 @@
861857 if (ipmi_major < 0)
862858 return -EINVAL;
863859
864
- printk(KERN_INFO "ipmi device interface\n");
860
+ pr_info("ipmi device interface\n");
865861
866862 ipmi_class = class_create(THIS_MODULE, "ipmi");
867863 if (IS_ERR(ipmi_class)) {
868
- printk(KERN_ERR "ipmi: can't register device class\n");
864
+ pr_err("ipmi: can't register device class\n");
869865 return PTR_ERR(ipmi_class);
870866 }
871867
872868 rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops);
873869 if (rv < 0) {
874870 class_destroy(ipmi_class);
875
- printk(KERN_ERR "ipmi: can't get major %d\n", ipmi_major);
871
+ pr_err("ipmi: can't get major %d\n", ipmi_major);
876872 return rv;
877873 }
878874
....@@ -884,7 +880,7 @@
884880 if (rv) {
885881 unregister_chrdev(ipmi_major, DEVICE_NAME);
886882 class_destroy(ipmi_class);
887
- printk(KERN_WARNING "ipmi: can't register smi watcher\n");
883
+ pr_warn("ipmi: can't register smi watcher\n");
888884 return rv;
889885 }
890886