LCOV - code coverage report
Current view: top level - avtg/drivers/hid/hid.ko/linux:drivers:clk2/weaver - hid-core.c.aux (source / functions) Hit Total Coverage
Test: coverage.info Lines: 265 275 96.4 %
Date: 2017-01-25 Functions: 42 43 97.7 %

          Line data    Source code
       1             : 
       2             : struct device;
       3             : 
       4             : void *ldv_dev_get_drvdata(const struct device *dev);
       5             : int ldv_dev_set_drvdata(struct device *dev, void *data);
       6             : 
       7             : struct spi_master;
       8             : struct device;
       9             : struct spi_master *ldv_spi_alloc_master(struct device *host, unsigned size);
      10             : 
      11             : #include <linux/ldv/err.h>
      12             : 
      13             : #include <linux/types.h>
      14             : void *ldv_kzalloc(size_t size, gfp_t flags);
      15             : 
      16             : struct clk;
      17             : 
      18             : extern void ldv_clk_disable(struct clk *clk);
      19             : extern int ldv_clk_enable(void);
      20             : 
      21             : #include <linux/ldv/common.h>
      22             : #include <linux/ldv/irq.h>
      23             : #include <verifier/common.h>
      24             : #include <verifier/nondet.h>
      25             : #include <verifier/memory.h>
      26             : #include <verifier/thread.h>
      27             : 
      28             : #include <linux/device.h>
      29             : #include <linux/platform_device.h>
      30             : #include <linux/pm.h>
      31             : 
      32             : 
      33             : struct ldv_struct_platform_instance_2 {
      34             :  int signal_pending;
      35             : };
      36             : 
      37             : /* EMG Function declarations */
      38             : void ldv_dispatch_default_deregister_2_5_4(void);
      39             : void ldv_dispatch_default_deregister_3_5_5(void);
      40             : void ldv_dispatch_default_deregister_4_5_6(void);
      41             : void ldv_dispatch_default_register_2_5_9(void);
      42             : void ldv_dispatch_default_register_3_5_8(void);
      43             : void ldv_dispatch_default_register_4_5_7(void);
      44             : void ldv_dispatch_insmod_deregister_6_2(void);
      45             : void ldv_dispatch_insmod_register_6_3(void);
      46             : void ldv_dispatch_pm_deregister_2_5(void);
      47             : void ldv_dispatch_pm_register_2_6(void);
      48             : void ldv_insmod_5(void *);
      49             : void ldv_insmod_hid_exit_5_2(void (*)(void));
      50             : int ldv_insmod_hid_init_5_13(int (*)(void));
      51             : void ldv_main_6(void *);
      52             : void ldv_platform_instance_2(void *);
      53             : int ldv_platform_instance_probe_2_15(int (*)(struct platform_device *), struct platform_device *);
      54             : void ldv_platform_instance_release_2_3(int (*)(struct platform_device *), struct platform_device *);
      55             : void ldv_pm_ops_scenario_1(void *);
      56             : void ldv_pm_ops_scenario_complete_1_3(void (*)(struct device *), struct device *);
      57             : void ldv_pm_ops_scenario_freeze_1_13(int (*)(struct device *), struct device *);
      58             : void ldv_pm_ops_scenario_freeze_noirq_1_11(int (*)(struct device *), struct device *);
      59             : void ldv_pm_ops_scenario_poweroff_1_8(int (*)(struct device *), struct device *);
      60             : void ldv_pm_ops_scenario_poweroff_noirq_1_7(int (*)(struct device *), struct device *);
      61             : void ldv_pm_ops_scenario_prepare_1_19(int (*)(struct device *), struct device *);
      62             : void ldv_pm_ops_scenario_restore_1_4(int (*)(struct device *), struct device *);
      63             : void ldv_pm_ops_scenario_restore_noirq_1_6(int (*)(struct device *), struct device *);
      64             : void ldv_pm_ops_scenario_resume_1_14(int (*)(struct device *), struct device *);
      65             : void ldv_pm_ops_scenario_resume_noirq_1_16(int (*)(struct device *), struct device *);
      66             : void ldv_pm_ops_scenario_runtime_idle_1_24(int (*)(struct device *), struct device *);
      67             : void ldv_pm_ops_scenario_runtime_resume_1_21(int (*)(struct device *), struct device *);
      68             : void ldv_pm_ops_scenario_runtime_suspend_1_22(int (*)(struct device *), struct device *);
      69             : void ldv_pm_ops_scenario_suspend_1_18(int (*)(struct device *), struct device *);
      70             : void ldv_pm_ops_scenario_suspend_noirq_1_17(int (*)(struct device *), struct device *);
      71             : void ldv_pm_ops_scenario_thaw_1_9(int (*)(struct device *), struct device *);
      72             : void ldv_pm_ops_scenario_thaw_noirq_1_10(int (*)(struct device *), struct device *);
      73             : void ldv_random_containerless_scenario_3(void *);
      74             : void ldv_random_containerless_scenario_4(void *);
      75             : void ldv_random_containerless_scenario_callback_3_4(ssize_t (*)(struct device_driver *, char *, size_t ), struct device_driver *, char *, long unsigned int);
      76             : void ldv_random_containerless_scenario_callback_4_10(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
      77             : void ldv_random_containerless_scenario_callback_4_4(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
      78             : int main(void);
      79             : 
      80             : /* EMG variable declarations */
      81           1 : struct ldv_thread ldv_thread_1;
      82           1 : struct ldv_thread ldv_thread_2;
      83           1 : struct ldv_thread ldv_thread_3;
      84           1 : struct ldv_thread ldv_thread_4;
      85           1 : struct ldv_thread ldv_thread_5;
      86           1 : struct ldv_thread ldv_thread_6;
      87             : 
      88             : /* EMG variable initialization */
      89             : 
      90             : /* EMG function definitions */
      91             : /* AUX_FUNC ldv_dispatch_default_deregister_2_5_4 */
      92             : void ldv_dispatch_default_deregister_2_5_4() {
      93             :  struct ldv_struct_platform_instance_2 *cf_arg_2;
      94             :  /* Skip thread join call */
      95           1 :  return;
      96             : }
      97             : 
      98             : /* AUX_FUNC ldv_dispatch_default_deregister_3_5_5 */
      99             : void ldv_dispatch_default_deregister_3_5_5() {
     100             :  struct ldv_struct_platform_instance_2 *cf_arg_3;
     101             :  /* Skip thread join call */
     102           1 :  return;
     103             : }
     104             : 
     105             : /* AUX_FUNC ldv_dispatch_default_deregister_4_5_6 */
     106             : void ldv_dispatch_default_deregister_4_5_6() {
     107             :  struct ldv_struct_platform_instance_2 *cf_arg_4;
     108             :  /* Skip thread join call */
     109           1 :  return;
     110             : }
     111             : 
     112             : /* AUX_FUNC ldv_dispatch_default_register_2_5_9 */
     113             : void ldv_dispatch_default_register_2_5_9() {
     114             :  struct ldv_struct_platform_instance_2 *cf_arg_2;
     115           4 :  cf_arg_2 = ldv_xmalloc(sizeof(struct ldv_struct_platform_instance_2));
     116           3 :  ldv_platform_instance_2(cf_arg_2);
     117           1 :  return;
     118             : }
     119             : 
     120             : /* AUX_FUNC ldv_dispatch_default_register_3_5_8 */
     121             : void ldv_dispatch_default_register_3_5_8() {
     122             :  struct ldv_struct_platform_instance_2 *cf_arg_3;
     123           4 :  cf_arg_3 = ldv_xmalloc(sizeof(struct ldv_struct_platform_instance_2));
     124           3 :  ldv_random_containerless_scenario_3(cf_arg_3);
     125           1 :  return;
     126             : }
     127             : 
     128             : /* AUX_FUNC ldv_dispatch_default_register_4_5_7 */
     129             : void ldv_dispatch_default_register_4_5_7() {
     130             :  struct ldv_struct_platform_instance_2 *cf_arg_4;
     131           4 :  cf_arg_4 = ldv_xmalloc(sizeof(struct ldv_struct_platform_instance_2));
     132           3 :  ldv_random_containerless_scenario_4(cf_arg_4);
     133           1 :  return;
     134             : }
     135             : 
     136             : /* AUX_FUNC ldv_dispatch_insmod_deregister_6_2 */
     137             : void ldv_dispatch_insmod_deregister_6_2() {
     138             :  struct ldv_struct_platform_instance_2 *cf_arg_5;
     139             :  /* Skip thread join call */
     140           1 :  return;
     141             : }
     142             : 
     143             : /* AUX_FUNC ldv_dispatch_insmod_register_6_3 */
     144             : void ldv_dispatch_insmod_register_6_3() {
     145             :  struct ldv_struct_platform_instance_2 *cf_arg_5;
     146           4 :  cf_arg_5 = ldv_xmalloc(sizeof(struct ldv_struct_platform_instance_2));
     147           4 :  ldv_insmod_5(cf_arg_5);
     148           1 :  return;
     149             : }
     150             : 
     151             : /* AUX_FUNC ldv_dispatch_pm_deregister_2_5 */
     152             : void ldv_dispatch_pm_deregister_2_5() {
     153             :  struct ldv_struct_platform_instance_2 *cf_arg_1;
     154             :  /* Skip thread join call */
     155           1 :  return;
     156             : }
     157             : 
     158             : /* AUX_FUNC ldv_dispatch_pm_register_2_6 */
     159             : void ldv_dispatch_pm_register_2_6() {
     160             :  struct ldv_struct_platform_instance_2 *cf_arg_1;
     161           4 :  cf_arg_1 = ldv_xmalloc(sizeof(struct ldv_struct_platform_instance_2));
     162           3 :  ldv_pm_ops_scenario_1(cf_arg_1);
     163           1 :  return;
     164             : }
     165             : 
     166             : /* AUX_FUNC ldv_insmod_5 */
     167             : void ldv_insmod_5(void *arg0) {
     168             :  /* LDV {"thread": 5, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'insmod(artificial)'", "function": "ldv_insmod_5"} */
     169           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
     170           1 :  void (*ldv_5_hid_exit_default)(void);
     171           1 :  int (*ldv_5_hid_init_default)(void);
     172           1 :  int ldv_5_ret_default;
     173           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     174             :  /* LDV {"action": "INSMOD_REGISTER", "type": "RECEIVE_BEGIN", "comment": "Trigger module initialization."} */
     175           2 :  ldv_free(arg0);
     176             :  /* LDV {"action": "INSMOD_REGISTER", "type": "RECEIVE_END"} */
     177             : 
     178             :  /* LDV {"action": "HID_INIT", "type": "CALL_BEGIN", "callback": true, "comment": "Initialize the module after insmod with 'hid_init' function. Invoke callback hid_init from ARTIFICIAL."} */
     179             :  /* LDV {"type": "CALLBACK", "call": "ldv_5_ret_default = (hid_init)();", "comment": "hid_init"} */
     180           2 :  ldv_5_ret_default = ldv_insmod_hid_init_5_13(ldv_5_hid_init_default);
     181             :  /* Callback post-call */
     182           2 :  ldv_5_ret_default = ldv_post_init(ldv_5_ret_default);
     183             :  /* LDV {"action": "HID_INIT", "type": "CALL_END"} */
     184             : 
     185           4 :  if (ldv_undef_int()) {
     186             :   /* LDV {"action": "INIT_FAILED", "type": "CONDITION_BEGIN", "comment": "Failed to initialize the module."} */
     187           2 :   ldv_assume(ldv_5_ret_default != 0);
     188             :   /* LDV {"action": "INIT_FAILED", "type": "CONDITION_END"} */
     189             : 
     190             :   /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Trigger module exit."} */
     191             :   /* Skip a non-replicative signal receiving */
     192             :   /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_END"} */
     193             : 
     194             :   /* Exit function at a terminal state */
     195           1 :   return;
     196             :  }
     197             :  else {
     198             :   /* LDV {"action": "INIT_SUCCESS", "type": "CONDITION_BEGIN", "comment": "Module has been initialized."} */
     199           2 :   ldv_assume(ldv_5_ret_default == 0);
     200             :   /* LDV {"action": "INIT_SUCCESS", "type": "CONDITION_END"} */
     201             : 
     202           4 :   if (ldv_undef_int()) {
     203             :    /* LDV {"action": "DEFAULT_REGISTER_2", "type": "DISPATCH_BEGIN", "comment": "Register 'PM' callbacks with unknown registration function."} */
     204           2 :    ldv_dispatch_default_register_2_5_9();
     205             :    /* LDV {"action": "DEFAULT_REGISTER_2", "type": "DISPATCH_END"} */
     206             : 
     207             :    /* LDV {"action": "DEFAULT_REGISTER_3", "type": "DISPATCH_BEGIN", "comment": "Register 'STRUCT_DRIVER_ATTRIBUTE' callbacks with unknown registration function."} */
     208           2 :    ldv_dispatch_default_register_3_5_8();
     209             :    /* LDV {"action": "DEFAULT_REGISTER_3", "type": "DISPATCH_END"} */
     210             : 
     211             :    /* LDV {"action": "DEFAULT_REGISTER_4", "type": "DISPATCH_BEGIN", "comment": "Register 'STRUCT_KERNEL_PARAM' callbacks with unknown registration function."} */
     212           2 :    ldv_dispatch_default_register_4_5_7();
     213             :    /* LDV {"action": "DEFAULT_REGISTER_4", "type": "DISPATCH_END"} */
     214             : 
     215             :    /* LDV {"action": "DEFAULT_DEREGISTER_4", "type": "DISPATCH_BEGIN", "comment": "Deregister 'STRUCT_KERNEL_PARAM' callbacks with unknown deregistration function."} */
     216           2 :    ldv_dispatch_default_deregister_4_5_6();
     217             :    /* LDV {"action": "DEFAULT_DEREGISTER_4", "type": "DISPATCH_END"} */
     218             : 
     219             :    /* LDV {"action": "DEFAULT_DEREGISTER_3", "type": "DISPATCH_BEGIN", "comment": "Deregister 'STRUCT_DRIVER_ATTRIBUTE' callbacks with unknown deregistration function."} */
     220           2 :    ldv_dispatch_default_deregister_3_5_5();
     221             :    /* LDV {"action": "DEFAULT_DEREGISTER_3", "type": "DISPATCH_END"} */
     222             : 
     223             :    /* LDV {"action": "DEFAULT_DEREGISTER_2", "type": "DISPATCH_BEGIN", "comment": "Deregister 'PM' callbacks with unknown deregistration function."} */
     224           2 :    ldv_dispatch_default_deregister_2_5_4();
     225             :    /* LDV {"action": "DEFAULT_DEREGISTER_2", "type": "DISPATCH_END"} */
     226             : 
     227             :   }
     228             :   else {
     229             :    /* LDV {"action": "NONE", "type": "CONDITION_BEGIN", "comment": "Skip default callbacks registrations and deregistrations."} */
     230             :    /* LDV {"action": "NONE", "type": "CONDITION_END"} */
     231             : 
     232             :   }
     233             :   /* LDV {"action": "HID_EXIT", "type": "CALL_BEGIN", "callback": true, "comment": "Exit the module before its unloading with 'hid_exit' function. Invoke callback hid_exit from ARTIFICIAL."} */
     234             :   /* LDV {"type": "CALLBACK", "call": "(hid_exit)();", "comment": "hid_exit"} */
     235           4 :   ldv_insmod_hid_exit_5_2(ldv_5_hid_exit_default);
     236             :   /* LDV {"action": "HID_EXIT", "type": "CALL_END"} */
     237             : 
     238             :   /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Trigger module exit."} */
     239             :   /* Skip a non-replicative signal receiving */
     240             :   /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_END"} */
     241             : 
     242             :   /* Exit function at a terminal state */
     243           1 :   return;
     244             :  }
     245             :  /* End of the process */
     246             :  return;
     247             :  /* LDV {"comment": "End of control function based on process 'insmod(artificial)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_insmod_5"} */
     248             : }
     249             : 
     250             : /* AUX_FUNC_CALLBACK ldv_insmod_hid_exit_5_2 */
     251             : void ldv_insmod_hid_exit_5_2(void (*arg0)(void)) {
     252           4 :  (hid_exit)();
     253           2 : }
     254             : 
     255             : /* AUX_FUNC_CALLBACK ldv_insmod_hid_init_5_13 */
     256             : int ldv_insmod_hid_init_5_13(int (*arg0)(void)) {
     257           4 :  return (hid_init)();
     258           1 : }
     259             : 
     260             : /* AUX_FUNC ldv_main_6 */
     261             : void ldv_main_6(void *arg0) {
     262             :  /* LDV {"thread": 6, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'main(main)'", "function": "ldv_main_6"} */
     263             :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
     264             :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     265             :  /* LDV {"action": "INIT", "type": "CONDITION_BEGIN", "comment": "Initialize rule models."} */
     266           1 :  ldv_initialize();
     267             :  /* LDV {"action": "INIT", "type": "CONDITION_END"} */
     268             : 
     269             :  /* LDV {"action": "INSMOD_REGISTER", "type": "DISPATCH_BEGIN", "comment": "Start environment model scenarios."} */
     270           2 :  ldv_dispatch_insmod_register_6_3();
     271             :  /* LDV {"action": "INSMOD_REGISTER", "type": "DISPATCH_END"} */
     272             : 
     273             :  /* LDV {"action": "INSMOD_DEREGISTER", "type": "DISPATCH_BEGIN", "comment": "Stop environment model scenarios."} */
     274           2 :  ldv_dispatch_insmod_deregister_6_2();
     275             :  /* LDV {"action": "INSMOD_DEREGISTER", "type": "DISPATCH_END"} */
     276             : 
     277             :  /* LDV {"action": "FINAL", "type": "CONDITION_BEGIN", "comment": "Check rule model state at the exit."} */
     278           1 :  ldv_check_final_state();
     279           1 :  ldv_stop();
     280             :  /* LDV {"action": "FINAL", "type": "CONDITION_END"} */
     281             : 
     282             :  /* Exit function at a terminal state */
     283           0 :  return;
     284             :  /* End of the process */
     285             :  return;
     286             :  /* LDV {"comment": "End of control function based on process 'main(main)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_main_6"} */
     287             : }
     288             : 
     289             : /* AUX_FUNC ldv_platform_instance_2 */
     290             : void ldv_platform_instance_2(void *arg0) {
     291             :  /* LDV {"thread": 2, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'platform_instance(pm)'", "function": "ldv_platform_instance_2"} */
     292           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
     293           1 :  struct platform_driver *ldv_2_container_platform_driver;
     294           1 :  struct platform_device *ldv_2_ldv_param_15_0_default;
     295           1 :  struct platform_device *ldv_2_ldv_param_3_0_default;
     296           1 :  int ldv_2_probed_default;
     297           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     298           1 :  /* Initialize automaton variables */
     299           2 :  ldv_2_probed_default = 1;
     300           1 :  /* LDV {"action": "DEFAULT_REGISTER_2", "type": "RECEIVE_BEGIN", "comment": "Register a driver callbacks for platform-level device."} */
     301           3 :  ldv_free(arg0);
     302             :  /* LDV {"action": "DEFAULT_REGISTER_2", "type": "RECEIVE_END"} */
     303             : 
     304             :  /* LDV {"action": "DEFAULT_ALLOC_2", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
     305           3 :  ldv_2_container_platform_driver = ldv_xmalloc_unknown_size(0);
     306             :  /* LDV {"action": "DEFAULT_ALLOC_2", "type": "CONDITION_END"} */
     307             : 
     308             :  /* LDV {"action": "INIT", "type": "CONDITION_BEGIN", "comment": "Alloc memory for 'platform_device' structure."} */
     309             :  /* LDV {"action": "INIT", "type": "CONDITION_END"} */
     310             : 
     311             :  /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Check that device is truely in the system and begin callback invocations."} */
     312             :  /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
     313             : 
     314             :  /* Jump to a subprocess 'main' initial state */
     315           1 :  goto ldv_main_2;
     316             :  /* End of the process */
     317             :  return;
     318           1 : 
     319             :  /* Sbprocess main */
     320             :  ldv_main_2:
     321             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     322             : 
     323           4 :  if (ldv_undef_int()) {
     324             :   /* LDV {"action": "PRE_CALL_15", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     325           3 :   ldv_2_ldv_param_15_0_default = ldv_xmalloc_unknown_size(0);
     326             :   /* LDV {"action": "PRE_CALL_15", "type": "CONDITION_END"} */
     327             : 
     328             :   /* LDV {"action": "PROBE", "type": "CALL_BEGIN", "callback": true, "comment": "Check that the device in the system and do driver initializations. Invoke callback probe from PM."} */
     329             :   /* Callback pre-call */
     330           1 :   ldv_pre_probe();
     331           3 :   if (ldv_2_container_platform_driver->probe) {
     332             :   /* LDV {"type": "CALLBACK", "call": "ldv_2_probed_default = (ldv_2_container_platform_driver->probe)(ldv_2_ldv_param_15_0_default);", "comment": "probe"} */
     333           2 :    ldv_2_probed_default = ldv_platform_instance_probe_2_15(ldv_2_container_platform_driver->probe, ldv_2_ldv_param_15_0_default);
     334             :   }
     335             :   /* Callback post-call */
     336           4 :   ldv_2_probed_default = ldv_post_probe(ldv_2_probed_default);
     337             :   /* LDV {"action": "PROBE", "type": "CALL_END"} */
     338             : 
     339             :   /* LDV {"action": "POST_CALL_15", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     340           2 :   ldv_free(ldv_2_ldv_param_15_0_default);
     341             :   /* LDV {"action": "POST_CALL_15", "type": "CONDITION_END"} */
     342             : 
     343           4 :   if (ldv_undef_int()) {
     344             :    /* LDV {"action": "POSITIVE_PROBE", "type": "CONDITION_BEGIN", "comment": "Platform device is probed successfully now."} */
     345           2 :    ldv_assume(ldv_2_probed_default == 0);
     346             :    /* LDV {"action": "POSITIVE_PROBE", "type": "CONDITION_END"} */
     347             : 
     348             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Driver is probed. Call power management callbacks or release the device."} */
     349             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     350             : 
     351             :    /* Jump to a subprocess 'call' initial state */
     352           1 :    goto ldv_call_2;
     353             :   }
     354             :   else {
     355             :    /* LDV {"action": "NEGATIVE_PROBE", "type": "CONDITION_BEGIN", "comment": "Failed to probe the device."} */
     356           2 :    ldv_assume(ldv_2_probed_default != 0);
     357             :    /* LDV {"action": "NEGATIVE_PROBE", "type": "CONDITION_END"} */
     358             : 
     359             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Check that device is truely in the system and begin callback invocations."} */
     360             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
     361             : 
     362             :    /* Jump to a subprocess 'main' initial state */
     363           1 :    goto ldv_main_2;
     364             :   }
     365             :  }
     366             :  else {
     367             :   /* LDV {"action": "FREE", "type": "CONDITION_BEGIN", "comment": "Free memory for 'platform_device' structure."} */
     368             :   /* LDV {"action": "FREE", "type": "CONDITION_END"} */
     369             : 
     370             :   /* LDV {"action": "DEFAULT_FREE_2", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
     371           2 :   ldv_free(ldv_2_container_platform_driver);
     372             :   /* LDV {"action": "DEFAULT_FREE_2", "type": "CONDITION_END"} */
     373             : 
     374             :   /* LDV {"action": "DEFAULT_DEREGISTER_2", "type": "RECEIVE_BEGIN", "comment": "Finish PM callbacks invocations scenario."} */
     375             :   /* Skip a non-replicative signal receiving */
     376             :   /* LDV {"action": "DEFAULT_DEREGISTER_2", "type": "RECEIVE_END"} */
     377             : 
     378             :   /* Exit function at a terminal state */
     379           1 :   return;
     380             :  }
     381             :  /* End of the subprocess 'main' */
     382             :  return;
     383           1 : 
     384             :  /* Sbprocess call */
     385             :  ldv_call_2:
     386             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     387             : 
     388           2 :  switch (ldv_undef_int()) {
     389           3 :   case 1: {
     390             :    /* LDV {"action": "PRE_CALL_3", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     391           3 :    ldv_2_ldv_param_3_0_default = ldv_xmalloc_unknown_size(0);
     392             :    /* LDV {"action": "PRE_CALL_3", "type": "CONDITION_END"} */
     393             : 
     394             :    /* LDV {"action": "RELEASE", "type": "CALL_BEGIN", "callback": true, "comment": "Remove device from the system. Invoke callback release from PM."} */
     395           3 :    if (ldv_2_container_platform_driver->remove) {
     396             :    /* LDV {"type": "CALLBACK", "call": "(ldv_2_container_platform_driver->remove)(ldv_2_ldv_param_3_0_default);", "comment": "release"} */
     397           2 :     ldv_platform_instance_release_2_3(ldv_2_container_platform_driver->remove, ldv_2_ldv_param_3_0_default);
     398             :    }
     399             :    /* LDV {"action": "RELEASE", "type": "CALL_END"} */
     400             : 
     401             :    /* LDV {"action": "POST_CALL_3", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     402           4 :    ldv_free(ldv_2_ldv_param_3_0_default);
     403             :    /* LDV {"action": "POST_CALL_3", "type": "CONDITION_END"} */
     404             : 
     405             :    /* LDV {"action": "AFTER_RELEASE", "type": "CONDITION_BEGIN", "comment": "Platform device is released now."} */
     406           1 :    ldv_2_probed_default = 1;
     407             :    /* LDV {"action": "AFTER_RELEASE", "type": "CONDITION_END"} */
     408             : 
     409             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Check that device is truely in the system and begin callback invocations."} */
     410             :    /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
     411             : 
     412             :    /* Jump to a subprocess 'main' initial state */
     413           1 :    goto ldv_main_2;
     414           1 :    break;
     415             :   }
     416           3 :   case 2: {
     417             :    /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "comment": "Call callback 'callback' of a process 'platform_instance' of an interface category 'pm'"} */
     418             :    /* Skip callback without implementations */
     419             :    /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     420             : 
     421             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Driver is probed. Call power management callbacks or release the device."} */
     422             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     423             : 
     424             :    /* Jump to a subprocess 'call' initial state */
     425           1 :    goto ldv_call_2;
     426           1 :    break;
     427             :   }
     428           3 :   case 3: {
     429             :    /* LDV {"action": "PM_REGISTER", "type": "DISPATCH_BEGIN", "comment": "Proceed to a power management scenario."} */
     430           2 :    ldv_dispatch_pm_register_2_6();
     431             :    /* LDV {"action": "PM_REGISTER", "type": "DISPATCH_END"} */
     432             : 
     433             :    /* LDV {"action": "PM_DEREGISTER", "type": "DISPATCH_BEGIN", "comment": "Finish the power management scenario."} */
     434           2 :    ldv_dispatch_pm_deregister_2_5();
     435             :    /* LDV {"action": "PM_DEREGISTER", "type": "DISPATCH_END"} */
     436             : 
     437             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Driver is probed. Call power management callbacks or release the device."} */
     438             :    /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     439             : 
     440             :    /* Jump to a subprocess 'call' initial state */
     441           1 :    goto ldv_call_2;
     442             :    /* Jump to a subprocess 'call' initial state */
     443             :    goto ldv_call_2;
     444           1 :    break;
     445             :   }
     446           2 :   default: ldv_stop();
     447           1 :  }
     448           0 :  /* End of the subprocess 'call' */
     449           0 :  return;
     450             :  /* LDV {"comment": "End of control function based on process 'platform_instance(pm)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_platform_instance_2"} */
     451             : }
     452             : 
     453             : /* AUX_FUNC_CALLBACK ldv_platform_instance_probe_2_15 */
     454             : int ldv_platform_instance_probe_2_15(int (*arg0)(struct platform_device *), struct platform_device *arg1) {
     455           2 :  return (*arg0)(arg1);
     456           1 : }
     457             : 
     458             : /* AUX_FUNC_CALLBACK ldv_platform_instance_release_2_3 */
     459             : void ldv_platform_instance_release_2_3(int (*arg0)(struct platform_device *), struct platform_device *arg1) {
     460           1 :  (*arg0)(arg1);
     461           1 : }
     462             : 
     463             : /* AUX_FUNC ldv_pm_ops_scenario_1 */
     464             : void ldv_pm_ops_scenario_1(void *arg0) {
     465             :  /* LDV {"thread": 1, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'pm_ops_scenario(pm)'", "function": "ldv_pm_ops_scenario_1"} */
     466           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
     467           1 :  struct device *ldv_1_device_device;
     468           1 :  struct dev_pm_ops *ldv_1_pm_ops_dev_pm_ops;
     469           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     470           1 :  /* LDV {"action": "PM_REGISTER", "type": "RECEIVE_BEGIN", "comment": "Ready for a power management scenarios."} */
     471           3 :  ldv_free(arg0);
     472           1 :  /* LDV {"action": "PM_REGISTER", "type": "RECEIVE_END"} */
     473             : 
     474             :  /* LDV {"action": "DO", "type": "SUBPROCESS_BEGIN", "comment": "Begin a power management scenario."} */
     475             :  /* LDV {"action": "DO", "type": "SUBPROCESS_END"} */
     476             : 
     477             :  /* Jump to a subprocess 'do' initial state */
     478           1 :  goto ldv_do_1;
     479             :  /* End of the process */
     480             :  return;
     481           1 : 
     482             :  /* Sbprocess do */
     483             :  ldv_do_1:
     484             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     485             : 
     486           2 :  switch (ldv_undef_int()) {
     487           3 :   case 1: {
     488             :    /* LDV {"action": "RUNTIME_IDLE", "type": "CALL_BEGIN", "callback": true, "comment": "Device appears to be inactive and it might be put into a low-power state if all of the necessary conditions are satisfied. Invoke callback runtime_idle from PM."} */
     489           3 :    if (ldv_1_pm_ops_dev_pm_ops->runtime_idle) {
     490             :    /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->runtime_idle)(ldv_1_device_device);", "comment": "runtime_idle"} */
     491           2 :     ldv_pm_ops_scenario_runtime_idle_1_24(ldv_1_pm_ops_dev_pm_ops->runtime_idle, ldv_1_device_device);
     492             :    }
     493             :    /* LDV {"action": "RUNTIME_IDLE", "type": "CALL_END"} */
     494             : 
     495             :    /* LDV {"action": "DO", "type": "SUBPROCESS_BEGIN", "comment": "Begin a power management scenario."} */
     496             :    /* LDV {"action": "DO", "type": "SUBPROCESS_END"} */
     497             : 
     498             :    /* Jump to a subprocess 'do' initial state */
     499           2 :    goto ldv_do_1;
     500           1 :    break;
     501             :   }
     502           3 :   case 2: {
     503             :    /* LDV {"action": "RUNTIME_SUSPEND", "type": "CALL_BEGIN", "callback": true, "comment": "The device should be put into a low-power state to prevent communication of the device with the CPU(s) and RAM. Invoke callback runtime_suspend from PM."} */
     504           3 :    if (ldv_1_pm_ops_dev_pm_ops->runtime_suspend) {
     505             :    /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->runtime_suspend)(ldv_1_device_device);", "comment": "runtime_suspend"} */
     506           2 :     ldv_pm_ops_scenario_runtime_suspend_1_22(ldv_1_pm_ops_dev_pm_ops->runtime_suspend, ldv_1_device_device);
     507             :    }
     508             :    /* LDV {"action": "RUNTIME_SUSPEND", "type": "CALL_END"} */
     509             : 
     510             :    /* LDV {"action": "RUNTIME_RESUME", "type": "CALL_BEGIN", "callback": true, "comment": "Put the device into the fully active state in response to a wakeup event generated by hardware or at the request of software. Invoke callback runtime_resume from PM."} */
     511           6 :    if (ldv_1_pm_ops_dev_pm_ops->runtime_resume) {
     512             :    /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->runtime_resume)(ldv_1_device_device);", "comment": "runtime_resume"} */
     513           4 :     ldv_pm_ops_scenario_runtime_resume_1_21(ldv_1_pm_ops_dev_pm_ops->runtime_resume, ldv_1_device_device);
     514             :    }
     515             :    /* LDV {"action": "RUNTIME_RESUME", "type": "CALL_END"} */
     516             : 
     517             :    /* LDV {"action": "DO", "type": "SUBPROCESS_BEGIN", "comment": "Begin a power management scenario."} */
     518             :    /* LDV {"action": "DO", "type": "SUBPROCESS_END"} */
     519             : 
     520             :    /* Jump to a subprocess 'do' initial state */
     521           3 :    goto ldv_do_1;
     522           1 :    break;
     523             :   }
     524           3 :   case 3: {
     525             :    /* LDV {"action": "PREPARE", "type": "CALL_BEGIN", "callback": true, "comment": "Prevent new children of the device from being registered. Invoke callback prepare from PM."} */
     526           3 :    if (ldv_1_pm_ops_dev_pm_ops->prepare) {
     527             :    /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->prepare)(ldv_1_device_device);", "comment": "prepare"} */
     528           2 :     ldv_pm_ops_scenario_prepare_1_19(ldv_1_pm_ops_dev_pm_ops->prepare, ldv_1_device_device);
     529             :    }
     530             :    /* LDV {"action": "PREPARE", "type": "CALL_END"} */
     531             : 
     532           4 :    switch (ldv_undef_int()) {
     533           3 :     case 1: {
     534             :      /* LDV {"action": "SUSPEND", "type": "CALL_BEGIN", "callback": true, "comment": "Quiesce subsystem-level device before suspend. Invoke callback suspend from PM."} */
     535           3 :      if (ldv_1_pm_ops_dev_pm_ops->suspend) {
     536             :      /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->suspend)(ldv_1_device_device);", "comment": "suspend"} */
     537           2 :       ldv_pm_ops_scenario_suspend_1_18(ldv_1_pm_ops_dev_pm_ops->suspend, ldv_1_device_device);
     538             :      }
     539             :      /* LDV {"action": "SUSPEND", "type": "CALL_END"} */
     540             : 
     541           6 :      if (ldv_undef_int()) {
     542             :       /* LDV {"action": "SUSPEND_NOIRQ", "type": "CALL_BEGIN", "callback": true, "comment": "Expect that the device will be in a low-power state. Invoke callback suspend_noirq from PM."} */
     543           3 :       if (ldv_1_pm_ops_dev_pm_ops->suspend_noirq) {
     544             :       /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->suspend_noirq)(ldv_1_device_device);", "comment": "suspend_noirq"} */
     545           2 :        ldv_pm_ops_scenario_suspend_noirq_1_17(ldv_1_pm_ops_dev_pm_ops->suspend_noirq, ldv_1_device_device);
     546             :       }
     547             :       /* LDV {"action": "SUSPEND_NOIRQ", "type": "CALL_END"} */
     548             : 
     549             :       /* LDV {"action": "RESUME_NOIRQ", "type": "CALL_BEGIN", "callback": true, "comment": "Prepare for the #resume() performing actions that might be racing with device's interrupt handler. Invoke callback resume_noirq from PM."} */
     550           6 :       if (ldv_1_pm_ops_dev_pm_ops->resume_noirq) {
     551             :       /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->resume_noirq)(ldv_1_device_device);", "comment": "resume_noirq"} */
     552           4 :        ldv_pm_ops_scenario_resume_noirq_1_16(ldv_1_pm_ops_dev_pm_ops->resume_noirq, ldv_1_device_device);
     553             :       }
     554             :       /* LDV {"action": "RESUME_NOIRQ", "type": "CALL_END"} */
     555             : 
     556             :      }
     557             :      else {
     558             :       /* LDV {"action": "SKIP_NOIRQ", "type": "CONDITION_BEGIN", "comment": "Skip noirq callbacks"} */
     559             :       /* LDV {"action": "SKIP_NOIRQ", "type": "CONDITION_END"} */
     560             : 
     561             :      }
     562             :      /* LDV {"action": "RESUME", "type": "CALL_BEGIN", "callback": true, "comment": "Make the device start working again after resume. Invoke callback resume from PM."} */
     563           9 :      if (ldv_1_pm_ops_dev_pm_ops->resume) {
     564             :      /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->resume)(ldv_1_device_device);", "comment": "resume"} */
     565           6 :       ldv_pm_ops_scenario_resume_1_14(ldv_1_pm_ops_dev_pm_ops->resume, ldv_1_device_device);
     566             :      }
     567             :      /* LDV {"action": "RESUME", "type": "CALL_END"} */
     568             : 
     569           4 :      break;
     570           1 :     }
     571           3 :     case 2: {
     572             :      /* LDV {"action": "FREEZE", "type": "CALL_BEGIN", "callback": true, "comment": "Prepare for creating a hibernation image. Invoke callback freeze from PM."} */
     573           3 :      if (ldv_1_pm_ops_dev_pm_ops->freeze) {
     574             :      /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->freeze)(ldv_1_device_device);", "comment": "freeze"} */
     575           2 :       ldv_pm_ops_scenario_freeze_1_13(ldv_1_pm_ops_dev_pm_ops->freeze, ldv_1_device_device);
     576             :      }
     577             :      /* LDV {"action": "FREEZE", "type": "CALL_END"} */
     578             : 
     579           6 :      if (ldv_undef_int()) {
     580             :       /* LDV {"action": "SKIP_NOIRQ", "type": "CONDITION_BEGIN", "comment": "Skip noirq callbacks"} */
     581             :       /* LDV {"action": "SKIP_NOIRQ", "type": "CONDITION_END"} */
     582             : 
     583             :      }
     584             :      else {
     585             :       /* LDV {"action": "FREEZE_NOIRQ", "type": "CALL_BEGIN", "callback": true, "comment": "Complete the actions started by #freeze() that might be racing with device's interrupt handler. Invoke callback freeze_noirq from PM."} */
     586           3 :       if (ldv_1_pm_ops_dev_pm_ops->freeze_noirq) {
     587             :       /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->freeze_noirq)(ldv_1_device_device);", "comment": "freeze_noirq"} */
     588           2 :        ldv_pm_ops_scenario_freeze_noirq_1_11(ldv_1_pm_ops_dev_pm_ops->freeze_noirq, ldv_1_device_device);
     589             :       }
     590             :       /* LDV {"action": "FREEZE_NOIRQ", "type": "CALL_END"} */
     591             : 
     592             :       /* LDV {"action": "THAW_NOIRQ", "type": "CALL_BEGIN", "callback": true, "comment": "Prepare for the execution of #thaw() performing actions that might be racing with device's interrupt handler. Invoke callback thaw_noirq from PM."} */
     593           6 :       if (ldv_1_pm_ops_dev_pm_ops->thaw_noirq) {
     594             :       /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->thaw_noirq)(ldv_1_device_device);", "comment": "thaw_noirq"} */
     595           4 :        ldv_pm_ops_scenario_thaw_noirq_1_10(ldv_1_pm_ops_dev_pm_ops->thaw_noirq, ldv_1_device_device);
     596             :       }
     597             :       /* LDV {"action": "THAW_NOIRQ", "type": "CALL_END"} */
     598             : 
     599             :      }
     600             :      /* LDV {"action": "THAW", "type": "CALL_BEGIN", "callback": true, "comment": "The hibernation image has created or creation has failed. Invoke callback thaw from PM."} */
     601           9 :      if (ldv_1_pm_ops_dev_pm_ops->thaw) {
     602             :      /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->thaw)(ldv_1_device_device);", "comment": "thaw"} */
     603           6 :       ldv_pm_ops_scenario_thaw_1_9(ldv_1_pm_ops_dev_pm_ops->thaw, ldv_1_device_device);
     604             :      }
     605             :      /* LDV {"action": "THAW", "type": "CALL_END"} */
     606             : 
     607           4 :      break;
     608           1 :     }
     609           3 :     case 3: {
     610             :      /* LDV {"action": "POWEROFF", "type": "CALL_BEGIN", "callback": true, "comment": "Hibernation image has been created. Invoke callback poweroff from PM."} */
     611           3 :      if (ldv_1_pm_ops_dev_pm_ops->poweroff) {
     612             :      /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->poweroff)(ldv_1_device_device);", "comment": "poweroff"} */
     613           2 :       ldv_pm_ops_scenario_poweroff_1_8(ldv_1_pm_ops_dev_pm_ops->poweroff, ldv_1_device_device);
     614             :      }
     615             :      /* LDV {"action": "POWEROFF", "type": "CALL_END"} */
     616             : 
     617           6 :      if (ldv_undef_int()) {
     618             :       /* LDV {"action": "POWEROFF_NOIRQ", "type": "CALL_BEGIN", "callback": true, "comment": "Complete the actions started by #poweroff(). Invoke callback poweroff_noirq from PM."} */
     619           3 :       if (ldv_1_pm_ops_dev_pm_ops->poweroff_noirq) {
     620             :       /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->poweroff_noirq)(ldv_1_device_device);", "comment": "poweroff_noirq"} */
     621           2 :        ldv_pm_ops_scenario_poweroff_noirq_1_7(ldv_1_pm_ops_dev_pm_ops->poweroff_noirq, ldv_1_device_device);
     622             :       }
     623             :       /* LDV {"action": "POWEROFF_NOIRQ", "type": "CALL_END"} */
     624             : 
     625             :       /* LDV {"action": "RESTORE_NOIRQ", "type": "CALL_BEGIN", "callback": true, "comment": "Prepare for the execution of #restore() performing actions that might be racing with device's interrupt handler. Invoke callback restore_noirq from PM."} */
     626           6 :       if (ldv_1_pm_ops_dev_pm_ops->restore_noirq) {
     627             :       /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->restore_noirq)(ldv_1_device_device);", "comment": "restore_noirq"} */
     628           4 :        ldv_pm_ops_scenario_restore_noirq_1_6(ldv_1_pm_ops_dev_pm_ops->restore_noirq, ldv_1_device_device);
     629             :       }
     630             :       /* LDV {"action": "RESTORE_NOIRQ", "type": "CALL_END"} */
     631             : 
     632             :      }
     633             :      else {
     634             :       /* LDV {"action": "SKIP_NOIRQ", "type": "CONDITION_BEGIN", "comment": "Skip noirq callbacks"} */
     635             :       /* LDV {"action": "SKIP_NOIRQ", "type": "CONDITION_END"} */
     636             : 
     637             :      }
     638             :      /* LDV {"action": "RESTORE", "type": "CALL_BEGIN", "callback": true, "comment": "Restoration of the contents of main memory from a hibernation image has been done. Invoke callback restore from PM."} */
     639           9 :      if (ldv_1_pm_ops_dev_pm_ops->restore) {
     640             :      /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->restore)(ldv_1_device_device);", "comment": "restore"} */
     641           6 :       ldv_pm_ops_scenario_restore_1_4(ldv_1_pm_ops_dev_pm_ops->restore, ldv_1_device_device);
     642             :      }
     643             :      /* LDV {"action": "RESTORE", "type": "CALL_END"} */
     644             : 
     645           4 :      break;
     646           1 :     }
     647           2 :     default: ldv_stop();
     648           1 :    }
     649           0 :    /* LDV {"action": "COMPLETE", "type": "CALL_BEGIN", "callback": true, "comment": "Undo the changes made by #prepare(). Invoke callback complete from PM."} */
     650          36 :    if (ldv_1_pm_ops_dev_pm_ops->complete) {
     651           0 :    /* LDV {"type": "CALLBACK", "call": "(ldv_1_pm_ops_dev_pm_ops->complete)(ldv_1_device_device);", "comment": "complete"} */
     652          24 :     ldv_pm_ops_scenario_complete_1_3(ldv_1_pm_ops_dev_pm_ops->complete, ldv_1_device_device);
     653             :    }
     654             :    /* LDV {"action": "COMPLETE", "type": "CALL_END"} */
     655             : 
     656             :    /* LDV {"action": "DO", "type": "SUBPROCESS_BEGIN", "comment": "Begin a power management scenario."} */
     657             :    /* LDV {"action": "DO", "type": "SUBPROCESS_END"} */
     658             : 
     659             :    /* Jump to a subprocess 'do' initial state */
     660          13 :    goto ldv_do_1;
     661           1 :    break;
     662             :   }
     663           3 :   case 4: {
     664             :    /* LDV {"action": "PM_DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Do not expect power management scenarios."} */
     665             :    /* Skip a non-replicative signal receiving */
     666             :    /* LDV {"action": "PM_DEREGISTER", "type": "RECEIVE_END"} */
     667             : 
     668             :    /* Exit function at a terminal state */
     669           1 :    return;
     670           1 :    break;
     671             :   }
     672           2 :   default: ldv_stop();
     673           1 :  }
     674           0 :  /* End of the subprocess 'do' */
     675           0 :  return;
     676             :  /* LDV {"comment": "End of control function based on process 'pm_ops_scenario(pm)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_pm_ops_scenario_1"} */
     677             : }
     678             : 
     679             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_complete_1_3 */
     680             : void ldv_pm_ops_scenario_complete_1_3(void (*arg0)(struct device *), struct device *arg1) {
     681          24 :  (*arg0)(arg1);
     682          12 : }
     683             : 
     684             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_freeze_1_13 */
     685             : void ldv_pm_ops_scenario_freeze_1_13(int (*arg0)(struct device *), struct device *arg1) {
     686           3 :  (*arg0)(arg1);
     687           1 : }
     688             : 
     689             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_freeze_noirq_1_11 */
     690             : void ldv_pm_ops_scenario_freeze_noirq_1_11(int (*arg0)(struct device *), struct device *arg1) {
     691           3 :  (*arg0)(arg1);
     692           1 : }
     693             : 
     694             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_poweroff_1_8 */
     695             : void ldv_pm_ops_scenario_poweroff_1_8(int (*arg0)(struct device *), struct device *arg1) {
     696           3 :  (*arg0)(arg1);
     697           1 : }
     698             : 
     699             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_poweroff_noirq_1_7 */
     700             : void ldv_pm_ops_scenario_poweroff_noirq_1_7(int (*arg0)(struct device *), struct device *arg1) {
     701           3 :  (*arg0)(arg1);
     702           1 : }
     703             : 
     704             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_prepare_1_19 */
     705             : void ldv_pm_ops_scenario_prepare_1_19(int (*arg0)(struct device *), struct device *arg1) {
     706           3 :  (*arg0)(arg1);
     707           1 : }
     708             : 
     709             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_restore_1_4 */
     710             : void ldv_pm_ops_scenario_restore_1_4(int (*arg0)(struct device *), struct device *arg1) {
     711           9 :  (*arg0)(arg1);
     712           3 : }
     713             : 
     714             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_restore_noirq_1_6 */
     715             : void ldv_pm_ops_scenario_restore_noirq_1_6(int (*arg0)(struct device *), struct device *arg1) {
     716           6 :  (*arg0)(arg1);
     717           2 : }
     718             : 
     719             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_resume_1_14 */
     720             : void ldv_pm_ops_scenario_resume_1_14(int (*arg0)(struct device *), struct device *arg1) {
     721           9 :  (*arg0)(arg1);
     722           3 : }
     723             : 
     724             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_resume_noirq_1_16 */
     725             : void ldv_pm_ops_scenario_resume_noirq_1_16(int (*arg0)(struct device *), struct device *arg1) {
     726           6 :  (*arg0)(arg1);
     727           2 : }
     728             : 
     729             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_runtime_idle_1_24 */
     730             : void ldv_pm_ops_scenario_runtime_idle_1_24(int (*arg0)(struct device *), struct device *arg1) {
     731           3 :  (*arg0)(arg1);
     732           1 : }
     733             : 
     734             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_runtime_resume_1_21 */
     735             : void ldv_pm_ops_scenario_runtime_resume_1_21(int (*arg0)(struct device *), struct device *arg1) {
     736           6 :  (*arg0)(arg1);
     737           2 : }
     738             : 
     739             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_runtime_suspend_1_22 */
     740             : void ldv_pm_ops_scenario_runtime_suspend_1_22(int (*arg0)(struct device *), struct device *arg1) {
     741           3 :  (*arg0)(arg1);
     742           1 : }
     743             : 
     744             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_suspend_1_18 */
     745             : void ldv_pm_ops_scenario_suspend_1_18(int (*arg0)(struct device *), struct device *arg1) {
     746           3 :  (*arg0)(arg1);
     747           1 : }
     748             : 
     749             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_suspend_noirq_1_17 */
     750             : void ldv_pm_ops_scenario_suspend_noirq_1_17(int (*arg0)(struct device *), struct device *arg1) {
     751           3 :  (*arg0)(arg1);
     752           1 : }
     753             : 
     754             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_thaw_1_9 */
     755             : void ldv_pm_ops_scenario_thaw_1_9(int (*arg0)(struct device *), struct device *arg1) {
     756           9 :  (*arg0)(arg1);
     757           3 : }
     758             : 
     759             : /* AUX_FUNC_CALLBACK ldv_pm_ops_scenario_thaw_noirq_1_10 */
     760             : void ldv_pm_ops_scenario_thaw_noirq_1_10(int (*arg0)(struct device *), struct device *arg1) {
     761           6 :  (*arg0)(arg1);
     762           2 : }
     763             : 
     764             : /* AUX_FUNC ldv_random_containerless_scenario_3 */
     765             : void ldv_random_containerless_scenario_3(void *arg0) {
     766             :  /* LDV {"thread": 3, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_driver_attribute)'", "function": "ldv_random_containerless_scenario_3"} */
     767           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
     768           1 :  ssize_t (*ldv_3_callback_store)(struct device_driver *, char *, size_t );
     769           1 :  struct device_driver *ldv_3_container_struct_device_driver_ptr;
     770           1 :  char *ldv_3_ldv_param_4_1_default;
     771           1 :  long unsigned int ldv_3_ldv_param_4_2_default;
     772           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     773           1 :  /* LDV {"action": "DEFAULT_REGISTER_3", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_DRIVER_ATTRIBUTE callbacks invocations scenario."} */
     774           2 :  ldv_free(arg0);
     775             :  /* LDV {"action": "DEFAULT_REGISTER_3", "type": "RECEIVE_END"} */
     776             : 
     777             :  /* LDV {"action": "DEFAULT_ALLOC_3", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
     778           3 :  ldv_3_container_struct_device_driver_ptr = ldv_xmalloc_unknown_size(0);
     779             :  /* LDV {"action": "DEFAULT_ALLOC_3", "type": "CONDITION_END"} */
     780             : 
     781             :  /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
     782             :  /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     783             : 
     784             :  /* Jump to a subprocess 'call' initial state */
     785           1 :  goto ldv_call_3;
     786             :  /* End of the process */
     787             :  return;
     788           1 : 
     789             :  /* Sbprocess call */
     790             :  ldv_call_3:
     791             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     792             : 
     793           4 :  if (ldv_undef_int()) {
     794             :   /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     795           3 :   ldv_3_ldv_param_4_1_default = ldv_xmalloc_unknown_size(0);
     796             :   /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
     797             : 
     798             :   /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback store from driver_attribute."} */
     799             :   /* LDV {"type": "CALLBACK", "call": "((& store_new_id))(ldv_3_container_struct_device_driver_ptr, ldv_3_ldv_param_4_1_default, ldv_3_ldv_param_4_2_default);", "comment": "callback"} */
     800           2 :   ldv_random_containerless_scenario_callback_3_4(ldv_3_callback_store, ldv_3_container_struct_device_driver_ptr, ldv_3_ldv_param_4_1_default, ldv_3_ldv_param_4_2_default);
     801             :   /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     802             : 
     803             :   /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     804           2 :   ldv_free(ldv_3_ldv_param_4_1_default);
     805             :   /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
     806             : 
     807             :   /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
     808             :   /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     809             : 
     810             :   /* Jump to a subprocess 'call' initial state */
     811           1 :   goto ldv_call_3;
     812             :  }
     813             :  else {
     814             :   /* LDV {"action": "DEFAULT_FREE_3", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
     815           2 :   ldv_free(ldv_3_container_struct_device_driver_ptr);
     816             :   /* LDV {"action": "DEFAULT_FREE_3", "type": "CONDITION_END"} */
     817             : 
     818             :   /* LDV {"action": "DEFAULT_DEREGISTER_3", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_DRIVER_ATTRIBUTE callbacks invocations scenario."} */
     819             :   /* Skip a non-replicative signal receiving */
     820             :   /* LDV {"action": "DEFAULT_DEREGISTER_3", "type": "RECEIVE_END"} */
     821             : 
     822             :   /* Exit function at a terminal state */
     823           1 :   return;
     824             :  }
     825             :  /* End of the subprocess 'call' */
     826             :  return;
     827             :  /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_driver_attribute)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_3"} */
     828             : }
     829             : 
     830             : /* AUX_FUNC ldv_random_containerless_scenario_4 */
     831             : void ldv_random_containerless_scenario_4(void *arg0) {
     832             :  /* LDV {"thread": 4, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_kernel_param)'", "function": "ldv_random_containerless_scenario_4"} */
     833           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
     834           1 :  int (*ldv_4_callback_get)(char *, struct kernel_param *);
     835           1 :  int (*ldv_4_callback_set)(char *, struct kernel_param *);
     836           1 :  struct kernel_param *ldv_4_container_struct_kernel_param;
     837           1 :  char *ldv_4_ldv_param_10_0_default;
     838           1 :  char *ldv_4_ldv_param_4_0_default;
     839           1 :  /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
     840           1 :  /* LDV {"action": "DEFAULT_REGISTER_4", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_KERNEL_PARAM callbacks invocations scenario."} */
     841           3 :  ldv_free(arg0);
     842           1 :  /* LDV {"action": "DEFAULT_REGISTER_4", "type": "RECEIVE_END"} */
     843             : 
     844             :  /* LDV {"action": "DEFAULT_ALLOC_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
     845           3 :  ldv_4_container_struct_kernel_param = ldv_xmalloc_unknown_size(0);
     846             :  /* LDV {"action": "DEFAULT_ALLOC_4", "type": "CONDITION_END"} */
     847             : 
     848             :  /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
     849             :  /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     850             : 
     851             :  /* Jump to a subprocess 'call' initial state */
     852           1 :  goto ldv_call_4;
     853             :  /* End of the process */
     854             :  return;
     855           1 : 
     856             :  /* Sbprocess call */
     857             :  ldv_call_4:
     858             :  /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
     859             : 
     860           4 :  if (ldv_undef_int()) {
     861             :   /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     862           3 :   ldv_4_ldv_param_4_0_default = ldv_xmalloc_unknown_size(0);
     863             :   /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
     864             : 
     865           4 :   if (ldv_undef_int()) {
     866             :    /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
     867           3 :    ldv_4_ldv_param_10_0_default = ldv_xmalloc_unknown_size(0);
     868             :    /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_END"} */
     869             : 
     870             :    /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback set from kernel_param."} */
     871             :    /* LDV {"type": "CALLBACK", "call": "((& param_set_int))(ldv_4_ldv_param_10_0_default, ldv_4_container_struct_kernel_param);", "comment": "callback"} */
     872           2 :    ldv_random_containerless_scenario_callback_4_10(ldv_4_callback_set, ldv_4_ldv_param_10_0_default, ldv_4_container_struct_kernel_param);
     873             :    /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     874             : 
     875             :    /* LDV {"action": "POST_CALL_10", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     876           2 :    ldv_free(ldv_4_ldv_param_10_0_default);
     877             :    /* LDV {"action": "POST_CALL_10", "type": "CONDITION_END"} */
     878             : 
     879             :   }
     880             :   else {
     881             :    /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback get from kernel_param."} */
     882             :    /* LDV {"type": "CALLBACK", "call": "((& param_get_int))(ldv_4_ldv_param_4_0_default, ldv_4_container_struct_kernel_param);", "comment": "callback"} */
     883           2 :    ldv_random_containerless_scenario_callback_4_4(ldv_4_callback_get, ldv_4_ldv_param_4_0_default, ldv_4_container_struct_kernel_param);
     884             :    /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
     885             : 
     886             :   }
     887             :   /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
     888           4 :   ldv_free(ldv_4_ldv_param_4_0_default);
     889             :   /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
     890             : 
     891             :   /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
     892             :   /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
     893             : 
     894             :   /* Jump to a subprocess 'call' initial state */
     895           1 :   goto ldv_call_4;
     896             :  }
     897             :  else {
     898             :   /* LDV {"action": "DEFAULT_FREE_4", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
     899           2 :   ldv_free(ldv_4_container_struct_kernel_param);
     900             :   /* LDV {"action": "DEFAULT_FREE_4", "type": "CONDITION_END"} */
     901             : 
     902             :   /* LDV {"action": "DEFAULT_DEREGISTER_4", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_KERNEL_PARAM callbacks invocations scenario."} */
     903             :   /* Skip a non-replicative signal receiving */
     904             :   /* LDV {"action": "DEFAULT_DEREGISTER_4", "type": "RECEIVE_END"} */
     905             : 
     906             :   /* Exit function at a terminal state */
     907           1 :   return;
     908             :  }
     909             :  /* End of the subprocess 'call' */
     910             :  return;
     911             :  /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_kernel_param)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_4"} */
     912             : }
     913             : 
     914             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_3_4 */
     915             : void ldv_random_containerless_scenario_callback_3_4(ssize_t (*arg0)(struct device_driver *, char *, size_t ), struct device_driver *arg1, char *arg2, long unsigned int arg3) {
     916           4 :  ((& store_new_id))(arg1, arg2, arg3);
     917           1 : }
     918             : 
     919             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_4_10 */
     920             : void ldv_random_containerless_scenario_callback_4_10(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
     921           1 :  ((& param_set_int))(arg1, arg2);
     922           1 : }
     923             : 
     924             : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_4_4 */
     925             : void ldv_random_containerless_scenario_callback_4_4(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
     926           1 :  ((& param_get_int))(arg1, arg2);
     927           1 : }
     928             : 
     929             : /* AUX_FUNC main */
     930             : int main() {
     931           1 :  ldv_main_6(0);
     932           0 :  return 0;
     933             : }
     934             : 
     935             : 
     936             : /* AUX_FUNC  ERR_PTR */
     937             : static inline void *ERR_PTR (long int error)
     938             : {
     939           0 : 
     940           0 :  return ldv_err_ptr(error);
     941             : }
     942             : 
     943             : /* AUX_FUNC  PTR_ERR */
     944             : static inline long int PTR_ERR (void const *ptr)
     945             : {
     946             : 
     947             :  return ldv_ptr_err(ptr);
     948             : }
     949             : 
     950             : /* AUX_FUNC  IS_ERR */
     951             : static inline long int IS_ERR (void const *ptr)
     952             : {
     953             : 
     954             :  return ldv_is_err(ptr);
     955             : }
     956             : 
     957             : /* AUX_FUNC  IS_ERR_OR_NULL */
     958             : static inline long int IS_ERR_OR_NULL (void const *ptr)
     959             : {
     960             : 
     961             :  return ldv_is_err_or_null(ptr);
     962             : }
     963             : 
     964             : /* AUX_FUNC  kzalloc */
     965             : static inline void *kzalloc (size_t size, gfp_t flags)
     966             : {
     967           1 : 
     968           3 :  return ldv_kzalloc(size, flags);
     969             : }
     970             : 
     971             : /* AUX_FUNC  ldv_dev_get_drvdata_6 */
     972             : void *ldv_dev_get_drvdata_6 (struct device const *dev)
     973             : {
     974             : 
     975             :  return ldv_dev_get_drvdata(dev);
     976             : }
     977             : 
     978             : /* AUX_FUNC  ldv_dev_get_drvdata_7 */
     979             : void *ldv_dev_get_drvdata_7 (struct device const *dev)
     980             : {
     981             : 
     982             :  return ldv_dev_get_drvdata(dev);
     983             : }

Generated by: LCOV version 1.10