Message ID | 202401091424115185126@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-20433-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1473759dyq; Mon, 8 Jan 2024 22:33:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd0s8+ln05dteG0kt76X52PDPkMKK8ZCWs9bopA/Ix6twWrqhivjHM0t24JUUkrivEcDVP X-Received: by 2002:a05:620a:379f:b0:783:668:a7b9 with SMTP id pi31-20020a05620a379f00b007830668a7b9mr4504111qkn.85.1704782003567; Mon, 08 Jan 2024 22:33:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704782003; cv=none; d=google.com; s=arc-20160816; b=gdqnCKRvlnd+YFpbLbqPYUlpzE6k28UW38hxYn9rZpNtsICER/GuO0RJLMv2CJwpcc D07y1uvz9FNuN6gCXnTe0NBMGzQg0neFiuIFRSMqE9f5BbNFWsbkAWY6eetX7Z5WGAMI uc11tmvQunmSW1PAEU6QrA0BcLgQZWHpdt1QQr4cB/J1vDG3FzEsse3e4y4NlRFF7Uw+ L4VMFGoPNpyCf1TR8OMvC7vxKfdeFTBi6HNzAwexipyn/du0CgrEvuSLW5D0FZVNORQg jC0svKo/O+bnNz/xBtaOVE0/dpqpLikW1jKoy63lcbcryvdtVKp9DJPa3QVJxqeLAp9X FDgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:date; bh=ygqTlYVauKeRAM/i4h6yVVkSYZcEQGqrFTcwfxR4O1o=; fh=I/r/tcDv91bUF80axH/TRYwJ9t3J4OZYlEA16aZd5Cg=; b=mYp8adCPSD1XIjyF9NJtOLsGsS2QxFJu9jE5P6tOKR4R67JdiQyHB9PCaOurkzzHxt L1ALbRZlf57nhr5KFnb34JS6Zz5KAWK/LwtOu6Gl9STYBu47UQ0zZjq+nU/R0Ld8wqda 1KAfAyLSTbju9fGn1i6h5mpVeHZBFKpoIrpvnYfF9o95CN9ao+iSQJt3vSIPdKZ1X6Se YIO9EJT4N6awX16dklzs8VDfbJlVGdJ1dND1cKjc4FCsHWsMGUkSHuG5cXQM/gda1X0r NB/W1Ji5pidNK64xs3bBO6oGU6iqb7fl+D8HEtNXHD8xYGVME3cttAeCMRHQorTW50l7 4G/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20433-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w20-20020a05620a0e9400b00781e877cd8dsi1446721qkm.158.2024.01.08.22.33.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 22:33:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20433-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5CAF61C2322B for <ouuuleilei@gmail.com>; Tue, 9 Jan 2024 06:33:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69FC8BA3F; Tue, 9 Jan 2024 06:33:11 +0000 (UTC) Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD81EB645 for <linux-kernel@vger.kernel.org>; Tue, 9 Jan 2024 06:33:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zte.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zte.com.cn Received: from mxde.zte.com.cn (unknown [10.35.20.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4T8LWF0rBqzW8d for <linux-kernel@vger.kernel.org>; Tue, 9 Jan 2024 14:24:41 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4T8LW64nSZz6yMNs for <linux-kernel@vger.kernel.org>; Tue, 9 Jan 2024 14:24:34 +0800 (CST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4T8LVw5S1Vz4xPYn; Tue, 9 Jan 2024 14:24:24 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl1.zte.com.cn with SMTP id 4096O92i032550; Tue, 9 Jan 2024 14:24:09 +0800 (+08) (envelope-from yang.guang5@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Tue, 9 Jan 2024 14:24:11 +0800 (CST) Date: Tue, 9 Jan 2024 14:24:11 +0800 (CST) X-Zmail-TransId: 2afa659ce68b109-9212b X-Mailer: Zmail v1.0 Message-ID: <202401091424115185126@zte.com.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 From: <yang.guang5@zte.com.cn> To: <kherbst@redhat.com> Cc: <jiang.xuexin@zte.com.cn>, <chen.haonan2@zte.com.cn>, <cgel.zte@gmail.com>, <lyude@redhat.com>, <dakr@redhat.com>, <airlied@gmail.com>, <daniel@ffwll.ch>, <bskeggs@redhat.com>, <keescook@chromium.org>, <dri-devel@lists.freedesktop.org>, <nouveau@lists.freedesktop.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH_linux-next_v2=5D_drm/nouveau/disp=3A_switch_to_u?= =?utf-8?q?se_kmemdup=28=29_helper?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 4096O92i032550 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 659CE6A8.000/4T8LWF0rBqzW8d X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787593494077065475 X-GMAIL-MSGID: 1787593494077065475 |
Series |
[linux-next,v2] drm/nouveau/disp: switch to use kmemdup() helper
|
|
Commit Message
yang.guang5@zte.com.cn
Jan. 9, 2024, 6:24 a.m. UTC
From: Chen Haonan <chen.haonan2@zte.com.cn> Use kmemdup() helper instead of open-coding to simplify the code. Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn> Reviewed-by: Yang Guang <yang.guang5@zte.com.cn> --- drivers/gpu/drm/nouveau/nvif/outp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On 1/9/24 07:24, yang.guang5@zte.com.cn wrote: > From: Chen Haonan <chen.haonan2@zte.com.cn> > > Use kmemdup() helper instead of open-coding to > simplify the code. > > Signed-off-by: Chen Haonan <chen.haonan2@zte.com.cn> > Reviewed-by: Yang Guang <yang.guang5@zte.com.cn> Applied to drm-misc-next, thanks! > --- > drivers/gpu/drm/nouveau/nvif/outp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c b/drivers/gpu/drm/nouveau/nvif/outp.c > index 5d3190c05250..6daeb7f0b09b 100644 > --- a/drivers/gpu/drm/nouveau/nvif/outp.c > +++ b/drivers/gpu/drm/nouveau/nvif/outp.c > @@ -452,13 +452,12 @@ nvif_outp_edid_get(struct nvif_outp *outp, u8 **pedid) > if (ret) > goto done; > > - *pedid = kmalloc(args->size, GFP_KERNEL); > + *pedid = kmemdup(args->data, args->size, GFP_KERNEL); > if (!*pedid) { > ret = -ENOMEM; > goto done; > } > > - memcpy(*pedid, args->data, args->size); > ret = args->size; > done: > kfree(args);
diff --git a/drivers/gpu/drm/nouveau/nvif/outp.c b/drivers/gpu/drm/nouveau/nvif/outp.c index 5d3190c05250..6daeb7f0b09b 100644 --- a/drivers/gpu/drm/nouveau/nvif/outp.c +++ b/drivers/gpu/drm/nouveau/nvif/outp.c @@ -452,13 +452,12 @@ nvif_outp_edid_get(struct nvif_outp *outp, u8 **pedid) if (ret) goto done; - *pedid = kmalloc(args->size, GFP_KERNEL); + *pedid = kmemdup(args->data, args->size, GFP_KERNEL); if (!*pedid) { ret = -ENOMEM; goto done; } - memcpy(*pedid, args->data, args->size); ret = args->size; done: kfree(args);