> +#define sgx_pr_ratelimited(level, encl, fmt, ...) \ > + pr_ ## level ## _ratelimited("[%d:0x%p] " fmt, \ > + pid_nr((encl)->tgid), \ > + (void *)(encl)->base, ##__VA_ARGS__) > + > +#define sgx_dbg(encl, fmt, ...) \ > + sgx_pr_ratelimited(debug, encl, fmt, ##__VA_ARGS__) > +#define sgx_info(encl, fmt, ...) \ > + sgx_pr_ratelimited(info, encl, fmt, ##__VA_ARGS__) > +#define sgx_warn(encl, fmt, ...) \ > + sgx_pr_ratelimited(warn, encl, fmt, ##__VA_ARGS__) > +#define sgx_err(encl, fmt, ...) \ > + sgx_pr_ratelimited(err, encl, fmt, ##__VA_ARGS__) > +#define sgx_crit(encl, fmt, ...) \ > + sgx_pr_ratelimited(crit, encl, fmt, ##__VA_ARGS__) I thought the pr_* thingies were to keep everyone from having to do this in each driver. Why did you need this? Can you do any better than a 2,000-line patch? For instance, could you break out the memory management portion into its own part and have that reviewed by mm folks? Or the ioctl()'s by device driver folks?