From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 570FC2BFC8F for ; Wed, 19 Aug 2026 10:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787134373; cv=none; b=HlOvHq1PGwBceUIzZwE3e2v63QENnHMW3+D3FhJ1DKz9JddTZX1E160wd+RV+Vc2DNzMqqXCaYI2wJ3KTFQGH06iP7rOV491lFrkiK9hCjQoxC/6slc8Xllo2f7ASBHvoolAm1r1U6O5xZIQK8WNpNDqcKDWn+RH9UCUG0fWC0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787134373; c=relaxed/simple; bh=NOhG7s30F1X6yR/hmoaoQ3f/+GC1q/sLlVJU7OGuHUk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LYBxQnBsuNUtRSBjZb9UHlEvSiyst8/Uj03daMOrMB8Cm0dExNP/3qUDsCUhfOl8K0JszrzDTPbbK15BPLRYGYZ3jwleKr9SlLeX5m396NJbefc8MM1Fv4800LsUSS6Svhg8BamJj96+V1eoWsDDFlekAJ8sFkXFPiFIfzyExSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=tNPngA72; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tNPngA72" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-47f96c5b722so463088f8f.0 for ; Wed, 19 Aug 2026 03:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787134370; x=1787739170; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=lwgHvf3IynxhCrFNp6I8hyWkHBVRhkHbA3ZcfkLbFcg=; b=tNPngA72v/+okcpEbSoJtw1735l3aDyekMlXucVK4HhVzt3eymW7KCNeiAkGQZJXRW SfZb6oNqML9CDo2HphXp6UoZ6ddY6WiI9VvduNGLpcIoQ2XFshNb2+xXWIdgK4sQuCHb RXh9FvH/yNeYJWNBk1AGTrSMWA7krGt+Fo5+mhID6ygCqfG4D2fG5eEmLkHHTuZJgG6P azNSShXIUY2bPhj44ZKDxGZA/89Rvw56+MYwT4FbdjLxhEZs8nu9InSu1HxLEo4X6adC BnCj64s1qQmBAPge+fN+QycM05eJCNH0z+9hwhPvsapSjWj0/K8DUxGZSmSdPZjPomON 8vow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787134370; x=1787739170; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lwgHvf3IynxhCrFNp6I8hyWkHBVRhkHbA3ZcfkLbFcg=; b=qzSqEeFIZcNHZf/1YIcUsj/DKSsugMuxYRmFqRmImJSd2BuRLP/hKaK1RlBuKPdsvc k+fxW4mKUhM7TwYCMPGS089EGl/ehKx1naVw5V/jg0H+VDsVSduwfMeeP+3+h/F/ZiS1 DglkFGwbBApEkKLJ8h3FfAJEwvBOwjyf42YqxHpx9y8Abr43BBBFSuugVCNc1Ndp+TmO gx3Ta84Wx0YvDRD5BaHQZXjxtkC3ATxaNwypGRWdrFITa11vwp9w9fNzpbJ6cX8ALQTt CLVqhtchiSdn7ZuGpy/MUXeBut6oJhJXlwBdxpgTFGdVG+BR94tZ8U3Imq7GuV39Vjbx yjsw== X-Forwarded-Encrypted: i=1; AHgh+Rrhq6vVi8DBOho6gFAbx6BRhYJVJi/MLpiwlt8pyTHfSlH2RZtadXNweNON8uA6tRXEbz12HfWGo1McLm8=@vger.kernel.org X-Gm-Message-State: AFuF++ni9SlGHf2YWE9fCNKbsbyr4wTbwFSrMCK0pslnVLzoVuRvALi8 MxVBogtDxYMnMX1fdQjrMpoqL4tegX90ADbfKytNuzbp8GOgpMEqcnGE X-Gm-Gg: AR+sD11/l18NNinEFsTn+ofn9a3QMT4y1KP3NluaPwYCcOW7xl8yP/9yg8aiD1WJ91H hIFx6zpJWZvIFCQvc7uc4/IQVFhIvjy0nWXB7XKtG/m71ooVR4x7+s+rgT7dXVjysDmnw2wCIuS 3K8isEGZRAPGXouPeQ6XLOesIQgmdEzRR47XC4x6pTjgD3f9k7MumwSdBJtHAS5F0mDg4Paso1w 1mm/kAUR8T6qn3isGaNfjZN6R2VKHW+4AhOZIi5ImOfNgCGtxwKtdU2OKkxsRn96cOzCvjRIuz6 BjPMIOkWXTaxWoAt7xOurdvk7HSAoGh3stiEaKMHZ75tGUE3rK4Y/CCOnerBZ+xYpjVTlHOMdbL bjbQGMlSHscJdoCXurpabbMKCfeAuBhlCI1MObzf+ITN9sx+Zqcl6QHF72mEveNhYcnMBW/g5Za gAtRRqhudYfEOQ1cQx9V+gx/POVNu0+qOjoaWLSaKg7ty+ShGa3spcmPcigv7y2e2IYQYHDHjJZ jdhK2PQeU9CgqLvO/aPP2ycCQ== X-Received: by 2002:a05:6000:4b10:b0:47f:97f6:d39a with SMTP id ffacd0b85a97d-482b1fece9emr5929426f8f.17.1787134370291; Wed, 19 Aug 2026 03:12:50 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b14c33a8sm4965975f8f.28.2026.08.19.03.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 03:12:49 -0700 (PDT) Date: Wed, 19 Aug 2026 11:12:48 +0100 From: David Laight To: Alex Deucher Cc: Amin , Alex Deucher , Christian =?UTF-8?B?S8O2bmln?= , David Airlie , Simona Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/amdgpu: Replace deprecated strcpy with strscpy Message-ID: <20260819111248.29286a7c@pumpkin> In-Reply-To: References: <20260818-amdgpu-strcpy-v1-1-3ee9b111fafe@gmail.com> <20260818152113.31b72e30@pumpkin> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 18 Aug 2026 13:56:06 -0400 Alex Deucher wrote: > On Tue, Aug 18, 2026 at 1:51=E2=80=AFPM Amin wro= te: > > > > You raise a fair point about the compile-time truncation check. > > My reasoning follows the kernel's own deprecation guidance, which > > explicitly lists strcpy() as deprecated and names strscpy() as the > > safe replacement: > > > > https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy = =20 >=20 > RIght. My thinking was that strscpy() would be preferred to avoid > static checkers from complaining about strcpy(). Personally I think the guidance (and checkpatch) should be changed. It is pretty easy to change the header files to only allow safe strcpy(). If nothing else that reduces pointless churn that just makes more work for the maintainers. There are plenty of strcpy() and strlcat() calls that are 'not obviously correctly bounded' (and probably some strscpy() ones as well) which are better targets for patches than the ones that are trivially valid. David=20 >=20 > Alex