Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp366738lqj; Sun, 2 Jun 2024 02:03:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjFHPNqUH3tDkx61BregqtCv8cwUZxzFR1O0WVr+egdkwdnGSVioZ4oc8c0eYDE2HBQJ7/IU6j1k9HZKFR1CbUspPBDa7czaPc0O6tnw== X-Google-Smtp-Source: AGHT+IHE5EttYfDoCUSMEHExny2HucDX5gMN8OSIV1qxaBb2rW0tEMTp+ZfcTnMG1g4l+bOvuKaC X-Received: by 2002:a05:620a:4495:b0:790:9823:190b with SMTP id af79cd13be357-794f5c66962mr803647685a.16.1717318984856; Sun, 02 Jun 2024 02:03:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717318984; cv=pass; d=google.com; s=arc-20160816; b=ni/zMvseU40U++zUoiSyCiae0aVe9XjTCkHEyADv36aDxGyibc8C1JmUcK9OOGnu2G wP2aL0utn6mE/tNWggSQW4EShBf05pfooQPXY3KWCzuFDPxgHoQEDFLkrd7PgY4Z5VIx sbNYkXV9gtUGnQtLjXUk89umnrY9+zHQiJBD0COmf6X8VCHiM5JITVXScfCVnVXvNGK1 uSI+GDQiGzkHxketQaqkuLPU1xydgngYGSRSmlXAEhRxVLdskQFUhyZ7pK2mQC1gD3wH FDCKq91ttkHJCUMEoQY6PcvM6DEzA5AyHJk0vEMIt4nXSGdODB2+zaS8Iewi2y7jt5AH 2QWA== 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=d+lj9jEW3+1WmijsW6oDadXhxUFJI/P2189/L37fCLE=; fh=ylN4Cd/TA9dGdExcoE5MwVGhf5DZLuARle8+eOkYbzw=; b=amnwcbPv6Ho2S7rmLnyaf5IQrvK6pVd4a2DYw7s6IqRXQITqqzPUMfa8VgPlVmqlVm AIOi6rfkDYxdNABEcRKTnTMVrj/PCl+cYupn6pm/rba9Ca9Z2LbdPtuzc0mMi/TApIt/ /yQktO4c4HiouIYTm93Yr752R58aa+We/q1dmiyEhs6PIHqC1eg1wdC4z3FNKEt5ZRjk VuxTp9sWxk0J3c+mGo2AJHtWXtf7ZyA9WtY7pkFeHUsOO6hw8rAIW61ytOWyR6JEtjkA BKNipgC2N+ZABXe0xYZEMSThgM9tCVC5u71sDEvXCb2mK5aWhr0rIkqsqX6X2OUXpVYG /i4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-198166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198166-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 af79cd13be357-794f32a5d9asi595690385a.597.2024.06.02.02.03.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 02:03:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198166-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-198166-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198166-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 8DD4D1C20982 for ; Sun, 2 Jun 2024 09:03:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 927712C69B; Sun, 2 Jun 2024 09:02:54 +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 73ADD219F3 for ; Sun, 2 Jun 2024 09:02:52 +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=1717318974; cv=none; b=Uq39gtnMsg6CnSt3nkExvcked5/Hggz3nCgnrvpZM1tguk7VwDvtrvGJeKa1XTWRwPn/aXP8x+GNZIWItU7dm5+Wz3aP9w4e1HZcOBCUN9melsYNQDfJs4+8JFy86eaZ6IivHm9zYbEGcIu98Be9vdJ9pMOLp3UEE2XVKgxutLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717318974; c=relaxed/simple; bh=ByJ2gn9CXxDqnzfeuHKTYoPy0ArsgzOsDRL+FAHDFKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OEDfX7nZ7Rgmm3VRBlLJFNsyTs7RaXWNOGiGgQ4w1V1NUqoPoDi94m6ETjDl4R4bPC/+Mquup82ysiArNPxTJhzNFQpyQjiWxuGd5ElErXwkIg4O71gYxVZaA6PLMcRtBblXRstkz4dqIfUOQO+lt/75FoK2/POGWXaBxcbHxvU= 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 fgw21.mail.saunalahti.fi (Halon) with ESMTP id e2b70418-20be-11ef-ab01-005056bdd08f; Sun, 02 Jun 2024 12:02:49 +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 1/7] platform/x86: asus-tf103c-dock: Use 2-argument strscpy() Date: Sun, 2 Jun 2024 11:57:54 +0300 Message-ID: <20240602090244.1666360-2-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/asus-tf103c-dock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/asus-tf103c-dock.c b/drivers/platform/x86/asus-tf103c-dock.c index 8f0f87637c5f..b441d8ca72d3 100644 --- a/drivers/platform/x86/asus-tf103c-dock.c +++ b/drivers/platform/x86/asus-tf103c-dock.c @@ -490,7 +490,7 @@ static void tf103c_dock_enable_touchpad(struct tf103c_dock_data *dock) return; } - strscpy(board_info.type, "elan_i2c", I2C_NAME_SIZE); + strscpy(board_info.type, "elan_i2c"); board_info.addr = TF103C_DOCK_TP_ADDR; board_info.dev_name = TF103C_DOCK_DEV_NAME "-tp"; board_info.irq = dock->tp_irq; @@ -795,7 +795,7 @@ static int tf103c_dock_probe(struct i2c_client *client) */ dock->ec_client = client; - strscpy(board_info.type, "tf103c-dock-intr", I2C_NAME_SIZE); + strscpy(board_info.type, "tf103c-dock-intr"); board_info.addr = TF103C_DOCK_INTR_ADDR; board_info.dev_name = TF103C_DOCK_DEV_NAME "-intr"; @@ -803,7 +803,7 @@ static int tf103c_dock_probe(struct i2c_client *client) if (IS_ERR(dock->intr_client)) return dev_err_probe(dev, PTR_ERR(dock->intr_client), "creating intr client\n"); - strscpy(board_info.type, "tf103c-dock-kbd", I2C_NAME_SIZE); + strscpy(board_info.type, "tf103c-dock-kbd"); board_info.addr = TF103C_DOCK_KBD_ADDR; board_info.dev_name = TF103C_DOCK_DEV_NAME "-kbd"; @@ -846,8 +846,8 @@ static int tf103c_dock_probe(struct i2c_client *client) dock->hid->vendor = 0x0b05; /* USB_VENDOR_ID_ASUSTEK */ dock->hid->product = 0x0103; /* From TF-103-C */ dock->hid->version = 0x0100; /* 1.0 */ - strscpy(dock->hid->name, "Asus TF103C Dock Keyboard", sizeof(dock->hid->name)); - strscpy(dock->hid->phys, dev_name(dev), sizeof(dock->hid->phys)); + strscpy(dock->hid->name, "Asus TF103C Dock Keyboard"); + strscpy(dock->hid->phys, dev_name(dev)); ret = hid_add_device(dock->hid); if (ret) -- 2.45.1