On Sat, 30 Aug 2025 16:08:41 +0800 Fan Gong wrote: > +int hinic3_init_cfg_mgmt(struct hinic3_hwdev *hwdev) > +{ > + struct hinic3_cfg_mgmt_info *cfg_mgmt; > + int err; > + > + if (!hwdev->hwif->attr.num_ceqs) { > + dev_err(hwdev->dev, "Ceq num cfg in fw is zero\n"); > + return -EINVAL; > + } The input checking in most of the functions looks like defensive programming. The values should be checked when they are set / loaded, not on input to random functions. Defensive programming should be avoided in the kernel (meaning, unless you can point out actual callers which need the validation, and can explain why doing the check in the callee rather than the caller is cleaner -- the check should be in the caller).