From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1910F10E930 for ; Thu, 7 Dec 2023 17:11:43 +0000 (UTC) From: Ville Syrjala To: igt-dev@lists.freedesktop.org Subject: [PATCH i-g-t 2/2] lib/intel_bufops: Don't memcpy() simple structs Date: Thu, 7 Dec 2023 19:11:36 +0200 Message-ID: <20231207171136.30669-2-ville.syrjala@linux.intel.com> In-Reply-To: <20231207171136.30669-1-ville.syrjala@linux.intel.com> References: <20231207171136.30669-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Ville Syrjälä Just use a regular assignment when possible instead of complicating things with memcpy(). Signed-off-by: Ville Syrjälä --- lib/intel_bufops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c index 46eba3fb43a2..6ceea55caa81 100644 --- a/lib/intel_bufops.c +++ b/lib/intel_bufops.c @@ -1498,7 +1498,7 @@ static struct buf_ops *__buf_ops_create(int fd, bool check_idempotency) for (int i = 0; i < ARRAY_SIZE(buf_ops_arr); i++) { if (generation >= buf_ops_arr[i].gen_start && generation <= buf_ops_arr[i].gen_end) { - memcpy(bops, &buf_ops_arr[i], sizeof(*bops)); + *bops = buf_ops_arr[i]; break; } } -- 2.41.0