Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] IPMI: tidy up various things

Tidy up various coding standard things, mostly removing the space after !,
but also break some long lines and fix a few other spacing inconsistencies.
Also fixes some bad error reporting when deleting an IPMI user.

Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Corey Minyard and committed by
Linus Torvalds
8a3628d5 453823ba

+35 -33
+4 -4
drivers/char/ipmi/ipmi_kcs_sm.c
··· 227 227 static inline int check_obf(struct si_sm_data *kcs, unsigned char status, 228 228 long time) 229 229 { 230 - if (! GET_STATUS_OBF(status)) { 230 + if (!GET_STATUS_OBF(status)) { 231 231 kcs->obf_timeout -= time; 232 232 if (kcs->obf_timeout < 0) { 233 233 start_error_recovery(kcs, "OBF not ready in time"); ··· 407 407 } 408 408 409 409 if (state == KCS_READ_STATE) { 410 - if (! check_obf(kcs, status, time)) 410 + if (!check_obf(kcs, status, time)) 411 411 return SI_SM_CALL_WITH_DELAY; 412 412 read_next_byte(kcs); 413 413 } else { ··· 447 447 "Not in read state for error2"); 448 448 break; 449 449 } 450 - if (! check_obf(kcs, status, time)) 450 + if (!check_obf(kcs, status, time)) 451 451 return SI_SM_CALL_WITH_DELAY; 452 452 453 453 clear_obf(kcs, status); ··· 462 462 break; 463 463 } 464 464 465 - if (! check_obf(kcs, status, time)) 465 + if (!check_obf(kcs, status, time)) 466 466 return SI_SM_CALL_WITH_DELAY; 467 467 468 468 clear_obf(kcs, status);
+25 -23
drivers/char/ipmi/ipmi_msghandler.c
··· 557 557 558 558 static void deliver_response(struct ipmi_recv_msg *msg) 559 559 { 560 - if (! msg->user) { 560 + if (!msg->user) { 561 561 ipmi_smi_t intf = msg->user_msg_data; 562 562 unsigned long flags; 563 563 ··· 598 598 (i+1)%IPMI_IPMB_NUM_SEQ != intf->curr_seq; 599 599 i = (i+1)%IPMI_IPMB_NUM_SEQ) 600 600 { 601 - if (! intf->seq_table[i].inuse) 601 + if (!intf->seq_table[i].inuse) 602 602 break; 603 603 } 604 604 605 - if (! intf->seq_table[i].inuse) { 605 + if (!intf->seq_table[i].inuse) { 606 606 intf->seq_table[i].recv_msg = recv_msg; 607 607 608 608 /* Start with the maximum timeout, when the send response ··· 763 763 } 764 764 765 765 new_user = kmalloc(sizeof(*new_user), GFP_KERNEL); 766 - if (! new_user) 766 + if (!new_user) 767 767 return -ENOMEM; 768 768 769 769 spin_lock_irqsave(&interfaces_lock, flags); ··· 819 819 820 820 int ipmi_destroy_user(ipmi_user_t user) 821 821 { 822 - int rv = -ENODEV; 823 822 ipmi_smi_t intf = user->intf; 824 823 int i; 825 824 unsigned long flags; 826 825 struct cmd_rcvr *rcvr; 827 826 struct cmd_rcvr *rcvrs = NULL; 828 827 829 - user->valid = 1; 828 + user->valid = 0; 830 829 831 830 /* Remove the user from the interface's sequence table. */ 832 831 spin_lock_irqsave(&intf->seq_lock, flags); ··· 870 871 871 872 kref_put(&user->refcount, free_user); 872 873 873 - return rv; 874 + return 0; 874 875 } 875 876 876 877 void ipmi_get_version(ipmi_user_t user, ··· 935 936 936 937 if (val) { 937 938 /* Deliver any queued events. */ 938 - list_for_each_entry_safe(msg, msg2, &intf->waiting_events, link) { 939 + list_for_each_entry_safe(msg, msg2, &intf->waiting_events, 940 + link) { 939 941 list_del(&msg->link); 940 942 list_add_tail(&msg->link, &msgs); 941 943 } ··· 978 978 979 979 980 980 rcvr = kmalloc(sizeof(*rcvr), GFP_KERNEL); 981 - if (! rcvr) 981 + if (!rcvr) 982 982 return -ENOMEM; 983 983 rcvr->cmd = cmd; 984 984 rcvr->netfn = netfn; ··· 1514 1514 unsigned char saddr, lun; 1515 1515 int rv; 1516 1516 1517 - if (! user) 1517 + if (!user) 1518 1518 return -EINVAL; 1519 1519 rv = check_addr(user->intf, addr, &saddr, &lun); 1520 1520 if (rv) ··· 1545 1545 unsigned char saddr, lun; 1546 1546 int rv; 1547 1547 1548 - if (! user) 1548 + if (!user) 1549 1549 return -EINVAL; 1550 1550 rv = check_addr(user->intf, addr, &saddr, &lun); 1551 1551 if (rv) ··· 1570 1570 char *out = (char *) page; 1571 1571 ipmi_smi_t intf = data; 1572 1572 int i; 1573 - int rv= 0; 1573 + int rv = 0; 1574 1574 1575 1575 for (i = 0; i < IPMI_MAX_CHANNELS; i++) 1576 1576 rv += sprintf(out+rv, "%x ", intf->channels[i].address); ··· 1989 1989 } else { 1990 1990 bmc->dev = platform_device_alloc("ipmi_bmc", 1991 1991 bmc->id.device_id); 1992 - if (! bmc->dev) { 1992 + if (!bmc->dev) { 1993 1993 printk(KERN_ERR 1994 1994 "ipmi_msghandler:" 1995 1995 " Unable to allocate platform device\n"); ··· 2621 2621 spin_unlock_irqrestore(&intf->counter_lock, flags); 2622 2622 2623 2623 recv_msg = ipmi_alloc_recv_msg(); 2624 - if (! recv_msg) { 2624 + if (!recv_msg) { 2625 2625 /* We couldn't allocate memory for the 2626 2626 message, so requeue it for handling 2627 2627 later. */ ··· 2776 2776 spin_unlock_irqrestore(&intf->counter_lock, flags); 2777 2777 2778 2778 recv_msg = ipmi_alloc_recv_msg(); 2779 - if (! recv_msg) { 2779 + if (!recv_msg) { 2780 2780 /* We couldn't allocate memory for the 2781 2781 message, so requeue it for handling 2782 2782 later. */ ··· 2868 2868 events. */ 2869 2869 rcu_read_lock(); 2870 2870 list_for_each_entry_rcu(user, &intf->users, link) { 2871 - if (! user->gets_events) 2871 + if (!user->gets_events) 2872 2872 continue; 2873 2873 2874 2874 recv_msg = ipmi_alloc_recv_msg(); 2875 - if (! recv_msg) { 2875 + if (!recv_msg) { 2876 2876 rcu_read_unlock(); 2877 - list_for_each_entry_safe(recv_msg, recv_msg2, &msgs, link) { 2877 + list_for_each_entry_safe(recv_msg, recv_msg2, &msgs, 2878 + link) { 2878 2879 list_del(&recv_msg->link); 2879 2880 ipmi_free_recv_msg(recv_msg); 2880 2881 } ··· 2905 2904 /* No one to receive the message, put it in queue if there's 2906 2905 not already too many things in the queue. */ 2907 2906 recv_msg = ipmi_alloc_recv_msg(); 2908 - if (! recv_msg) { 2907 + if (!recv_msg) { 2909 2908 /* We couldn't allocate memory for the 2910 2909 message, so requeue it for handling 2911 2910 later. */ ··· 3190 3189 3191 3190 rcu_read_lock(); 3192 3191 list_for_each_entry_rcu(user, &intf->users, link) { 3193 - if (! user->handler->ipmi_watchdog_pretimeout) 3192 + if (!user->handler->ipmi_watchdog_pretimeout) 3194 3193 continue; 3195 3194 3196 3195 user->handler->ipmi_watchdog_pretimeout(user->handler_data); ··· 3278 3277 3279 3278 smi_msg = smi_from_recv_msg(intf, ent->recv_msg, slot, 3280 3279 ent->seqid); 3281 - if (! smi_msg) 3280 + if (!smi_msg) 3282 3281 return; 3283 3282 3284 3283 spin_unlock_irqrestore(&intf->seq_lock, *flags); ··· 3314 3313 3315 3314 /* See if any waiting messages need to be processed. */ 3316 3315 spin_lock_irqsave(&intf->waiting_msgs_lock, flags); 3317 - list_for_each_entry_safe(smi_msg, smi_msg2, &intf->waiting_msgs, link) { 3318 - if (! handle_new_recv_msg(intf, smi_msg)) { 3316 + list_for_each_entry_safe(smi_msg, smi_msg2, 3317 + &intf->waiting_msgs, link) { 3318 + if (!handle_new_recv_msg(intf, smi_msg)) { 3319 3319 list_del(&smi_msg->link); 3320 3320 ipmi_free_smi_msg(smi_msg); 3321 3321 } else {
+1 -1
drivers/char/ipmi/ipmi_poweroff.c
··· 346 346 { 347 347 const char ipmi_version_major = ipmi_version & 0xF; 348 348 const char ipmi_version_minor = (ipmi_version >> 4) & 0xF; 349 - const char mfr[3]=DELL_IANA_MFR_ID; 349 + const char mfr[3] = DELL_IANA_MFR_ID; 350 350 if (!memcmp(mfr, &mfg_id, sizeof(mfr)) && 351 351 ipmi_version_major <= 1 && 352 352 ipmi_version_minor < 5)
+1 -1
drivers/char/ipmi/ipmi_si_intf.c
··· 803 803 set_user_nice(current, 19); 804 804 while (!kthread_should_stop()) { 805 805 spin_lock_irqsave(&(smi_info->si_lock), flags); 806 - smi_result=smi_event_handler(smi_info, 0); 806 + smi_result = smi_event_handler(smi_info, 0); 807 807 spin_unlock_irqrestore(&(smi_info->si_lock), flags); 808 808 if (smi_result == SI_SM_CALL_WITHOUT_DELAY) { 809 809 /* do nothing */
+4 -4
drivers/char/ipmi/ipmi_watchdog.c
··· 589 589 1); 590 590 } 591 591 592 - static struct watchdog_info ident= 592 + static struct watchdog_info ident = 593 593 { 594 594 .options = 0, /* WDIOF_SETTIMEOUT, */ 595 595 .firmware_version = 1, ··· 790 790 791 791 static int ipmi_close(struct inode *ino, struct file *filep) 792 792 { 793 - if (iminor(ino)==WATCHDOG_MINOR) 794 - { 793 + if (iminor(ino) == WATCHDOG_MINOR) { 795 794 if (expect_close == 42) { 796 795 ipmi_watchdog_state = WDOG_TIMEOUT_NONE; 797 796 ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB); 798 797 } else { 799 - printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); 798 + printk(KERN_CRIT PFX 799 + "Unexpected close, not stopping watchdog!\n"); 800 800 ipmi_heartbeat(); 801 801 } 802 802 clear_bit(0, &ipmi_wdog_open);