| 98 | } |
| 99 | |
| 100 | static void |
| 101 | kobj_class_compile_common(kobj_class_t cls, kobj_ops_t ops) |
| 102 | { |
| 103 | kobj_method_t *m; |
| 104 | int i; |
| 105 | |
| 106 | /* |
| 107 | * Don't do anything if we are already compiled. |
| 108 | */ |
| 109 | if (cls->ops) |
| 110 | return; |
| 111 | |
| 112 | /* |
| 113 | * First register any methods which need it. |
| 114 | */ |
| 115 | for (i = 0, m = cls->methods; m->desc; i++, m++) { |
| 116 | if (m->desc->id == 0) |
| 117 | m->desc->id = kobj_next_id++; |
| 118 | } |
| 119 | |
| 120 | /* |
| 121 | * Then initialise the ops table. |
| 122 | */ |
| 123 | for (i = 0; i < KOBJ_CACHE_SIZE; i++) |
| 124 | ops->cache[i] = &null_method; |
| 125 | ops->cls = cls; |
| 126 | cls->ops = ops; |
| 127 | } |
| 128 | |
| 129 | static int |
| 130 | kobj_class_compile1(kobj_class_t cls, int mflags) |
no outgoing calls
no test coverage detected