Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp366994lqj; Sun, 2 Jun 2024 02:03:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVN+zDjRCK6fgICmT2jzUw80xoMyI8pgCC7er0sggxOupHVuiCIPokCfykNnPPwUMb75N4gd6lDY/48JRWrNO05FelPn9Xsz90Lbf/1jg== X-Google-Smtp-Source: AGHT+IENxYtemIgJNdYFZJYArVudyJkaYgvKeVj9Gm6c0r4/kXlWmm59UpQdhWxi9/hrfISizwj/ X-Received: by 2002:a05:6214:390b:b0:6af:b7dd:7e9c with SMTP id 6a1803df08f44-6afb7dd7fa6mr7995386d6.29.1717319020917; Sun, 02 Jun 2024 02:03:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717319020; cv=pass; d=google.com; s=arc-20160816; b=hfSBvSTeixF+vO2xOTXzbgcjbpgDqkTRbH2BybWPPFJt+TlNzw8p+KNC8ooGKOuXOa YAvVWRozeN0iGjr53620fH37idr/ODRxuz5VBWE9i4PYCCxjaTryDPMNb/RazK+MXHZa hfhy6G/wBMlIzed+ONuhmYXVV8vakfRPgY76x3uSY7SSd/JKGcwGuNnNWVNtszUsbOIN hBiqq7vkTA0yuuO+PIo+h1xqmk4nIEcZgvgS6STg67FXAfMl/CnYqGroXtp++zV0j6Hi vhwOE/hjkU1Sav3rZGoJ4WhJbVWKbM24ducElen7NxzZpc+xpGHGj9B8QWTyikZUjTEv MO/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=QmielfJ+IzdoB+AGQxhscMfjnr8Yi8QOgvWgsqzydnE=; fh=ylN4Cd/TA9dGdExcoE5MwVGhf5DZLuARle8+eOkYbzw=; b=hrAIui3b0WQ4M/LHa5Oe2HPzkk41bk40j4tbg4+HK9+R+hWa6e8OIN/Y/ojQ4DnHuW oIRk54uYS2CaWN17MfE1dPZe1nJA3rdiMWKFmULTWcl9ESepzzNzveD3wy/339Bywamn 8RnFBHCy+qNIXNZfeExtFDn0OTIWoHba+7stUIFSLBac8nvjIB0xGlcenGEgy4xhzTMe /k2Ac8HNOnJ2XB0Qyi9ZrfV+hWZ1JqiqMS+jBeji98I5pV4A1X9AamjKJ5Dwk4DS2UG6 YDx+b5Urhpu0Woh612/booMh9dkaIKCLPI31qsvxhO0YF41JGQFEdXi3brb9D6WcpiWm D8qg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-198168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42d814si61447666d6.542.2024.06.02.02.03.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 02:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-198168-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 5AB2B1C20ADE for ; Sun, 2 Jun 2024 09:03:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 509C1383BF; Sun, 2 Jun 2024 09:02:57 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 3F93B249E5 for ; Sun, 2 Jun 2024 09:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717318976; cv=none; b=HHF5SkOzOFHa2+hnLNaIC2PtLM9UIUI5I6q7jKs7DtozK5zqQwwrXzJh1xb249HLS7jA5+DUY6xPfTpRYt33lCujQYQjWha2L1j3AEtUGxZUbBdM0ZE4itxxtX6MuVjvDEA60M6cr7qBJFHo2v+O4YpIRt4HAHCJImbTUSrAObQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717318976; c=relaxed/simple; bh=A6dVcyj3TpXvLRLkS0fzqxH5DLBjNaIzUh/UVu5B6N0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZE4QKrzdKmJ7k1H3VBTWLKrhhjOlt3mHyoOnyAtt4NgrT1ooE3p83XULNgb1wNOikZX5KLrtf1RXAPALsdWwKuEMS5LCEUHwa5rCcDjZcXbwEH0kSEejjK7lMvkbVzVMYwhDWz9Gdfh/5uyGdfFrkkxxPKsXpNENekxO//M42sk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id e519696a-20be-11ef-8d47-005056bd6ce9; Sun, 02 Jun 2024 12:02:53 +0300 (EEST) From: Andy Shevchenko To: Hans de Goede , Andy Shevchenko , Jorge Lopez , Li Zetao , Simon Trimmer , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Mark Pearson , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-input@vger.kernel.org Cc: Corentin Chary , "Luke D. Jones" , Mark Pearson , Henrique de Moraes Holschuh Subject: [PATCH v1 5/7] platform/x86: think-lmi: Use 2-argument strscpy() Date: Sun, 2 Jun 2024 11:57:58 +0300 Message-ID: <20240602090244.1666360-6-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240602090244.1666360-1-andy.shevchenko@gmail.com> References: <20240602090244.1666360-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use 2-argument strscpy(), which is not only shorter but also provides an additional check that destination buffer is an array. Signed-off-by: Andy Shevchenko --- drivers/platform/x86/think-lmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c index 0f2264bb7577..4cfb53206cb8 100644 --- a/drivers/platform/x86/think-lmi.c +++ b/drivers/platform/x86/think-lmi.c @@ -1508,7 +1508,7 @@ static struct tlmi_pwd_setting *tlmi_create_auth(const char *pwd_type, if (!new_pwd) return NULL; - strscpy(new_pwd->kbdlang, "us", TLMI_LANG_MAXLEN); + strscpy(new_pwd->kbdlang, "us"); new_pwd->encoding = TLMI_ENCODING_ASCII; new_pwd->pwd_type = pwd_type; new_pwd->role = pwd_role; @@ -1582,7 +1582,7 @@ static int tlmi_analyze(void) goto fail_clear_attr; } setting->index = i; - strscpy(setting->display_name, item, TLMI_SETTINGS_MAXLEN); + strscpy(setting->display_name, item); /* If BIOS selections supported, load those */ if (tlmi_priv.can_get_bios_selections) { ret = tlmi_get_bios_selections(setting->display_name, -- 2.45.1