Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp461080lqj; Sun, 2 Jun 2024 06:37:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHIS6ly7wNLzv5jolSxbARZLzLaj/ldlYhhVgFN3EKGAtA4BoU9NHyXZJn2jRzC93BgyIlIMK1/g//Vt/cJJfWx79/X8OvzXzuPACllw== X-Google-Smtp-Source: AGHT+IF0HBHfl4XA7TZCZha8wWUXqeRgj2IsOqdxD4qhdJYho0GFB8l8vA0ZI5XHs1Enz3AxNCj3 X-Received: by 2002:a50:d5d3:0:b0:57a:24a5:2cb6 with SMTP id 4fb4d7f45d1cf-57a3639b0aamr4181027a12.20.1717335470413; Sun, 02 Jun 2024 06:37:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717335470; cv=pass; d=google.com; s=arc-20160816; b=vqzwrgms+7k1B8LUhTMLYv+IDVdUmaG4chO2axLlSivcDLhd8+rDZAdH9VDnQgB3Uw kaXifoCc7mw7uVTzOd3yyq89GjAal7lLpmt8cn2VsD/ecZDF9UnFoM+Kw+SBOqbtcKz2 A7VKuMPa6Q0TlJx6CUb1ab5rHqMavSGJcnJfMH7qOIWPcG580EYvzJXSVOJR0FKf/pOt GoW3HtEHLsEAgr9GweR/lKdSM8xDEMRtDajkG4dgCufL8q1G6RFXe3biNGct8y6bZH04 2qqpHvNHIyKnzkhLcQ8vm7HMKwmJ6rzCjuZztn+Ah0crqs9hSAqB/TM1VqKJ44P5OfdU OFDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=J2ksBBz/iMsKyhAoghBunV+ULI0bAygLRPzhwkwvJZ0=; fh=+IUAKz2BXcDbz9K6ynmaDotgS1kD8nEUpxdGW7RhxNM=; b=KV6vMIdRYN9D1Osw5SFpPldxF0px6Ny66wpgZYfKoh+tiuTNDlvTrYFt2ju4jUI57K 76vj3okCtuyBM0wNew1S0RABjERGZb08duTiJnpLX894MGLaTm4+nRcDsFT1GwcT/IiW 544mtnB6ECXgMtmhNc8hQIO+I6t3LbrpFCpIZF2LEn0UV7YbcLJ1uCkJO8bdFv3l9Giy /6OepCkp3f2ZfRgMV9xUt70kp3gT5PTG1fy1CgqQiZvGUQNiNZejD+YBqa2IPvJIUC67 /I+SUfrrfaV/FjvQmy0ozK4lVKHR6rNU3BVum8Zm8YviVcRpJ5VKu6k6RPhwjD5f9Yrh TGNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HSzQpaTI; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-198262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31c75c18si3138748a12.372.2024.06.02.06.37.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 06:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HSzQpaTI; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-198262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 am.mirrors.kernel.org (Postfix) with ESMTPS id DFB211F22AFD for ; Sun, 2 Jun 2024 13:28:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 848CA3D984; Sun, 2 Jun 2024 13:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HSzQpaTI" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 5052D3CF6A for ; Sun, 2 Jun 2024 13:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717334913; cv=none; b=eLarfahycT+Oy2F2ZItKoQ1AUqB8WP3RAmo1rXKTTSizLfiLxq6qDo2DX0h03Mp8NWqokh6eOtKOToDVYyfralQjdyKLkaBao4tWCvT7wFEnKFtpWTkDlGOajDca9hPGlqBDi61HeEtBcAjDYsDdWlFoSB7tJWetAGfB3CLJ7PY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717334913; c=relaxed/simple; bh=4WEGq0wnmtmqbryUA1AHkiQ/vM79/+d90mIdL3BCwXI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WTf1s32MfD3WKtwFJ9eYbfN0+JNekjhiXiZzwWhBc/XZPCCwFNjqs+Xf3wxEDKZKhNL+sn2E00f4PpwxwLR+o8oNc5lBL5VGpKy0P5HOvP6vHbZ0cZ9BvV0XhLi0DnEHXIb4PFnrjMPP3+0e4rcJPQsxCWattwLkwbYJoxGS+Rg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=HSzQpaTI; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717334909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J2ksBBz/iMsKyhAoghBunV+ULI0bAygLRPzhwkwvJZ0=; b=HSzQpaTI66I3JK5eK1G4YH+2dJ88l1aHRjorT/CKuVcsLO73zLUAmU4myywADS/b5Nhvfp Oyt8EbVpE4AMJBrPrj1Khf1cMDitXB2dLUhS9EyV8BQe+a5Mb39Y40MCMT9//mPKcFw/pk FANk1Q6hD9SzzOvCHRgjo6goPk5Zc+Q= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-daWaiZHNOe6xMUlM8dVt5w-1; Sun, 02 Jun 2024 09:28:21 -0400 X-MC-Unique: daWaiZHNOe6xMUlM8dVt5w-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-52b98e99f0eso247774e87.1 for ; Sun, 02 Jun 2024 06:28:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717334900; x=1717939700; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J2ksBBz/iMsKyhAoghBunV+ULI0bAygLRPzhwkwvJZ0=; b=oIIyXg6D362+d5pzRlYSYFCFksXUmsIGfrX2wGLJX0yR86V0Z/1k4L8Q9Px/6lxodI I/1OXR/FN0Y2RkozMd0LYPaeLPCk/rvzdDv8fFRNyxo3Udj6PtBVfxyM/uT0vhqygYwq Crr0HG7Bmxkhn2XewrPERtqnpRgqwDlbUHapghRiN8715RBN0ps81/zFsd5tQtuEu3FB mJbLHOkFW20Cwu8w2tmJHtkXA0txHfoOtF8MyoP+6e9NhwYaFDTtCXcO37O3QEzG60Du S/lFyYQn9+WQ2xP2WUBk76AYZ7/wRhxPcDRsPLnw00jENTokUuesAfVbuaalNNpK0P6T b4/g== X-Forwarded-Encrypted: i=1; AJvYcCX/S++915l/T2lLVleawX4X+5esOSlOpkcrNoiN4Xjirg225UH+F/c+gSVEmHfA8v3YMbXj7mQ9jSrklcfKBucgGp4DJZi5owLPMIZT X-Gm-Message-State: AOJu0YwoOQHnhgfoKlyiKajzKgX5ONJBqWx6gQ5qgrzY7EkLHKckKqWE bmlQVCIppkyWQRPXQLTNKiTQ1/oAO887B03CtlDPDttNMNCIqxSMIf4ui4YWxpe4oZEani9CA9K qKacDaeHSDq4kJEThGTHBHU4STQgJOy3cfZBxxqO7TXUltE2KDCq9L/My8hUEaQ== X-Received: by 2002:a05:6512:5d0:b0:52a:e529:16bd with SMTP id 2adb3069b0e04-52b896cd4eamr4094241e87.58.1717334899845; Sun, 02 Jun 2024 06:28:19 -0700 (PDT) X-Received: by 2002:a05:6512:5d0:b0:52a:e529:16bd with SMTP id 2adb3069b0e04-52b896cd4eamr4094220e87.58.1717334899347; Sun, 02 Jun 2024 06:28:19 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a68ba90e185sm193922566b.157.2024.06.02.06.28.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Jun 2024 06:28:18 -0700 (PDT) Message-ID: Date: Sun, 2 Jun 2024 15:28:17 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/7] platform/x86: asus-tf103c-dock: Use 2-argument strscpy() To: Andy Shevchenko , Jorge Lopez , Li Zetao , Simon Trimmer , =?UTF-8?Q?Ilpo_J=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 References: <20240602090244.1666360-1-andy.shevchenko@gmail.com> <20240602090244.1666360-2-andy.shevchenko@gmail.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: <20240602090244.1666360-2-andy.shevchenko@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 6/2/24 10:57 AM, Andy Shevchenko wrote: > 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 Thanks, the entire series looks good to me: Reviewed-by: Hans de Goede for the series. Regards, Hans > --- > 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)