| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fno-delete-null-pointer-checks" } */ |
| 3 |
/* { dg-require-effective-target label_values } */ |
| 4 |
|
| 5 |
__extension__ typedef __UINTPTR_TYPE__ uintptr_t; |
| 6 |
|
| 7 |
extern struct module __this_module; |
| 8 |
static inline void |
| 9 |
trace_module_get (struct module *mod, uintptr_t ip) { } |
| 10 |
struct module; |
| 11 |
int module_is_live (struct module *); |
| 12 |
static inline __attribute__((no_instrument_function)) |
| 13 |
int try_module_get(struct module *module) |
| 14 |
{ |
| 15 |
int ret = 1; |
| 16 |
if (module) |
| 17 |
{ |
| 18 |
if (module_is_live(module)) |
| 19 |
{ |
| 20 |
__label__ __here; |
| 21 |
asm(""); |
| 22 |
__here: |
| 23 |
trace_module_get(module, (uintptr_t)&&__here); |
| 24 |
} |
| 25 |
else |
| 26 |
ret = 0; |
| 27 |
} |
| 28 |
return ret; |
| 29 |
} |
| 30 |
struct net_device; |
| 31 |
struct net_device_ops { |
| 32 |
int (*ndo_open)(struct net_device *dev); |
| 33 |
}; |
| 34 |
int hdlc_open (struct net_device *); |
| 35 |
int t3e3_open(struct net_device *dev) |
| 36 |
{ |
| 37 |
int ret = hdlc_open(dev); |
| 38 |
if (ret) |
| 39 |
return ret; |
| 40 |
try_module_get((&__this_module)); |
| 41 |
return 0; |
| 42 |
} |
| 43 |
const struct net_device_ops t3e3_ops = { .ndo_open = t3e3_open }; |