@@ -349,7 +349,7 @@ static void aem_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data)
349
349
static int aem_read_sensor (struct aem_data * data , u8 elt , u8 reg ,
350
350
void * buf , size_t size )
351
351
{
352
- int rs_size , res ;
352
+ int rs_size ;
353
353
struct aem_read_sensor_req rs_req ;
354
354
/* Use preallocated rx buffer */
355
355
struct aem_read_sensor_resp * rs_resp = data -> rs_resp ;
@@ -383,17 +383,12 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
383
383
384
384
aem_send_message (ipmi );
385
385
386
- res = wait_for_completion_timeout (& ipmi -> read_complete , IPMI_TIMEOUT );
387
- if (!res ) {
388
- res = - ETIMEDOUT ;
389
- goto out ;
390
- }
386
+ if (!wait_for_completion_timeout (& ipmi -> read_complete , IPMI_TIMEOUT ))
387
+ return - ETIMEDOUT ;
391
388
392
389
if (ipmi -> rx_result || ipmi -> rx_msg_len != rs_size ||
393
- memcmp (& rs_resp -> id , & system_x_id , sizeof (system_x_id ))) {
394
- res = - ENOENT ;
395
- goto out ;
396
- }
390
+ memcmp (& rs_resp -> id , & system_x_id , sizeof (system_x_id )))
391
+ return - ENOENT ;
397
392
398
393
switch (size ) {
399
394
case 1 : {
@@ -417,10 +412,8 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
417
412
break ;
418
413
}
419
414
}
420
- res = 0 ;
421
415
422
- out :
423
- return res ;
416
+ return 0 ;
424
417
}
425
418
426
419
/* Update AEM energy registers */
@@ -491,7 +484,6 @@ static void aem_delete(struct aem_data *data)
491
484
/* Retrieve version and module handle for an AEM1 instance */
492
485
static int aem_find_aem1_count (struct aem_ipmi_data * data )
493
486
{
494
- int res ;
495
487
struct aem_find_firmware_req ff_req ;
496
488
struct aem_find_firmware_resp ff_resp ;
497
489
@@ -508,8 +500,7 @@ static int aem_find_aem1_count(struct aem_ipmi_data *data)
508
500
509
501
aem_send_message (data );
510
502
511
- res = wait_for_completion_timeout (& data -> read_complete , IPMI_TIMEOUT );
512
- if (!res )
503
+ if (!wait_for_completion_timeout (& data -> read_complete , IPMI_TIMEOUT ))
513
504
return - ETIMEDOUT ;
514
505
515
506
if (data -> rx_result || data -> rx_msg_len != sizeof (ff_resp ) ||
@@ -632,7 +623,6 @@ static int aem_find_aem2(struct aem_ipmi_data *data,
632
623
struct aem_find_instance_resp * fi_resp ,
633
624
int instance_num )
634
625
{
635
- int res ;
636
626
struct aem_find_instance_req fi_req ;
637
627
638
628
fi_req .id = system_x_id ;
@@ -648,8 +638,7 @@ static int aem_find_aem2(struct aem_ipmi_data *data,
648
638
649
639
aem_send_message (data );
650
640
651
- res = wait_for_completion_timeout (& data -> read_complete , IPMI_TIMEOUT );
652
- if (!res )
641
+ if (!wait_for_completion_timeout (& data -> read_complete , IPMI_TIMEOUT ))
653
642
return - ETIMEDOUT ;
654
643
655
644
if (data -> rx_result || data -> rx_msg_len != sizeof (* fi_resp ) ||
0 commit comments