Commit e8b336173b86c5db5dd5ae5ad33f3f8605878d0d

Authored by Corey Minyard
Committed by Linus Torvalds
1 parent 168524d673

[PATCH] ipmi: style cleanups

Clean up various style issues in the IPMI driver.  Should be no functional
changes.

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

Showing 5 changed files with 146 additions and 128 deletions Side-by-side Diff

drivers/char/ipmi/ipmi_bt_sm.c
... ... @@ -161,7 +161,8 @@
161 161 {
162 162 unsigned int i;
163 163  
164   - if ((size < 2) || (size > IPMI_MAX_MSG_LENGTH)) return -1;
  164 + if ((size < 2) || (size > IPMI_MAX_MSG_LENGTH))
  165 + return -1;
165 166  
166 167 if ((bt->state != BT_STATE_IDLE) && (bt->state != BT_STATE_HOSED))
167 168 return -2;
... ... @@ -169,7 +170,8 @@
169 170 if (bt_debug & BT_DEBUG_MSG) {
170 171 printk(KERN_WARNING "+++++++++++++++++++++++++++++++++++++\n");
171 172 printk(KERN_WARNING "BT: write seq=0x%02X:", bt->seq);
172   - for (i = 0; i < size; i ++) printk (" %02x", data[i]);
  173 + for (i = 0; i < size; i ++)
  174 + printk (" %02x", data[i]);
173 175 printk("\n");
174 176 }
175 177 bt->write_data[0] = size + 1; /* all data plus seq byte */
176 178  
177 179  
... ... @@ -208,15 +210,18 @@
208 210 } else {
209 211 data[0] = bt->read_data[1];
210 212 data[1] = bt->read_data[3];
211   - if (length < msg_len) bt->truncated = 1;
  213 + if (length < msg_len)
  214 + bt->truncated = 1;
212 215 if (bt->truncated) { /* can be set in read_all_bytes() */
213 216 data[2] = IPMI_ERR_MSG_TRUNCATED;
214 217 msg_len = 3;
215   - } else memcpy(data + 2, bt->read_data + 4, msg_len - 2);
  218 + } else
  219 + memcpy(data + 2, bt->read_data + 4, msg_len - 2);
216 220  
217 221 if (bt_debug & BT_DEBUG_MSG) {
218 222 printk (KERN_WARNING "BT: res (raw)");
219   - for (i = 0; i < msg_len; i++) printk(" %02x", data[i]);
  223 + for (i = 0; i < msg_len; i++)
  224 + printk(" %02x", data[i]);
220 225 printk ("\n");
221 226 }
222 227 }
... ... @@ -229,8 +234,10 @@
229 234  
230 235 static void reset_flags(struct si_sm_data *bt)
231 236 {
232   - if (BT_STATUS & BT_H_BUSY) BT_CONTROL(BT_H_BUSY);
233   - if (BT_STATUS & BT_B_BUSY) BT_CONTROL(BT_B_BUSY);
  237 + if (BT_STATUS & BT_H_BUSY)
  238 + BT_CONTROL(BT_H_BUSY);
  239 + if (BT_STATUS & BT_B_BUSY)
  240 + BT_CONTROL(BT_B_BUSY);
234 241 BT_CONTROL(BT_CLR_WR_PTR);
235 242 BT_CONTROL(BT_SMS_ATN);
236 243 #ifdef DEVELOPMENT_ONLY_NOT_FOR_PRODUCTION
... ... @@ -239,7 +246,8 @@
239 246 BT_CONTROL(BT_H_BUSY);
240 247 BT_CONTROL(BT_B2H_ATN);
241 248 BT_CONTROL(BT_CLR_RD_PTR);
242   - for (i = 0; i < IPMI_MAX_MSG_LENGTH + 2; i++) BMC2HOST;
  249 + for (i = 0; i < IPMI_MAX_MSG_LENGTH + 2; i++)
  250 + BMC2HOST;
243 251 BT_CONTROL(BT_H_BUSY);
244 252 }
245 253 #endif
... ... @@ -256,7 +264,8 @@
256 264 printk (" %02x", bt->write_data[i]);
257 265 printk ("\n");
258 266 }
259   - for (i = 0; i < bt->write_count; i++) HOST2BMC(bt->write_data[i]);
  267 + for (i = 0; i < bt->write_count; i++)
  268 + HOST2BMC(bt->write_data[i]);
260 269 }
261 270  
262 271 static inline int read_all_bytes(struct si_sm_data *bt)
... ... @@ -276,7 +285,8 @@
276 285 bt->truncated = 1;
277 286 return 1; /* let next XACTION START clean it up */
278 287 }
279   - for (i = 1; i <= bt->read_count; i++) bt->read_data[i] = BMC2HOST;
  288 + for (i = 1; i <= bt->read_count; i++)
  289 + bt->read_data[i] = BMC2HOST;
280 290 bt->read_count++; /* account for the length byte */
281 291  
282 292 if (bt_debug & BT_DEBUG_MSG) {
... ... @@ -293,7 +303,8 @@
293 303 ((bt->read_data[1] & 0xF8) == (bt->write_data[1] & 0xF8)))
294 304 return 1;
295 305  
296   - if (bt_debug & BT_DEBUG_MSG) printk(KERN_WARNING "BT: bad packet: "
  306 + if (bt_debug & BT_DEBUG_MSG)
  307 + printk(KERN_WARNING "BT: bad packet: "
297 308 "want 0x(%02X, %02X, %02X) got (%02X, %02X, %02X)\n",
298 309 bt->write_data[1], bt->write_data[2], bt->write_data[3],
299 310 bt->read_data[1], bt->read_data[2], bt->read_data[3]);
... ... @@ -357,7 +368,8 @@
357 368 time);
358 369 bt->last_state = bt->state;
359 370  
360   - if (bt->state == BT_STATE_HOSED) return SI_SM_HOSED;
  371 + if (bt->state == BT_STATE_HOSED)
  372 + return SI_SM_HOSED;
361 373  
362 374 if (bt->state != BT_STATE_IDLE) { /* do timeout test */
363 375  
... ... @@ -369,7 +381,8 @@
369 381 /* FIXME: bt_event is sometimes called with time > BT_NORMAL_TIMEOUT
370 382 (noticed in ipmi_smic_sm.c January 2004) */
371 383  
372   - if ((time <= 0) || (time >= BT_NORMAL_TIMEOUT)) time = 100;
  384 + if ((time <= 0) || (time >= BT_NORMAL_TIMEOUT))
  385 + time = 100;
373 386 bt->timeout -= time;
374 387 if ((bt->timeout < 0) && (bt->state < BT_STATE_RESET1)) {
375 388 error_recovery(bt, "timed out");
376 389  
... ... @@ -391,12 +404,14 @@
391 404 BT_CONTROL(BT_H_BUSY);
392 405 break;
393 406 }
394   - if (status & BT_B2H_ATN) break;
  407 + if (status & BT_B2H_ATN)
  408 + break;
395 409 bt->state = BT_STATE_WRITE_BYTES;
396 410 return SI_SM_CALL_WITHOUT_DELAY; /* for logging */
397 411  
398 412 case BT_STATE_WRITE_BYTES:
399   - if (status & (BT_B_BUSY | BT_H2B_ATN)) break;
  413 + if (status & (BT_B_BUSY | BT_H2B_ATN))
  414 + break;
400 415 BT_CONTROL(BT_CLR_WR_PTR);
401 416 write_all_bytes(bt);
402 417 BT_CONTROL(BT_H2B_ATN); /* clears too fast to catch? */
... ... @@ -404,7 +419,8 @@
404 419 return SI_SM_CALL_WITHOUT_DELAY; /* it MIGHT sail through */
405 420  
406 421 case BT_STATE_WRITE_CONSUME: /* BMCs usually blow right thru here */
407   - if (status & (BT_H2B_ATN | BT_B_BUSY)) break;
  422 + if (status & (BT_H2B_ATN | BT_B_BUSY))
  423 + break;
408 424 bt->state = BT_STATE_B2H_WAIT;
409 425 /* fall through with status */
410 426  
411 427  
412 428  
... ... @@ -413,15 +429,18 @@
413 429 generation of B2H_ATN so ALWAYS return CALL_WITH_DELAY. */
414 430  
415 431 case BT_STATE_B2H_WAIT:
416   - if (!(status & BT_B2H_ATN)) break;
  432 + if (!(status & BT_B2H_ATN))
  433 + break;
417 434  
418 435 /* Assume ordered, uncached writes: no need to wait */
419   - if (!(status & BT_H_BUSY)) BT_CONTROL(BT_H_BUSY); /* set */
  436 + if (!(status & BT_H_BUSY))
  437 + BT_CONTROL(BT_H_BUSY); /* set */
420 438 BT_CONTROL(BT_B2H_ATN); /* clear it, ACK to the BMC */
421 439 BT_CONTROL(BT_CLR_RD_PTR); /* reset the queue */
422 440 i = read_all_bytes(bt);
423 441 BT_CONTROL(BT_H_BUSY); /* clear */
424   - if (!i) break; /* Try this state again */
  442 + if (!i) /* Try this state again */
  443 + break;
425 444 bt->state = BT_STATE_READ_END;
426 445 return SI_SM_CALL_WITHOUT_DELAY; /* for logging */
427 446  
... ... @@ -434,7 +453,8 @@
434 453  
435 454 #ifdef MAKE_THIS_TRUE_IF_NECESSARY
436 455  
437   - if (status & BT_H_BUSY) break;
  456 + if (status & BT_H_BUSY)
  457 + break;
438 458 #endif
439 459 bt->seq++;
440 460 bt->state = BT_STATE_IDLE;
... ... @@ -457,7 +477,8 @@
457 477 break;
458 478  
459 479 case BT_STATE_RESET3:
460   - if (bt->timeout > 0) return SI_SM_CALL_WITH_DELAY;
  480 + if (bt->timeout > 0)
  481 + return SI_SM_CALL_WITH_DELAY;
461 482 bt->state = BT_STATE_RESTART; /* printk in debug modes */
462 483 break;
463 484  
... ... @@ -483,7 +504,8 @@
483 504 but that's what you get from reading a bogus address, so we
484 505 test that first. The calling routine uses negative logic. */
485 506  
486   - if ((BT_STATUS == 0xFF) && (BT_INTMASK_R == 0xFF)) return 1;
  507 + if ((BT_STATUS == 0xFF) && (BT_INTMASK_R == 0xFF))
  508 + return 1;
487 509 reset_flags(bt);
488 510 return 0;
489 511 }
drivers/char/ipmi/ipmi_msghandler.c
... ... @@ -117,7 +117,7 @@
117 117 do { \
118 118 seq = ((msgid >> 26) & 0x3f); \
119 119 seqid = (msgid & 0x3fffff); \
120   - } while(0)
  120 + } while (0)
121 121  
122 122 #define NEXT_SEQID(seqid) (((seqid) + 1) & 0x3fffff)
123 123  
... ... @@ -326,7 +326,7 @@
326 326 down_read(&interfaces_sem);
327 327 down_write(&smi_watchers_sem);
328 328 list_add(&(watcher->link), &smi_watchers);
329   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  329 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
330 330 if (ipmi_interfaces[i] != NULL) {
331 331 watcher->new_smi(i);
332 332 }
333 333  
... ... @@ -496,9 +496,9 @@
496 496 int rv = 0;
497 497 unsigned int i;
498 498  
499   - for (i=intf->curr_seq;
  499 + for (i = intf->curr_seq;
500 500 (i+1)%IPMI_IPMB_NUM_SEQ != intf->curr_seq;
501   - i=(i+1)%IPMI_IPMB_NUM_SEQ)
  501 + i = (i+1)%IPMI_IPMB_NUM_SEQ)
502 502 {
503 503 if (! intf->seq_table[i].inuse)
504 504 break;
... ... @@ -733,7 +733,7 @@
733 733  
734 734 /* Remove the user from the interfaces sequence table. */
735 735 spin_lock_irqsave(&(user->intf->seq_lock), flags);
736   - for (i=0; i<IPMI_IPMB_NUM_SEQ; i++) {
  736 + for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) {
737 737 if (user->intf->seq_table[i].inuse
738 738 && (user->intf->seq_table[i].recv_msg->user == user))
739 739 {
... ... @@ -1370,7 +1370,7 @@
1370 1370 #ifdef DEBUG_MSGING
1371 1371 {
1372 1372 int m;
1373   - for (m=0; m<smi_msg->data_size; m++)
  1373 + for (m = 0; m < smi_msg->data_size; m++)
1374 1374 printk(" %2.2x", smi_msg->data[m]);
1375 1375 printk("\n");
1376 1376 }
... ... @@ -1467,7 +1467,7 @@
1467 1467 int i;
1468 1468 int rv= 0;
1469 1469  
1470   - for (i=0; i<IPMI_MAX_CHANNELS; i++)
  1470 + for (i = 0; i < IPMI_MAX_CHANNELS; i++)
1471 1471 rv += sprintf(out+rv, "%x ", intf->channels[i].address);
1472 1472 out[rv-1] = '\n'; /* Replace the final space with a newline */
1473 1473 out[rv] = '\0';
1474 1474  
... ... @@ -1766,12 +1766,12 @@
1766 1766 rv = -ENOMEM;
1767 1767  
1768 1768 down_write(&interfaces_sem);
1769   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  1769 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
1770 1770 if (ipmi_interfaces[i] == NULL) {
1771 1771 new_intf->intf_num = i;
1772 1772 new_intf->version_major = version_major;
1773 1773 new_intf->version_minor = version_minor;
1774   - for (j=0; j<IPMI_MAX_CHANNELS; j++) {
  1774 + for (j = 0; j < IPMI_MAX_CHANNELS; j++) {
1775 1775 new_intf->channels[j].address
1776 1776 = IPMI_BMC_SLAVE_ADDR;
1777 1777 new_intf->channels[j].lun = 2;
... ... @@ -1783,7 +1783,7 @@
1783 1783 new_intf->handlers = handlers;
1784 1784 new_intf->send_info = send_info;
1785 1785 spin_lock_init(&(new_intf->seq_lock));
1786   - for (j=0; j<IPMI_IPMB_NUM_SEQ; j++) {
  1786 + for (j = 0; j < IPMI_IPMB_NUM_SEQ; j++) {
1787 1787 new_intf->seq_table[j].inuse = 0;
1788 1788 new_intf->seq_table[j].seqid = 0;
1789 1789 }
... ... @@ -1891,7 +1891,7 @@
1891 1891 free_recv_msg_list(&(intf->waiting_events));
1892 1892 free_cmd_rcvr_list(&(intf->cmd_rcvrs));
1893 1893  
1894   - for (i=0; i<IPMI_IPMB_NUM_SEQ; i++) {
  1894 + for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) {
1895 1895 if ((intf->seq_table[i].inuse)
1896 1896 && (intf->seq_table[i].recv_msg))
1897 1897 {
... ... @@ -1910,7 +1910,7 @@
1910 1910 down_write(&interfaces_sem);
1911 1911 if (list_empty(&(intf->users)))
1912 1912 {
1913   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  1913 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
1914 1914 if (ipmi_interfaces[i] == intf) {
1915 1915 remove_proc_entries(intf);
1916 1916 spin_lock_irqsave(&interfaces_lock, flags);
... ... @@ -2074,7 +2074,7 @@
2074 2074 {
2075 2075 int m;
2076 2076 printk("Invalid command:");
2077   - for (m=0; m<msg->data_size; m++)
  2077 + for (m = 0; m < msg->data_size; m++)
2078 2078 printk(" %2.2x", msg->data[m]);
2079 2079 printk("\n");
2080 2080 }
... ... @@ -2469,7 +2469,7 @@
2469 2469 #ifdef DEBUG_MSGING
2470 2470 int m;
2471 2471 printk("Recv:");
2472   - for (m=0; m<msg->rsp_size; m++)
  2472 + for (m = 0; m < msg->rsp_size; m++)
2473 2473 printk(" %2.2x", msg->rsp[m]);
2474 2474 printk("\n");
2475 2475 #endif
... ... @@ -2703,7 +2703,7 @@
2703 2703 {
2704 2704 int m;
2705 2705 printk("Resend: ");
2706   - for (m=0; m<smi_msg->data_size; m++)
  2706 + for (m = 0; m < smi_msg->data_size; m++)
2707 2707 printk(" %2.2x", smi_msg->data[m]);
2708 2708 printk("\n");
2709 2709 }
... ... @@ -2724,7 +2724,7 @@
2724 2724 INIT_LIST_HEAD(&timeouts);
2725 2725  
2726 2726 spin_lock(&interfaces_lock);
2727   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  2727 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
2728 2728 intf = ipmi_interfaces[i];
2729 2729 if (intf == NULL)
2730 2730 continue;
... ... @@ -2749,7 +2749,7 @@
2749 2749 have timed out, putting them in the timeouts
2750 2750 list. */
2751 2751 spin_lock_irqsave(&(intf->seq_lock), flags);
2752   - for (j=0; j<IPMI_IPMB_NUM_SEQ; j++) {
  2752 + for (j = 0; j < IPMI_IPMB_NUM_SEQ; j++) {
2753 2753 struct seq_table *ent = &(intf->seq_table[j]);
2754 2754 if (!ent->inuse)
2755 2755 continue;
... ... @@ -2789,7 +2789,7 @@
2789 2789 spin_unlock(&intf->counter_lock);
2790 2790 smi_msg = smi_from_recv_msg(intf,
2791 2791 ent->recv_msg, j, ent->seqid);
2792   - if(!smi_msg)
  2792 + if (! smi_msg)
2793 2793 continue;
2794 2794  
2795 2795 spin_unlock_irqrestore(&(intf->seq_lock),flags);
... ... @@ -2820,7 +2820,7 @@
2820 2820 int i;
2821 2821  
2822 2822 spin_lock(&interfaces_lock);
2823   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  2823 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
2824 2824 intf = ipmi_interfaces[i];
2825 2825 if (intf == NULL)
2826 2826 continue;
... ... @@ -2982,7 +2982,7 @@
2982 2982 recv_msg.done = dummy_recv_done_handler;
2983 2983  
2984 2984 /* For every registered interface, send the event. */
2985   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  2985 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
2986 2986 intf = ipmi_interfaces[i];
2987 2987 if (intf == NULL)
2988 2988 continue;
... ... @@ -3009,7 +3009,7 @@
3009 3009 if (!str)
3010 3010 return;
3011 3011  
3012   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  3012 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
3013 3013 char *p = str;
3014 3014 struct ipmi_ipmb_addr *ipmb;
3015 3015 int j;
... ... @@ -3149,7 +3149,7 @@
3149 3149 has_paniced = 1;
3150 3150  
3151 3151 /* For every registered interface, set it to run to completion. */
3152   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  3152 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
3153 3153 intf = ipmi_interfaces[i];
3154 3154 if (intf == NULL)
3155 3155 continue;
... ... @@ -3180,7 +3180,7 @@
3180 3180 printk(KERN_INFO "ipmi message handler version "
3181 3181 IPMI_DRIVER_VERSION "\n");
3182 3182  
3183   - for (i=0; i<MAX_IPMI_INTERFACES; i++) {
  3183 + for (i = 0; i < MAX_IPMI_INTERFACES; i++) {
3184 3184 ipmi_interfaces[i] = NULL;
3185 3185 }
3186 3186  
drivers/char/ipmi/ipmi_poweroff.c
... ... @@ -525,7 +525,7 @@
525 525  
526 526  
527 527 /* Scan for a poweroff method */
528   - for (i=0; i<NUM_PO_FUNCS; i++) {
  528 + for (i = 0; i < NUM_PO_FUNCS; i++) {
529 529 if (poweroff_functions[i].detect(ipmi_user))
530 530 goto found;
531 531 }
drivers/char/ipmi/ipmi_si_intf.c
... ... @@ -267,7 +267,7 @@
267 267 entry = smi_info->xmit_msgs.next;
268 268 }
269 269  
270   - if (!entry) {
  270 + if (! entry) {
271 271 smi_info->curr_msg = NULL;
272 272 rv = SI_SM_IDLE;
273 273 } else {
... ... @@ -328,7 +328,7 @@
328 328 memory, we will re-enable the interrupt. */
329 329 static inline void disable_si_irq(struct smi_info *smi_info)
330 330 {
331   - if ((smi_info->irq) && (!smi_info->interrupt_disabled)) {
  331 + if ((smi_info->irq) && (! smi_info->interrupt_disabled)) {
332 332 disable_irq_nosync(smi_info->irq);
333 333 smi_info->interrupt_disabled = 1;
334 334 }
... ... @@ -359,7 +359,7 @@
359 359 } else if (smi_info->msg_flags & RECEIVE_MSG_AVAIL) {
360 360 /* Messages available. */
361 361 smi_info->curr_msg = ipmi_alloc_smi_msg();
362   - if (!smi_info->curr_msg) {
  362 + if (! smi_info->curr_msg) {
363 363 disable_si_irq(smi_info);
364 364 smi_info->si_state = SI_NORMAL;
365 365 return;
... ... @@ -378,7 +378,7 @@
378 378 } else if (smi_info->msg_flags & EVENT_MSG_BUFFER_FULL) {
379 379 /* Events available. */
380 380 smi_info->curr_msg = ipmi_alloc_smi_msg();
381   - if (!smi_info->curr_msg) {
  381 + if (! smi_info->curr_msg) {
382 382 disable_si_irq(smi_info);
383 383 smi_info->si_state = SI_NORMAL;
384 384 return;
... ... @@ -414,7 +414,7 @@
414 414 #endif
415 415 switch (smi_info->si_state) {
416 416 case SI_NORMAL:
417   - if (!smi_info->curr_msg)
  417 + if (! smi_info->curr_msg)
418 418 break;
419 419  
420 420 smi_info->curr_msg->rsp_size
... ... @@ -1047,7 +1047,7 @@
1047 1047 {
1048 1048 int rv;
1049 1049  
1050   - if (!info->irq)
  1050 + if (! info->irq)
1051 1051 return 0;
1052 1052  
1053 1053 if (info->si_type == SI_BT) {
... ... @@ -1056,7 +1056,7 @@
1056 1056 SA_INTERRUPT,
1057 1057 DEVICE_NAME,
1058 1058 info);
1059   - if (!rv)
  1059 + if (! rv)
1060 1060 /* Enable the interrupt in the BT interface. */
1061 1061 info->io.outputb(&info->io, IPMI_BT_INTMASK_REG,
1062 1062 IPMI_BT_INTMASK_ENABLE_IRQ_BIT);
... ... @@ -1081,7 +1081,7 @@
1081 1081  
1082 1082 static void std_irq_cleanup(struct smi_info *info)
1083 1083 {
1084   - if (!info->irq)
  1084 + if (! info->irq)
1085 1085 return;
1086 1086  
1087 1087 if (info->si_type == SI_BT)
... ... @@ -1154,7 +1154,7 @@
1154 1154 unsigned int *addr = info->io.info;
1155 1155 int mapsize;
1156 1156  
1157   - if (!addr || (!*addr))
  1157 + if (! addr || (! *addr))
1158 1158 return -ENODEV;
1159 1159  
1160 1160 info->io_cleanup = port_cleanup;
1161 1161  
1162 1162  
... ... @@ -1197,15 +1197,15 @@
1197 1197 {
1198 1198 struct smi_info *info;
1199 1199  
1200   - if (!ports[intf_num])
  1200 + if (! ports[intf_num])
1201 1201 return -ENODEV;
1202 1202  
1203   - if (!is_new_interface(intf_num, IPMI_IO_ADDR_SPACE,
  1203 + if (! is_new_interface(intf_num, IPMI_IO_ADDR_SPACE,
1204 1204 ports[intf_num]))
1205 1205 return -ENODEV;
1206 1206  
1207 1207 info = kmalloc(sizeof(*info), GFP_KERNEL);
1208   - if (!info) {
  1208 + if (! info) {
1209 1209 printk(KERN_ERR "ipmi_si: Could not allocate SI data (1)\n");
1210 1210 return -ENOMEM;
1211 1211 }
1212 1212  
... ... @@ -1215,10 +1215,10 @@
1215 1215 info->io.info = &(ports[intf_num]);
1216 1216 info->io.addr = NULL;
1217 1217 info->io.regspacing = regspacings[intf_num];
1218   - if (!info->io.regspacing)
  1218 + if (! info->io.regspacing)
1219 1219 info->io.regspacing = DEFAULT_REGSPACING;
1220 1220 info->io.regsize = regsizes[intf_num];
1221   - if (!info->io.regsize)
  1221 + if (! info->io.regsize)
1222 1222 info->io.regsize = DEFAULT_REGSPACING;
1223 1223 info->io.regshift = regshifts[intf_num];
1224 1224 info->irq = 0;
... ... @@ -1303,7 +1303,7 @@
1303 1303 unsigned long *addr = info->io.info;
1304 1304 int mapsize;
1305 1305  
1306   - if (!addr || (!*addr))
  1306 + if (! addr || (! *addr))
1307 1307 return -ENODEV;
1308 1308  
1309 1309 info->io_cleanup = mem_cleanup;
1310 1310  
1311 1311  
... ... @@ -1358,15 +1358,15 @@
1358 1358 {
1359 1359 struct smi_info *info;
1360 1360  
1361   - if (!addrs[intf_num])
  1361 + if (! addrs[intf_num])
1362 1362 return -ENODEV;
1363 1363  
1364   - if (!is_new_interface(intf_num, IPMI_MEM_ADDR_SPACE,
  1364 + if (! is_new_interface(intf_num, IPMI_MEM_ADDR_SPACE,
1365 1365 addrs[intf_num]))
1366 1366 return -ENODEV;
1367 1367  
1368 1368 info = kmalloc(sizeof(*info), GFP_KERNEL);
1369   - if (!info) {
  1369 + if (! info) {
1370 1370 printk(KERN_ERR "ipmi_si: Could not allocate SI data (2)\n");
1371 1371 return -ENOMEM;
1372 1372 }
1373 1373  
... ... @@ -1376,10 +1376,10 @@
1376 1376 info->io.info = &addrs[intf_num];
1377 1377 info->io.addr = NULL;
1378 1378 info->io.regspacing = regspacings[intf_num];
1379   - if (!info->io.regspacing)
  1379 + if (! info->io.regspacing)
1380 1380 info->io.regspacing = DEFAULT_REGSPACING;
1381 1381 info->io.regsize = regsizes[intf_num];
1382   - if (!info->io.regsize)
  1382 + if (! info->io.regsize)
1383 1383 info->io.regsize = DEFAULT_REGSPACING;
1384 1384 info->io.regshift = regshifts[intf_num];
1385 1385 info->irq = 0;
... ... @@ -1437,7 +1437,7 @@
1437 1437 {
1438 1438 acpi_status status;
1439 1439  
1440   - if (!info->irq)
  1440 + if (! info->irq)
1441 1441 return 0;
1442 1442  
1443 1443 /* FIXME - is level triggered right? */
... ... @@ -1461,7 +1461,7 @@
1461 1461  
1462 1462 static void acpi_gpe_irq_cleanup(struct smi_info *info)
1463 1463 {
1464   - if (!info->irq)
  1464 + if (! info->irq)
1465 1465 return;
1466 1466  
1467 1467 acpi_remove_gpe_handler(NULL, info->irq, &ipmi_acpi_gpe);
1468 1468  
... ... @@ -1537,10 +1537,10 @@
1537 1537 addr_space = IPMI_MEM_ADDR_SPACE;
1538 1538 else
1539 1539 addr_space = IPMI_IO_ADDR_SPACE;
1540   - if (!is_new_interface(-1, addr_space, spmi->addr.address))
  1540 + if (! is_new_interface(-1, addr_space, spmi->addr.address))
1541 1541 return -ENODEV;
1542 1542  
1543   - if (!spmi->addr.register_bit_width) {
  1543 + if (! spmi->addr.register_bit_width) {
1544 1544 acpi_failure = 1;
1545 1545 return -ENODEV;
1546 1546 }
... ... @@ -1567,7 +1567,7 @@
1567 1567 }
1568 1568  
1569 1569 info = kmalloc(sizeof(*info), GFP_KERNEL);
1570   - if (!info) {
  1570 + if (! info) {
1571 1571 printk(KERN_ERR "ipmi_si: Could not allocate SI data (3)\n");
1572 1572 return -ENOMEM;
1573 1573 }
... ... @@ -1645,7 +1645,7 @@
1645 1645  
1646 1646 static int __init decode_dmi(struct dmi_header *dm, int intf_num)
1647 1647 {
1648   - u8 *data = (u8 *)dm;
  1648 + u8 *data = (u8 *)dm;
1649 1649 unsigned long base_addr;
1650 1650 u8 reg_spacing;
1651 1651 u8 len = dm->length;
... ... @@ -1714,7 +1714,7 @@
1714 1714 static void __init dmi_find_bmc(void)
1715 1715 {
1716 1716 struct dmi_device *dev = NULL;
1717   - int intf_num = 0;
  1717 + int intf_num = 0;
1718 1718  
1719 1719 while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev))) {
1720 1720 if (intf_num >= SI_MAX_DRIVERS)
1721 1721  
... ... @@ -1726,14 +1726,14 @@
1726 1726  
1727 1727 static int try_init_smbios(int intf_num, struct smi_info **new_info)
1728 1728 {
1729   - struct smi_info *info;
1730   - dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
1731   - char *io_type;
  1729 + struct smi_info *info;
  1730 + dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
  1731 + char *io_type;
1732 1732  
1733 1733 if (intf_num >= dmi_data_entries)
1734 1734 return -ENODEV;
1735 1735  
1736   - switch(ipmi_data->type) {
  1736 + switch (ipmi_data->type) {
1737 1737 case 0x01: /* KCS */
1738 1738 si_type[intf_num] = "kcs";
1739 1739 break;
... ... @@ -1748,7 +1748,7 @@
1748 1748 }
1749 1749  
1750 1750 info = kmalloc(sizeof(*info), GFP_KERNEL);
1751   - if (!info) {
  1751 + if (! info) {
1752 1752 printk(KERN_ERR "ipmi_si: Could not allocate SI data (4)\n");
1753 1753 return -ENOMEM;
1754 1754 }
... ... @@ -1772,7 +1772,7 @@
1772 1772  
1773 1773 regspacings[intf_num] = ipmi_data->offset;
1774 1774 info->io.regspacing = regspacings[intf_num];
1775   - if (!info->io.regspacing)
  1775 + if (! info->io.regspacing)
1776 1776 info->io.regspacing = DEFAULT_REGSPACING;
1777 1777 info->io.regsize = DEFAULT_REGSPACING;
1778 1778 info->io.regshift = regshifts[intf_num];
... ... @@ -1814,14 +1814,14 @@
1814 1814  
1815 1815 pci_smic_checked = 1;
1816 1816  
1817   - if ((pci_dev = pci_get_device(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID,
1818   - NULL)))
1819   - ;
1820   - else if ((pci_dev = pci_get_class(PCI_ERMC_CLASSCODE, NULL)) &&
1821   - pci_dev->subsystem_vendor == PCI_HP_VENDOR_ID)
1822   - fe_rmc = 1;
1823   - else
1824   - return -ENODEV;
  1817 + pci_dev = pci_get_device(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID, NULL);
  1818 + if (! pci_dev) {
  1819 + pci_dev = pci_get_class(PCI_ERMC_CLASSCODE, NULL);
  1820 + if (pci_dev && (pci_dev->subsystem_vendor == PCI_HP_VENDOR_ID))
  1821 + fe_rmc = 1;
  1822 + else
  1823 + return -ENODEV;
  1824 + }
1825 1825  
1826 1826 error = pci_read_config_word(pci_dev, PCI_MMC_ADDR_CW, &base_addr);
1827 1827 if (error)
... ... @@ -1834,7 +1834,7 @@
1834 1834 }
1835 1835  
1836 1836 /* Bit 0: 1 specifies programmed I/O, 0 specifies memory mapped I/O */
1837   - if (!(base_addr & 0x0001))
  1837 + if (! (base_addr & 0x0001))
1838 1838 {
1839 1839 pci_dev_put(pci_dev);
1840 1840 printk(KERN_ERR
1841 1841  
1842 1842  
... ... @@ -1844,17 +1844,17 @@
1844 1844 }
1845 1845  
1846 1846 base_addr &= 0xFFFE;
1847   - if (!fe_rmc)
  1847 + if (! fe_rmc)
1848 1848 /* Data register starts at base address + 1 in eRMC */
1849 1849 ++base_addr;
1850 1850  
1851   - if (!is_new_interface(-1, IPMI_IO_ADDR_SPACE, base_addr)) {
  1851 + if (! is_new_interface(-1, IPMI_IO_ADDR_SPACE, base_addr)) {
1852 1852 pci_dev_put(pci_dev);
1853 1853 return -ENODEV;
1854 1854 }
1855 1855  
1856 1856 info = kmalloc(sizeof(*info), GFP_KERNEL);
1857   - if (!info) {
  1857 + if (! info) {
1858 1858 pci_dev_put(pci_dev);
1859 1859 printk(KERN_ERR "ipmi_si: Could not allocate SI data (5)\n");
1860 1860 return -ENOMEM;
... ... @@ -1865,7 +1865,7 @@
1865 1865 ports[intf_num] = base_addr;
1866 1866 info->io.info = &(ports[intf_num]);
1867 1867 info->io.regspacing = regspacings[intf_num];
1868   - if (!info->io.regspacing)
  1868 + if (! info->io.regspacing)
1869 1869 info->io.regspacing = DEFAULT_REGSPACING;
1870 1870 info->io.regsize = DEFAULT_REGSPACING;
1871 1871 info->io.regshift = regshifts[intf_num];
... ... @@ -1886,7 +1886,7 @@
1886 1886 static int try_init_plug_and_play(int intf_num, struct smi_info **new_info)
1887 1887 {
1888 1888 #ifdef CONFIG_PCI
1889   - if (find_pci_smic(intf_num, new_info)==0)
  1889 + if (find_pci_smic(intf_num, new_info) == 0)
1890 1890 return 0;
1891 1891 #endif
1892 1892 /* Include other methods here. */
... ... @@ -1904,7 +1904,7 @@
1904 1904 int rv = 0;
1905 1905  
1906 1906 resp = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
1907   - if (!resp)
  1907 + if (! resp)
1908 1908 return -ENOMEM;
1909 1909  
1910 1910 /* Do a Get Device ID command, since it comes back with some
... ... @@ -1986,7 +1986,7 @@
1986 1986 struct smi_info *smi = data;
1987 1987  
1988 1988 out += sprintf(out, "interrupts_enabled: %d\n",
1989   - smi->irq && !smi->interrupt_disabled);
  1989 + smi->irq && ! smi->interrupt_disabled);
1990 1990 out += sprintf(out, "short_timeouts: %ld\n",
1991 1991 smi->short_timeouts);
1992 1992 out += sprintf(out, "long_timeouts: %ld\n",
... ... @@ -2024,8 +2024,8 @@
2024 2024 */
2025 2025 static int oem_data_avail_to_receive_msg_avail(struct smi_info *smi_info)
2026 2026 {
2027   - smi_info->msg_flags = (smi_info->msg_flags & ~OEM_DATA_AVAIL) |
2028   - RECEIVE_MSG_AVAIL;
  2027 + smi_info->msg_flags = ((smi_info->msg_flags & ~OEM_DATA_AVAIL) |
  2028 + RECEIVE_MSG_AVAIL);
2029 2029 return 1;
2030 2030 }
2031 2031  
... ... @@ -2059,10 +2059,11 @@
2059 2059 {
2060 2060 struct ipmi_device_id *id = &smi_info->device_id;
2061 2061 const char mfr[3]=DELL_IANA_MFR_ID;
2062   - if (!memcmp(mfr, id->manufacturer_id, sizeof(mfr)) &&
2063   - id->device_id == DELL_POWEREDGE_8G_BMC_DEVICE_ID &&
2064   - id->device_revision == DELL_POWEREDGE_8G_BMC_DEVICE_REV &&
2065   - id->ipmi_version == DELL_POWEREDGE_8G_BMC_IPMI_VERSION) {
  2062 + if (! memcmp(mfr, id->manufacturer_id, sizeof(mfr))
  2063 + && (id->device_id == DELL_POWEREDGE_8G_BMC_DEVICE_ID)
  2064 + && (id->device_revision == DELL_POWEREDGE_8G_BMC_DEVICE_REV)
  2065 + && (id->ipmi_version == DELL_POWEREDGE_8G_BMC_IPMI_VERSION))
  2066 + {
2066 2067 smi_info->oem_data_avail_handler =
2067 2068 oem_data_avail_to_receive_msg_avail;
2068 2069 }
2069 2070  
2070 2071  
2071 2072  
2072 2073  
2073 2074  
2074 2075  
... ... @@ -2092,20 +2093,16 @@
2092 2093 if (rv)
2093 2094 rv = try_init_port(intf_num, &new_smi);
2094 2095 #ifdef CONFIG_ACPI_INTERPRETER
2095   - if ((rv) && (si_trydefaults)) {
  2096 + if (rv && si_trydefaults)
2096 2097 rv = try_init_acpi(intf_num, &new_smi);
2097   - }
2098 2098 #endif
2099 2099 #ifdef CONFIG_X86
2100   - if ((rv) && (si_trydefaults)) {
  2100 + if (rv && si_trydefaults)
2101 2101 rv = try_init_smbios(intf_num, &new_smi);
2102   - }
2103 2102 #endif
2104   - if ((rv) && (si_trydefaults)) {
  2103 + if (rv && si_trydefaults)
2105 2104 rv = try_init_plug_and_play(intf_num, &new_smi);
2106   - }
2107 2105  
2108   -
2109 2106 if (rv)
2110 2107 return rv;
2111 2108  
... ... @@ -2114,7 +2111,7 @@
2114 2111 new_smi->si_sm = NULL;
2115 2112 new_smi->handlers = NULL;
2116 2113  
2117   - if (!new_smi->irq_setup) {
  2114 + if (! new_smi->irq_setup) {
2118 2115 new_smi->irq = irqs[intf_num];
2119 2116 new_smi->irq_setup = std_irq_setup;
2120 2117 new_smi->irq_cleanup = std_irq_cleanup;
... ... @@ -2148,7 +2145,7 @@
2148 2145  
2149 2146 /* Allocate the state machine's data and initialize it. */
2150 2147 new_smi->si_sm = kmalloc(new_smi->handlers->size(), GFP_KERNEL);
2151   - if (!new_smi->si_sm) {
  2148 + if (! new_smi->si_sm) {
2152 2149 printk(" Could not allocate state machine memory\n");
2153 2150 rv = -ENOMEM;
2154 2151 goto out_err;
... ... @@ -2256,7 +2253,7 @@
2256 2253  
2257 2254 /* Wait for the timer to stop. This avoids problems with race
2258 2255 conditions removing the timer here. */
2259   - while (!new_smi->timer_stopped) {
  2256 + while (! new_smi->timer_stopped) {
2260 2257 set_current_state(TASK_UNINTERRUPTIBLE);
2261 2258 schedule_timeout(1);
2262 2259 }
... ... @@ -2296,7 +2293,7 @@
2296 2293 /* Parse out the si_type string into its components. */
2297 2294 str = si_type_str;
2298 2295 if (*str != '\0') {
2299   - for (i=0; (i<SI_MAX_PARMS) && (*str != 'SI_MAX_PARMS) && (*str != '\0'); i++) {'); i++) {
  2296 + for (i = 0; (i < SI_MAX_PARMS) && (*str != 'SI_MAX_PARMS) && (*str != '\0'); i++) {'); i++) {
2300 2297 si_type[i] = str;
2301 2298 str = strchr(str, ',');
2302 2299 if (str) {
... ... @@ -2315,7 +2312,7 @@
2315 2312 #endif
2316 2313  
2317 2314 rv = init_one_smi(0, &(smi_infos[pos]));
2318   - if (rv && !ports[0] && si_trydefaults) {
  2315 + if (rv && ! ports[0] && si_trydefaults) {
2319 2316 /* If we are trying defaults and the initial port is
2320 2317 not set, then set it. */
2321 2318 si_type[0] = "kcs";
... ... @@ -2337,7 +2334,7 @@
2337 2334 if (rv == 0)
2338 2335 pos++;
2339 2336  
2340   - for (i=1; i < SI_MAX_PARMS; i++) {
  2337 + for (i = 1; i < SI_MAX_PARMS; i++) {
2341 2338 rv = init_one_smi(i, &(smi_infos[pos]));
2342 2339 if (rv == 0)
2343 2340 pos++;
2344 2341  
... ... @@ -2379,14 +2376,14 @@
2379 2376  
2380 2377 /* Wait for the timer to stop. This avoids problems with race
2381 2378 conditions removing the timer here. */
2382   - while (!to_clean->timer_stopped) {
  2379 + while (! to_clean->timer_stopped) {
2383 2380 set_current_state(TASK_UNINTERRUPTIBLE);
2384 2381 schedule_timeout(1);
2385 2382 }
2386 2383  
2387 2384 /* Interrupts and timeouts are stopped, now make sure the
2388 2385 interface is in a clean state. */
2389   - while ((to_clean->curr_msg) || (to_clean->si_state != SI_NORMAL)) {
  2386 + while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) {
2390 2387 poll(to_clean);
2391 2388 set_current_state(TASK_UNINTERRUPTIBLE);
2392 2389 schedule_timeout(1);
2393 2390  
... ... @@ -2410,10 +2407,10 @@
2410 2407 {
2411 2408 int i;
2412 2409  
2413   - if (!initialized)
  2410 + if (! initialized)
2414 2411 return;
2415 2412  
2416   - for (i=0; i<SI_MAX_DRIVERS; i++) {
  2413 + for (i = 0; i < SI_MAX_DRIVERS; i++) {
2417 2414 cleanup_one_si(smi_infos[i]);
2418 2415 }
2419 2416 }
drivers/char/ipmi/ipmi_watchdog.c
... ... @@ -657,19 +657,18 @@
657 657  
658 658 static int ipmi_open(struct inode *ino, struct file *filep)
659 659 {
660   - switch (iminor(ino))
661   - {
662   - case WATCHDOG_MINOR:
663   - if(test_and_set_bit(0, &ipmi_wdog_open))
  660 + switch (iminor(ino)) {
  661 + case WATCHDOG_MINOR:
  662 + if (test_and_set_bit(0, &ipmi_wdog_open))
664 663 return -EBUSY;
665 664  
666   - /* Don't start the timer now, let it start on the
667   - first heartbeat. */
668   - ipmi_start_timer_on_heartbeat = 1;
669   - return nonseekable_open(ino, filep);
  665 + /* Don't start the timer now, let it start on the
  666 + first heartbeat. */
  667 + ipmi_start_timer_on_heartbeat = 1;
  668 + return nonseekable_open(ino, filep);
670 669  
671   - default:
672   - return (-ENODEV);
  670 + default:
  671 + return (-ENODEV);
673 672 }
674 673 }
675 674