From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (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 DD9FF10F2 for ; Wed, 29 Apr 2026 00:09:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777421398; cv=none; b=pLBcUQl6s2sPmHzUe6hRWgjGE+9FybJ6TSq6ORtaaTkZb7Snnyf0w55ncPPp+NC41BIHRgZjHxo/Caql9HFHKVr5CduV6N9rsCva+UjbDeKpIoh+RD8/OFWHiRbfkg4NwIGgCkU2lXIkxHtBpiRrXDyjbj6vyLyMq2rT85mx01k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777421398; c=relaxed/simple; bh=wBx1gEenKfxKKqnwuj9z6C22cXLDH2L9nyWxpSmJ4qQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Klk9vfuaFO1ze8K31ZPyCNn+zdy4VGtQBEzx0N4ruJsagn4ZYiQDQjGSA74Gp2qJvR+er2X0CrRudKszxW4/ZAmLj51ZrMbiXWF6zlUgItqTOnYL/ooe1zaOk2SunSdDO4ticf6QsFv5SlKycO/vKZv8jQvkIL/zjq8/PfCHPqI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=GpIwgbrf; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="GpIwgbrf" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1777421393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qbGgsDXQy1uJaxlLF13L4Y00zGfUaKp1xpotlYqQnMY=; b=GpIwgbrfw8Zy0UOprpc592UkuXjFO9hKsga8XhY5Nywf2GBmpilZvtn5WrTkmQDYsv4S5D sFJKCq/ZW5CdOau9temPzF5sFXBvhK70SsdsqRjUHxm8cpAzPyJj8xhwP0YoMGyiw3t8O6 ZM5L0yzYg8EKEY1X/DfUoYOWUSdGc8k= From: Thorsten Blum To: Parthiban Veerasooran , Christian Gromm Cc: Thorsten Blum , linux-kernel@vger.kernel.org Subject: [PATCH] most: replace snprintf("%s") with strscpy in audio_probe_channel Date: Wed, 29 Apr 2026 02:08:59 +0200 Message-ID: <20260429000858.1442-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1172; i=thorsten.blum@linux.dev; h=from:subject; bh=wBx1gEenKfxKKqnwuj9z6C22cXLDH2L9nyWxpSmJ4qQ=; b=owGbwMvMwCUWt7pQ4caZUj3G02pJDJkffaQEWmPmz4x/e+Hb70rZ7B2rL/PHz4vLS322X0Vc/ Nu2h7UrO0pZGMS4GGTFFFkezPoxw7e0pnKTScROmDmsTCBDGLg4BWAi4nyMDKsKBGOOHu2LXLzJ L53lzmd168neXxi7Lk7S/nbnU1FB+lNGhq4ZT89fu8Rj9PPdjTttTzJuFlfL2r8vuP246uWt+gP 8yxgB X-Developer-Key: i=thorsten.blum@linux.dev; a=openpgp; fpr=1D60735E8AEF3BE473B69D84733678FD8DFEEAD4 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Replace snprintf("%s") with the faster and more direct strscpy(). Signed-off-by: Thorsten Blum --- drivers/most/most_snd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/most/most_snd.c b/drivers/most/most_snd.c index 68b9e6c64033..dc366813c31e 100644 --- a/drivers/most/most_snd.c +++ b/drivers/most/most_snd.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -554,10 +555,8 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id, sizeof(*channel), &adpt->card); if (ret < 0) goto err_free_adpt; - snprintf(adpt->card->driver, sizeof(adpt->card->driver), - "%s", DRIVER_NAME); - snprintf(adpt->card->shortname, sizeof(adpt->card->shortname), - "Microchip INIC"); + strscpy(adpt->card->driver, DRIVER_NAME); + strscpy(adpt->card->shortname, "Microchip INIC"); snprintf(adpt->card->longname, sizeof(adpt->card->longname), "%s at %s", adpt->card->shortname, iface->description); skip_adpt_alloc: