From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 6A2DC38E11D for ; Thu, 26 Feb 2026 07:10:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772089816; cv=none; b=hfNOuaney+Hr8d2aYlMRI6wuh+Y0wvwCSgUHCg7d9jXTsk1gxvcoa6aqEn/tiJCZXNmZxIEZenrwwk7+DdXdOlaYHsSsGQsrummOQ9BwdKz/JkKYdya7Iqw3Kk/YbH15lDFxufDF4dNvoWyoC9einu+MrBE2yC3vdHCpG42iFb8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772089816; c=relaxed/simple; bh=wsqbhwDhZpEMvoda23woLLoHV6EEItTGqnq17uBuaxs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jmUQGn+M3HfIlbolj+Z8Wq3pfCFGBK7gHMjqMHV3Hxk/svC7bhijWMNkadEquDcAhUvsfG3W+EiWR2o2tcd2wZwM6zX6/GclkH7CHG/Pl+aBhv2eo/tEq6kDr75ZOltsQg4jKUhGjKO2QnQLUChrzNiE9wOxTqNqkn4bLjus9c8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tlB3OMhL; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tlB3OMhL" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-483a233819aso5275505e9.3 for ; Wed, 25 Feb 2026 23:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772089814; x=1772694614; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UQCU464whOVs3Bp2v9fOpjBAOwoVO8nIkf2alxRfU50=; b=tlB3OMhLjKorvRAyjuPD0RiiAidj+4M2ADgF5rtnwrOpzJIgGJoAUdMYPV+1FIQlKh HEBlu83Sz9xESHnITI1vvOU/MD8NfppZiqTOI7HQU2kzm3kbRxKbGNB0Z6PIgo9e4+I+ tVPuvIvU3MlStIAyy7hhp1jX+5YIAHnBhQIugJmInNZN0xCCSGrV2PHXN7yHPD8j0Q39 qSLhYYNgKthhKyOEfm7ZqCnDpEwiyIk7Mgh5WAR9FrlGnVRTOIr6wR2UmsoCiFsI8vaO 0vmSMavV/18U0TEx1Fa0DMGD9MfsWrTTYdeBkBgEZJ9Ncy/gv993BJM+S4ckwK2SoWjS npSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772089814; x=1772694614; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UQCU464whOVs3Bp2v9fOpjBAOwoVO8nIkf2alxRfU50=; b=rxr0oUJOhpqpUkMvLTi06jfVXmrM+Hv+BqV5e+GBU5sYuM9VdJ3NjKDlLPGclC/ptI vrCFRQj9EBmnE4c5AmmyNY4c1HjD9td2m9/j7Bvo8oWZZEYyR/P/Bdws6YIbjsgrykxK /XmirDdEL3Sj4gdGiJKaEUFLGEs/sJmSUaP1TshX/sKt1/9NTSWBYzRtx9LOZny45+0+ 0gOqlRdtLzwQIoLId+qjGgle+0e1jAiemk5T+FjJ55OOGQnt+aXrk/wNA4koBifpaGob aQrfEv1WfjdfPeKNxuaRKPPB4327+f/I82JkvvpToiTzov7cyI2WaBVB9JtyM0RQQAAu nsJA== X-Forwarded-Encrypted: i=1; AJvYcCWNZrcIlr2rbdcaUlDOIdnYP2v8hiw7Gcq6VWGBCURK14Vt++//PJicPm9yBz7x0USySgINhx8PnntS56s=@vger.kernel.org X-Gm-Message-State: AOJu0YxkdSpL6/h71s5as88SUFFT4w7QvLujk5nCVfz4TfGZpdYZEySH VACFfk5nT485lmuD28wDJEMP7u1Xk3WW+UHYUv/t+m/RqmGkFHJ9R3CV76nTUUtZMkA= X-Gm-Gg: ATEYQzxlz2odryRJ/fNyOZPDkKVYZCxBv8uJXmsDX6b1Out9l7O9Zsfoj+541VHLFoW +Kp9NOwFbH9l8llMDOxYGvV8hkZThSULWBGAO0GEGOMSms8CPEmTZEGnL3nOy5nhxwQo2u9VRfQ a39musu5C6z7KwFCKiAejA23gbMl46TZHhwB2S+I+Z81dgeH0HJdS2oT7txZaG80uLXSR4Dtxx3 TnVSp2BInHwqDITNALj4OIWRs34b55A3bNBX/z320ifyWVyTRT2zGjsCRtn134uR9fp1l4hqlvL oXlsikV3exa4ZvJWriPPq0bpO1xvhg+sPVnKFADM3t01YXDsX0tncZMf49YTqVzZiS4WPleUu4I NhxvafY7kWTAKCVPiExL2K71Q5Dnijn4F8a67KkAPUg+mb9AjbgyBXsG+kAcfxWbJ1qZpPvStzr VyhSRT1CjyLrrI13nE7HzdtK5KsJ81 X-Received: by 2002:a05:600c:528b:b0:483:afbb:a064 with SMTP id 5b1f17b1804b1-483c3da0545mr19284865e9.1.1772089813433; Wed, 25 Feb 2026 23:10:13 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b841absm26509595e9.13.2026.02.25.23.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 23:10:12 -0800 (PST) Date: Thu, 26 Feb 2026 10:10:09 +0300 From: Dan Carpenter To: tomasz.unger@yahoo.pl Cc: Hans de Goede , Mauro Carvalho Chehab , Greg Kroah-Hartman , Sakari Ailus , Andy Shevchenko , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: atomisp: replace sprintf with strscpy Message-ID: References: <20260225204548.168092-1-tomasz.unger.ref@yahoo.pl> <20260225204548.168092-1-tomasz.unger@yahoo.pl> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260225204548.168092-1-tomasz.unger@yahoo.pl> On Wed, Feb 25, 2026 at 09:45:48PM +0100, tomasz.unger@yahoo.pl wrote: > From: Tomasz Unger > > Replace deprecated sprintf() with strscpy() which is the preferred > kernel API for string copying. strscpy() is safer as it guarantees > null-termination and prevents potential buffer overflows. > Technically sprintf() also guarantees NUL termination. :P When you're writing a commit like this I want the first or second sentence to say "This patch does not affect run-time because sd->name is a 52 character buffer." I would prefer to avoid any talk about "potential buffer overflows." It's the same as me claiming that I am potentially an NBA star. Something like this: I am doing an audit of calls to sprintf(). This code is fine because we are copying 9 characters into a 52 character buffer. But it would be cleaner to use strscpy() instead. > Since sd->name is a fixed-size array, the destination buffer size > is deduced automatically by the kernel-defined strscpy() macro, > so no explicit size parameter is needed. > > Compiled and tested by loading atomisp.ko module successfully. This information should go under the --- cut off line. > > Signed-off-by: Tomasz Unger > --- ^^^ Here. regards, dan carpenter