diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index 7aae0561c9c5a4eb8721b593c6bab4123552d876..3948587a047c60a01c0c13ccc48d509015f0a75c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c @@ -185,9 +185,11 @@ static ssize_t i40e_dbg_dump_write(struct file *filp, if (i40e_dbg_prep_dump_buf(pf, buflen)) { p = i40e_dbg_dump_buf; - len = sizeof(struct i40e_pf); - memcpy(p, pf, len); - p += len; + /* avoid use of memcpy here due to sparse warning + * about copy size. + */ + *((struct i40e_pf *)p) = *pf; + p += sizeof(struct i40e_pf); len = (sizeof(struct i40e_aq_desc) * pf->hw.aq.num_asq_entries);