video: driver: add resource ops macro support
Added call_res_op() macro and used at all possible places to avoid invalid pointer dereference issue. Also added changes to cleanup unused functions. Change-Id: Id77711ad9eaf7b407208567b0fde1f2693588641 Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
This commit is contained in:
@@ -197,6 +197,10 @@ struct msm_vidc_resource {
|
||||
int fw_cookie;
|
||||
};
|
||||
|
||||
#define call_res_op(c, op, ...) \
|
||||
(((c) && (c)->res_ops && (c)->res_ops->op) ? \
|
||||
((c)->res_ops->op(__VA_ARGS__)) : 0)
|
||||
|
||||
struct msm_vidc_resources_ops {
|
||||
int (*init)(struct msm_vidc_core *core);
|
||||
|
||||
|
Reference in New Issue
Block a user