Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1032496ybi; Wed, 3 Jul 2019 08:23:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwr8yswBUAzptoU07DGXkI/5nXc0QiRTH1Ps3J0yThkvSrPVEl522TXIUgXx5gSML+Wbywr X-Received: by 2002:a63:e001:: with SMTP id e1mr38043129pgh.306.1562167379969; Wed, 03 Jul 2019 08:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562167379; cv=none; d=google.com; s=arc-20160816; b=l5/+qQdicgp/I6mjQsJW98hoIs720v1vuoaRooL9DV3AxnmxNXS2pW5N5f4zM/hEaG VbKnCtdsuv50edJ7GtoVjz2qW6kz5032J8HdFgwP+mkfoChSMUHh6aYgqcCM5npt4Stm 0Hc4hRy3uVVMK6zMaO5J1JaKyh0RblloAwg9TwySHbsxWdnnYDirP/X/fI5eY4kiBEHz P9UIAX2cPDJPU6oxWeJxuvSA+1pAFjYRZvXJkJf00GfqFgyF0vahyHj8uV2+wURt9STE OcOYtwutOkwRMhTg2rW/4Em/JsLuucWEz7ZNpB1x0UGoLwZJYOXnh1WqJ+qY8L73mlYX ehtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JesoS1mGInzbAYCEZ1ZFW+Rbhz8GECHGcwK/QDkb7n0=; b=Sq0BBeSEwGLZ/uHqYcNoaM25ojPQ+pr5+I/XW5KZiVcdCgKwE+GRR7ppapHDoyPmLG T3GYL8M2DjGujbg44SIhaIUBcbPFuL8Psjd9Z00ugKDksPaj/4TxO/Sv03a/zOGj6Dw0 eXQxbW3s5QDUhmPUVjr4LeeAeAeD7/lpSz6q5V6UDX/fMjvbKSDbF67ipOc9PtF+NyRI 2UaR6PwgvDkbj1QehARUlm89v2/m5Q3xwjhyup8kVeW9RD5va2uZBQek0kBMEs0gg0eO 4Qavkn3jlg6NzgTssxMx4fgNELKIqm/56MErogx548vKj6IO0DT2jQWtWNvmBmrJBmda oT9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QycFk9qE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u16si2327087pjb.15.2019.07.03.08.22.44; Wed, 03 Jul 2019 08:22:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QycFk9qE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbfGCPVh (ORCPT + 99 others); Wed, 3 Jul 2019 11:21:37 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:34572 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbfGCPVg (ORCPT ); Wed, 3 Jul 2019 11:21:36 -0400 Received: by mail-oi1-f196.google.com with SMTP id l12so2418335oil.1 for ; Wed, 03 Jul 2019 08:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JesoS1mGInzbAYCEZ1ZFW+Rbhz8GECHGcwK/QDkb7n0=; b=QycFk9qEiszh6we8thUlzD6zFB8gI520mJUHuWfYDStkL+HHILFwF4PslL5KGv/tsT 4ewlbeh2Us4mBWyJtIemdCLicH0jeVkpTFHjby+9eUQHYRPSPbYLDS6RicbekMz7TOsX Zbed+XA+ai3uF6vWEQtIwgIfusyhUPC1KHZ4avQp0+P5BwzUIrUt/kj5ifGQP1ERoOka M2rfmKEwlkfCdcQ8+7DpVaplFcPMCg4aBiC0gEd2LxkH1tan3nhIZUuPSZ3tZE9iw4lx t3URjW0RYdhqn/9XQHj5UI0EgTfVJfBHRZrOroutA2w0Asp6q/D16MlKZI4SHyVzR7la l0pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JesoS1mGInzbAYCEZ1ZFW+Rbhz8GECHGcwK/QDkb7n0=; b=SHtgGWL1TOA93ByyCZRzEm81Sh7CITzaTpL3R5RR027wGuhaVyNHx/DHzmxCGHvS6a UfgC6zDIyaBj1FQDEG2Dj9li1OOpNqn1og600iakSOhzXNGvY+XModNrdVnsvewggo1L h4o5qCdBV5jvPYS623yYM2AtQWkMAhxPS4cyQlO8L3kmq+txDjrmudfQcvUYLpHU7d50 5SDBeE+H1vIKHTfwgR/Vys9hBUyUM2knbYAJa8JGSMffDACnSRYeLV6qyzmrT66ODKaK MpVMf5kuo8yckGLHYXm+4SdhgKDlUloTLUvd5IC/pFrCF3Jgfg+jo5RpiU8meeKy0WqN 0ohA== X-Gm-Message-State: APjAAAUjgcYwweV6NzxxOZ2VKs8+4qkmEib1Ls94xKeUfAeVtAmVLl8R QCqi9VFUPbe1XSOYQH2ON8LMrkej1ecaxWLYeqw= X-Received: by 2002:aca:5241:: with SMTP id g62mr7061129oib.41.1562167296244; Wed, 03 Jul 2019 08:21:36 -0700 (PDT) MIME-Version: 1.0 References: <20190703131414.24947-1-huangfq.daxian@gmail.com> In-Reply-To: <20190703131414.24947-1-huangfq.daxian@gmail.com> From: Emil Velikov Date: Wed, 3 Jul 2019 16:21:45 +0100 Message-ID: Subject: Re: [PATCH 06/30] drm/amdgpu: Use kmemdup rather than duplicating its implementation To: Fuqian Huang Cc: David Zhou , David Airlie , "Linux-Kernel@Vger. Kernel. Org" , amd-gfx mailing list , Leo Li , ML dri-devel , Daniel Vetter , Alex Deucher , Harry Wentland , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Jul 2019 at 14:15, Fuqian Huang wrote: > > kmemdup is introduced to duplicate a region of memory in a neat way. > Rather than kmalloc/kzalloc + memset, which the programmer needs to > write the size twice (sometimes lead to mistakes), kmemdup improves > readability, leads to smaller code and also reduce the chances of mistakes. > Suggestion to use kmemdup rather than using kmalloc/kzalloc + memset. > > Signed-off-by: Fuqian Huang Fuqian please add reviewed-by and other tags when sending new revisions. Fwiw the patch is: Reviewed-by: Emil Velikov -Emil