aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-10-17 02:29:39 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:56 -0400
commitc98673fee235c158bef237a7851c742976d66284 (patch)
treec8464820311ed217471e1d77aa78d084092b2e2e /drivers/message/i2o
parent9c0ca6f9a0a0820da25b64259ea475751f1dd306 (diff)
I2O: Fix "defined but not used" build warnings
drivers/message/i2o/exec-osm.c:539: warning: `i2o_exec_lct_notify' defined but not used comes when CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=n, because its only callsite is #ifdef'ed as such. So let's #ifdef the function definition also. Also move the definition to before the callsite, to get rid of forward prototype. [akpm@linux-foundation.org: fix warnings] Signed-off-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/message/i2o')
-rw-r--r--drivers/message/i2o/exec-osm.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c
index 8c83ee3b0920..ce8f1a34ed21 100644
--- a/drivers/message/i2o/exec-osm.c
+++ b/drivers/message/i2o/exec-osm.c
@@ -41,8 +41,6 @@
41 41
42struct i2o_driver i2o_exec_driver; 42struct i2o_driver i2o_exec_driver;
43 43
44static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind);
45
46/* global wait list for POST WAIT */ 44/* global wait list for POST WAIT */
47static LIST_HEAD(i2o_exec_wait_list); 45static LIST_HEAD(i2o_exec_wait_list);
48 46
@@ -369,6 +367,53 @@ static int i2o_exec_remove(struct device *dev)
369 return 0; 367 return 0;
370}; 368};
371 369
370#ifdef CONFIG_I2O_LCT_NOTIFY_ON_CHANGES
371/**
372 * i2o_exec_lct_notify - Send a asynchronus LCT NOTIFY request
373 * @c: I2O controller to which the request should be send
374 * @change_ind: change indicator
375 *
376 * This function sends a LCT NOTIFY request to the I2O controller with
377 * the change indicator change_ind. If the change_ind == 0 the controller
378 * replies immediately after the request. If change_ind > 0 the reply is
379 * send after change indicator of the LCT is > change_ind.
380 */
381static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind)
382{
383 i2o_status_block *sb = c->status_block.virt;
384 struct device *dev;
385 struct i2o_message *msg;
386
387 mutex_lock(&c->lct_lock);
388
389 dev = &c->pdev->dev;
390
391 if (i2o_dma_realloc
392 (dev, &c->dlct, le32_to_cpu(sb->expected_lct_size), GFP_KERNEL))
393 return -ENOMEM;
394
395 msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET);
396 if (IS_ERR(msg))
397 return PTR_ERR(msg);
398
399 msg->u.head[0] = cpu_to_le32(EIGHT_WORD_MSG_SIZE | SGL_OFFSET_6);
400 msg->u.head[1] = cpu_to_le32(I2O_CMD_LCT_NOTIFY << 24 | HOST_TID << 12 |
401 ADAPTER_TID);
402 msg->u.s.icntxt = cpu_to_le32(i2o_exec_driver.context);
403 msg->u.s.tcntxt = cpu_to_le32(0x00000000);
404 msg->body[0] = cpu_to_le32(0xffffffff);
405 msg->body[1] = cpu_to_le32(change_ind);
406 msg->body[2] = cpu_to_le32(0xd0000000 | c->dlct.len);
407 msg->body[3] = cpu_to_le32(c->dlct.phys);
408
409 i2o_msg_post(c, msg);
410
411 mutex_unlock(&c->lct_lock);
412
413 return 0;
414}
415#endif
416
372/** 417/**
373 * i2o_exec_lct_modified - Called on LCT NOTIFY reply 418 * i2o_exec_lct_modified - Called on LCT NOTIFY reply
374 * @_work: work struct for a specific controller 419 * @_work: work struct for a specific controller
@@ -525,51 +570,6 @@ int i2o_exec_lct_get(struct i2o_controller *c)
525 return rc; 570 return rc;
526} 571}
527 572
528/**
529 * i2o_exec_lct_notify - Send a asynchronus LCT NOTIFY request
530 * @c: I2O controller to which the request should be send
531 * @change_ind: change indicator
532 *
533 * This function sends a LCT NOTIFY request to the I2O controller with
534 * the change indicator change_ind. If the change_ind == 0 the controller
535 * replies immediately after the request. If change_ind > 0 the reply is
536 * send after change indicator of the LCT is > change_ind.
537 */
538static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind)
539{
540 i2o_status_block *sb = c->status_block.virt;
541 struct device *dev;
542 struct i2o_message *msg;
543
544 mutex_lock(&c->lct_lock);
545
546 dev = &c->pdev->dev;
547
548 if (i2o_dma_realloc
549 (dev, &c->dlct, le32_to_cpu(sb->expected_lct_size), GFP_KERNEL))
550 return -ENOMEM;
551
552 msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET);
553 if (IS_ERR(msg))
554 return PTR_ERR(msg);
555
556 msg->u.head[0] = cpu_to_le32(EIGHT_WORD_MSG_SIZE | SGL_OFFSET_6);
557 msg->u.head[1] = cpu_to_le32(I2O_CMD_LCT_NOTIFY << 24 | HOST_TID << 12 |
558 ADAPTER_TID);
559 msg->u.s.icntxt = cpu_to_le32(i2o_exec_driver.context);
560 msg->u.s.tcntxt = cpu_to_le32(0x00000000);
561 msg->body[0] = cpu_to_le32(0xffffffff);
562 msg->body[1] = cpu_to_le32(change_ind);
563 msg->body[2] = cpu_to_le32(0xd0000000 | c->dlct.len);
564 msg->body[3] = cpu_to_le32(c->dlct.phys);
565
566 i2o_msg_post(c, msg);
567
568 mutex_unlock(&c->lct_lock);
569
570 return 0;
571};
572
573/* Exec OSM driver struct */ 573/* Exec OSM driver struct */
574struct i2o_driver i2o_exec_driver = { 574struct i2o_driver i2o_exec_driver = {
575 .name = OSM_NAME, 575 .name = OSM_NAME,