From patchwork Sun Aug 4 12:33:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 816624 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 F0ED91173F; Sun, 4 Aug 2024 12:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774846; cv=none; b=II5duCcQAbSGVvkEv97EzJGEH9qjDINSiEk/8fRooKt0lLMl8iou8bbuWwl/5J05MHjUsKyONSuM2RugRG0bYZrcxGCvuFd46lF1bcIT+1OCQ6jk/VnqWU/H1n7wXjDT4YJMuecQtcrxwmS06coBf+vFevtLTPTTFR5vtdQPu/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774846; c=relaxed/simple; bh=HqeHXTDOpEhcioM90KBchuXbkgy525Kf/FJQOe/xfx0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Y+UkXwFlI5tNmQj4x5UI5FMzBUbKbkheunIP6oXkvM5ZyWe4IfzcWPhSP6Le6gAjJakOi45xWLkYZ+p21XVNHBVUtlPAWV6M2sdxmNok+cKB96JezG6/r19/5JtkuXRnzvdnV9qrBqH5ZUJqqcmXrRN1bbRh0Wwa4nsMDi5jeGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lAy1vNNb; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lAy1vNNb" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4281ca54fd3so57098085e9.2; Sun, 04 Aug 2024 05:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774843; x=1723379643; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kr58f6AmwLbjxDpVLr7kHM2iTNAugPK3C/ukaZbQdnY=; b=lAy1vNNbaxYYDSYxP8GS3htpiZmtzC/IWPexXhxwh1UZrDJ2ZI0icnFatzfDIQLish 6HwlHS4ietQFAei4dX6Gq7RxefSGYIAruMEZZ1PPgFy1CpYdw1wHgQJtQ4aVkYRnbdi+ gF1jIwn0qBmkujWgIk5KliBZe8HDwUU4jc5/5dXcZJMYa/gDe4dtwBC7/rqTcYnf2PO5 GxB1+8xuioqvDlCdz/imdK1tUnJtSjlOqPdsuJ7z78CQNI+/+8+gantFlB5Ix4Szz4gc wTwKlFtnR5NLfegMGOncJ+ioxcr8tfwQMM0AWfRaLDzc/hIitqMQGNQRwKXBRQskQoEk yjXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774843; x=1723379643; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kr58f6AmwLbjxDpVLr7kHM2iTNAugPK3C/ukaZbQdnY=; b=qZLJYwxKWMYvHwYkR0LUfP+k0p1uHcsV/BQ4sCUqUM27tOGIyZM4KaDsny8UePItGS OFjnXg8LhRFOVziPjS9SZkc0h8p1sDs/DIqurj4CqcEQkSkTqWW0BGy8PPLooXN1QwtC 27MxMsIO7vZsb9YG78O6L9mQfy/COhW5UOwmqoVpBKo3+uD/zOGEQckv1AnpzyYVthQ2 3iy6oDQ2Fm2bWAIOUfTiwcdVbIUQp2iU58toakg3Uq/wXGQkNLfKx1RESGONPWc4q1jn IQApdMAahxV/7RA15ukwjgn4vw638QeofMxi9FlL6OU1hjtP35aipvbLsFE36b9XMEkN DTDA== X-Forwarded-Encrypted: i=1; AJvYcCWXUmOqMkghrZhbayo6G+eiyoLQJzArMdMO3wj1NHqDdScnB3Owwlr0KtAl68pWsT1hfeWjqEsKp02R2i2FBOpIpUhS152VUdp97VXaU8g4rasbL01FoiBCoLXSXTa/qA3FimehiKEqsQ== X-Gm-Message-State: AOJu0YzvKGthjQvADhj1UVcNgx4kq2kubM9+mxkCDSk810rY55wmdvdx JiuHLu3uNzX7d0v20bI9S3trId9/GlZhKwYJgwVEhdwA7jO6BrR3StT/Yj2q X-Google-Smtp-Source: AGHT+IH1azsyuBrUH0O94a/m9BCfpDMnEgDfOZiA/1irY8pGXu1KPWQ8ahvgdLzK0qXdNtsFUCJdhA== X-Received: by 2002:a05:600c:1ca9:b0:426:6f81:d235 with SMTP id 5b1f17b1804b1-428e6b037f1mr61214945e9.15.1722774842984; Sun, 04 Aug 2024 05:34:02 -0700 (PDT) Received: from qamajeed.Home ([39.45.131.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e88f833asm92848145e9.47.2024.08.04.05.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 05:34:02 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH v2 1/6] ACPI: ac: Use strscpy() instead of strcpy(). Date: Sun, 4 Aug 2024 17:33:08 +0500 Message-Id: <20240804123313.16211-1-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI ac driver. strcpy() has been deprecated because it is generally unsafe, so help to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/ac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 09a87fa222c7..ad1427a384e4 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -213,8 +213,8 @@ static int acpi_ac_probe(struct platform_device *pdev) return -ENOMEM; ac->device = adev; - strcpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME); - strcpy(acpi_device_class(adev), ACPI_AC_CLASS); + strscpy(acpi_device_name(adev), ACPI_AC_DEVICE_NAME); + strscpy(acpi_device_class(adev), ACPI_AC_CLASS); platform_set_drvdata(pdev, ac); From patchwork Sun Aug 4 12:33:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 816818 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 6183980B; Sun, 4 Aug 2024 12:34:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774860; cv=none; b=JNHrZoIOJmg5SK2c7SZTzpkmWijtMpbnX7YQQSR03Ymetic/sL2el5LOLaWjTlySGvIb+Zg3lK6KrVmAjpP5FDwKVfAm6n16xsZ5AquzKf3bf1bH5dWk+8L4nNlmCYQ8EWPQXB0NKUD5ET+AvIvikfld3Kw2aGraWKnpeoVHK60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774860; c=relaxed/simple; bh=qKrV7gMBJYdctQasGKyPGOySWCilXjwbToZF2hb5yfI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Cxr0xrvjs/Rgx1+ITliJw+jgrz2lyEFzulqP5D7JT+LrYxgW6cBU7eSD/wcEfyvDUEjmGDI2tVr6Eh0ZiVug1oqOyM4vi2msAB+DpaSpNiGITed6EG/ALk1qpmd6SsfDUHrbWNeHNwL10Avzm7SsVjXq01iTV3i+ciunexz6814= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kDzxx7bn; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kDzxx7bn" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-42816ca782dso64565905e9.2; Sun, 04 Aug 2024 05:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774857; x=1723379657; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fma4zyxhIgdDMLW4SBzIssnydwDrG667PvqCwFWkyjI=; b=kDzxx7bnA8ebI2YZWRBE0tf3X5LPstIr9n6zRBADGUYCbbTM6HeB7j8ylkrLNNZss4 Fa4iwFZR4qFwH2B5yA+u+ql8R4iHcqkjp3AtFm297YR7qc93Gypg5GTcvhD1BfbbiPQl BY0i+C126FKQeJhO46IoQ4x2boo2IDeUfDmRri0vH0AYilLLquXDYgTHrp/CMZV0tPbo WAcDv/8XJxtRLMeKKz5WClKLGmTc1eUem9BM0MDFSFKeIzLGEyEzZovS1ZIyJVraEtPO JH/EQ4sDocsv2jLE5gNLLPjmAkMtHqxnXhiB29lQjlWkudS5pamQj3CwjWe24Bkt+Cxf b+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774857; x=1723379657; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fma4zyxhIgdDMLW4SBzIssnydwDrG667PvqCwFWkyjI=; b=T3ChvaHPnuT8f6xX9iCOhgUYyzLoNhn9xc3vOAdgoy2cw9ZHOx+P7efqao7M9AZM6z rp2SpZ+RMrXdfzvFTqztTxc+0Muo3tW5V3qlOKJBo0JZOrIAk30E5lXUw1pSlU2NhNjU axlbAO+U6OgwB6cbsdqHWYuoxg0dX2eGifQhsgh3AMS2Bs86X5OT2tA//bK7LSe9VKkn /uzImz7ahXKXYdshPjdVk//wJMYykLFxpfThGDuIQHYAG7QS7J4sHIeIuH5EDZIqUCiQ /FjPr96RWb0Q+lMtiQf/700b2qahkIbPPg+ilj5uJDOvpEZnUdQK+kFE065KYa/DZnT4 h5rw== X-Forwarded-Encrypted: i=1; AJvYcCVB2TPHoK936pI2V5PR/Cwx+3A9v/eisoxgtqdjIKmD+OGtIxD8eC9I6LjREArNxh24iFYOwuChU0jyC6bFd7YGzfWpSKu0qpoWuX9S6Loq5M1LaeWwvNVtyBIOFeFot3SeO7j5lGZLsQ== X-Gm-Message-State: AOJu0Yz0mwqJb5Y2OxiiyCI7mChQKwwBwBcbZgPtzyPTv+Z8nqCRh0SD CZ2DufobwziurTtxzRQynP1ipFsgOPtSRlUXOi9N2pTQuLzonKtm X-Google-Smtp-Source: AGHT+IHTZ9obbVnBYeOOZXkEHxu4lhjAf6KVmLWiieaUMPqYkGv9pryQnxIOCyzxoVj+0nXSKRW55w== X-Received: by 2002:a05:600c:3c82:b0:426:6220:cb57 with SMTP id 5b1f17b1804b1-428e6b7c53bmr51782105e9.25.1722774856774; Sun, 04 Aug 2024 05:34:16 -0700 (PDT) Received: from qamajeed.Home ([39.45.131.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e88f833asm92848145e9.47.2024.08.04.05.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 05:34:16 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH v2 2/6] ACPI: acpi_pad: Use strscpy instead of strcpy. Date: Sun, 4 Aug 2024 17:33:09 +0500 Message-Id: <20240804123313.16211-2-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240804123313.16211-1-qasim.majeed20@gmail.com> References: <20240804123313.16211-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI acpi_pad driver. strcpy() has been deprecated because it is generally unsafe, so help to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/acpi_pad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index bd1ad07f0290..e49f89bbeacf 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -417,8 +417,8 @@ static int acpi_pad_probe(struct platform_device *pdev) struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); acpi_status status; - strcpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME); - strcpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS); + strscpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME); + strscpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS); status = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY, acpi_pad_notify, adev); From patchwork Sun Aug 4 12:33:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 816623 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 AFBEC3BB47; Sun, 4 Aug 2024 12:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774864; cv=none; b=gI9yTZWHlL3gj1bMjF1RgNBIESM7ZXcUUj0ctoKMeRrhJ42Qx6h3vAVKFJgRi2Dtb0VufrG71L925QiPFKsMx/mPrLsTCMkcIL4BSmTd0hgtvPhXikcU37pUijIVUK3ZwypYsOYlWDokvYBTRACvo/m4Ry4LAxgaQuWDuY+hNE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774864; c=relaxed/simple; bh=N+ucF3kD6h2ejO88EwEDCCGNA0WUdAxEbTxcjhQVl8w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rURvZi2kHsA65w5DGJa3dlW/nT8S1eRxyBflvqu8ZuiZmEOFqX8RCu6xHD7ecnZSqNNQ9EwfCB+EDd+1NMC5qL1JZR5xAMGOUOEoroLrxnOjt5jPAFIBqAcfxAzcuAwpiCGKEA0IiL61WdmBd98kC9kgGqbxfJ6X1jjmg7KD8lo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HYfnkNt6; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HYfnkNt6" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-426526d30aaso64095495e9.0; Sun, 04 Aug 2024 05:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774861; x=1723379661; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vdlZpOag27f0gMB82jj2VY18Tsb1Bo/ztoizSX32Pcc=; b=HYfnkNt6UrxQlgYUiIaMnQXZpL8AIB2uEQJOdHPo8kIiyJcqEG3VFljRw4gWXAo2qB EcvOE2100/QldlSdfHNeg/7jyQj/xWPZcZP5ignarqK4eNhGydlc6IRQ5DqpeDuUm/6P +vtO/vs8hHw9zqDCO2Jx40BjRPwKveqF8gvEOXh6uRBbtABwmDUC5jjzhHHpbMtpgRoz NwYHNwK1Xajrh6XrxcG5JISi7JaeKzp33i12XJaq6yDrxwYjImBAcGKu7zayoohbHhxs TodtEVfYe2D6p5mDtpwY7P4LrQLZSmDdZ7inb3TW9Uv8Fz5LTNbOBSjxjOi2pDJkmpQH bqQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774861; x=1723379661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vdlZpOag27f0gMB82jj2VY18Tsb1Bo/ztoizSX32Pcc=; b=Ba9XsHo0fraHIDxcKyZ6BX+Ifz2UslSrWYguU/48IZIpUTJe9gasHCBz9YHRYAgVoX 9hNf0ThrJ7Me488xzxVIkPUKDEc+3EExlnN4UMGPmZOitn0avibaKOF7nJ2DW/WL+wxF j+pnnt/SG+4YfWh2yiYpic+C7qPB8MKuYqb1oXkj3RB0uMd4l0c2L+gmwMFtF/S60sEv OvudnJdv8QWtfwGMdDmNqM8oXe4di83YueJeCnxxf0o6vUkquUtGhUJCbsjVlRHPRVOn ViGevTmkc5JO6GZJeBjj35HianukhxMcEcJyzx4ZAkmV248jJhZNM0hfoFrZDkJb5XJE qWTw== X-Forwarded-Encrypted: i=1; AJvYcCW7rbAsdUpJZV8TyHbrP2nIhElajrxFFXYG2/7HGLhllJcFnGhasEgpNziL0pUAEk2deCsspaDBewOD2eacIGihdKbfeM36XXjfbrV6qpWU6jwqCSTMhOowDMa8NMRP8DwQlcZOY6muyw== X-Gm-Message-State: AOJu0Ywohml7u5LQB/fwRfbR8L6BACb/0O670WcWYCarI3iIrUxottbs oZ/z9vcow8L7cngQuWZ6vFIdNnWvCXrOv+yVJX/7yymk/nOdn8nT2oErkYoO X-Google-Smtp-Source: AGHT+IGwYB276FSsAH7KK/f1NzmK2qi/ac7oWkLJ+FAbU7mC5RPSlglmSoThm6zdsD+8mRlLVVkiTw== X-Received: by 2002:a05:600c:35c2:b0:427:9dad:17df with SMTP id 5b1f17b1804b1-428e6b07b0dmr54482985e9.12.1722774860906; Sun, 04 Aug 2024 05:34:20 -0700 (PDT) Received: from qamajeed.Home ([39.45.131.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e88f833asm92848145e9.47.2024.08.04.05.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 05:34:20 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH v2 3/6] ACPI: acpi_processor: Use strscpy instead of strcpy. Date: Sun, 4 Aug 2024 17:33:10 +0500 Message-Id: <20240804123313.16211-3-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240804123313.16211-1-qasim.majeed20@gmail.com> References: <20240804123313.16211-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI acpi_processor driver. strcpy() has been deprecated because it is generally unsafe, so help to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/acpi_processor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 7a0dd35d62c9..8a8826a2242d 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -394,8 +394,8 @@ static int acpi_processor_add(struct acpi_device *device, } pr->handle = device->handle; - strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); + strscpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); device->driver_data = pr; result = acpi_processor_get_info(device); From patchwork Sun Aug 4 12:33:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 816817 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 E34033A29F; Sun, 4 Aug 2024 12:34:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774866; cv=none; b=ffWyLGuyVHu1/1pJbzKqw+OvK7K8/iDkKaLra7wNxImeFS8uwlPwSl4uMsX4HHImSA+YgF+xUj1s8+/5zla5jciiTag/e+oSWcLqZ5A625fVh0o1rDd5AvfbEzyOCK6ZRFE6bVchPOayqO+LTGi52N2Kr0azjugWAE+ksknSYiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774866; c=relaxed/simple; bh=4wTO45loOxiBgXMX1TvpFAFqq7lkEMFODS2enoTLO/Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XMAVFGKwFr1UKeM3iZLI5YxN3drj2MvnGf5MfuGnATPt1hgMxu2Yb7AzYF/Jqnz657Ssee92lsNgrxp9OcW/TMwXJA/WcvuxvXrkKTdjZtPLQpdoZOpvC/g2WSn50S+P35pNRBUQ7PTDY+7GGdg0t2lYeS1FcYY6I2em3aHOxYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BMi/xiVI; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BMi/xiVI" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-428f5c0833bso1560695e9.0; Sun, 04 Aug 2024 05:34:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774863; x=1723379663; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c74qx6U4WqhaZ6AZfBeapjqYbEWUeFmagdvk1F1/Pww=; b=BMi/xiVI3sNKYJtCTIFVXP4SJIj9sNHuRCVRelCXVGBTRqYpZY2fJnLc/2cClZGZfz gZmAwIOXaHTlMy+90KstHgVdcyjebH6uST1LjEBiCXfxeq9NkVqPkvW57HptH1+NB1K7 /kiyQ7ul1I7GiqcllYDlkY3q3KJEpzJALe+DYtGIKYuDq6DfZ5E78iQpXUKOlT5YxvIZ DzSfw17KXoFuFRycVINyh9KL1OePVz8Xl0q23xbPJTq6rAhV1xvLqnhybEAoJCwqY3yH cy5BDg0jo9VXg/ckgb9OZXdwVtEwolSiG2LDtdwH9/BiYi1UernF8PY2uEKvUftabZMS LOCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774863; x=1723379663; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c74qx6U4WqhaZ6AZfBeapjqYbEWUeFmagdvk1F1/Pww=; b=fSmb0jpXLeJUqu2TavO7nE8T7iBeuXYdyiF6y1Sg9Z4Eb4m3Wblc48znEEmpWACUIe EZJVKh75TpRkf4EawG6Vc/YZcjdjaTvDThVpdUdQ2CM4U1+TCOn1uVgbbWQ6x0hNqImB emFUAekUcAGWFxFzl91ALo3zGLB3TEth128DgyUOIRPv9VyGD3HsI3PGAqaMXO8txKQ9 jPxzARU1IV8dMNAP5oGQUsXSiy1K7+pA0Rt+T7dPMvYyxZdLOxrCEpWtRQcBDdpKF5BR 8iYwJf3dxSS1ZN3UNi5ho5YRsn+TbjmCXzpayOsujpK5/2SFk4oWCd1SPNTXHpWDbkgS 5UWA== X-Forwarded-Encrypted: i=1; AJvYcCWEX2hxuz/++B6gHR7RwL0vLN1UD5Bob7tilPpQWPtDTCrFJ6LljP1mxyeUCfj9JjSN6xjXHe/LVtC2z98+t7AYbiqxCTEU1VVlcmVdTWgb3NRSfIF0KgFnFyYYRDhEBVmRaVkTAcyjcw== X-Gm-Message-State: AOJu0YxdiFBsfGaOmc1fe/GMaPUSeiu6zBIMFcClQJGikF+Jfqyd/jQ9 59VXQ9K3oGxrzzSfoaFNYNZiwSMDWROGM/rJmVdpdnGTHD4VXgmJ X-Google-Smtp-Source: AGHT+IHBW0cXyNQc0tmZKtrcJnCuEFTA7+Dz9GzYh3Xci1Otyby5VeLxyTuNwV0G1B1oKPCaqwUV3g== X-Received: by 2002:a7b:c5c7:0:b0:427:ee01:ebf0 with SMTP id 5b1f17b1804b1-428e4714cfemr88500745e9.8.1722774862903; Sun, 04 Aug 2024 05:34:22 -0700 (PDT) Received: from qamajeed.Home ([39.45.131.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e88f833asm92848145e9.47.2024.08.04.05.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 05:34:22 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH v2 4/6] ACPI: battery : Use strscpy instead of strcpy. Date: Sun, 4 Aug 2024 17:33:11 +0500 Message-Id: <20240804123313.16211-4-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240804123313.16211-1-qasim.majeed20@gmail.com> References: <20240804123313.16211-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI battery driver. strcpy() has been deprecated because it is generally unsafe, so help to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index b379401ff1c2..784f9234f1a4 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -1193,8 +1193,8 @@ static int acpi_battery_add(struct acpi_device *device) if (!battery) return -ENOMEM; battery->device = device; - strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); + strscpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); + strscpy(acpi_device_class(device), ACPI_BATTERY_CLASS); device->driver_data = battery; mutex_init(&battery->lock); mutex_init(&battery->sysfs_lock); From patchwork Sun Aug 4 12:33:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 816622 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 D4FAE3F9F9; Sun, 4 Aug 2024 12:34:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774868; cv=none; b=eDTnNqIJGcTQw4tBlnUNdw3hjn/+e0QRthGN3SaNV5TCjy58JS7uzG4YBO9m6LqqZkAqHNst1jXZkwwvSsnvskAfh0wzbvOMSMR7E0cQZhT5UXCN9iRpMTS1GMLAL/McnLqfLJ96KZ8OOm0NxMNcTXHWMcLebreBGuMzwxH2AUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774868; c=relaxed/simple; bh=W2ngqKSyCOG1mTG9P6WSgKZetYNN23C8r1Rh6nEx9zA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=L89BVU+yHaxQe3P1zAAEPFoYedGQ0W1j5RXp9t+gAIq/zJ5bdiB7bx1fkI5/axzAFEyljG+dnwCkVkMzpCZJuOjQLIby6SwvhCBfmwTq6t+DSC3oQgxO1ubmahX749ICkWJb5K069EuyGl0+xWqMUMm4PrU1sknssI8Z4gYm8GM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=disfXSyt; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="disfXSyt" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-42816ca782dso64566345e9.2; Sun, 04 Aug 2024 05:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774865; x=1723379665; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t7fZ7uG8Iwuauo+1YRuo4GmTVYFDs1MFOasO4TGiyX4=; b=disfXSytMY9WeQu+BRl4k28n76MWHTZ3iBuHNkvqNL/nAySV3cJcbBP5srUiyoB16h FigQt5fiAB26KLmwckGH65HTEoro9rHRyOL8nUrTtpUybi3AqyN3nNgtJpReQ+0w7XD7 Kp59GfBSGTod4TvoVnUvQ78M5CmeiSxp9rmKsHSADf/v8v63ZF3EaJdSxNwTfaLWHQmV iU5VMS873fVWPIsK++TUlTjQxDwQRP9jV8GErlX5TZxWfEFmbLwyuh6AztEqf5BYQeOd FCAcx5oH4GgrEIkLVuHPABzz977j6fee0oaDUfXYn82vfi0O+3N4ASxAsYaNiKxkshB4 O5uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774865; x=1723379665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t7fZ7uG8Iwuauo+1YRuo4GmTVYFDs1MFOasO4TGiyX4=; b=NH4UW5Dn/DV4BlPXnURNI/XPOKZG1VG3BFCN1xJy/KxZgDq2L0QAw9PPX2reAHkm8O 29ogsdpOELjm4TXr6cwJzdmwwnnoq3hh+E3R1N3LLOxt7RbNISH7MTKbYzHHXZ/cB3WT baIRh494QyX8R1diXCxRufXyUEt2kEo2Q3iIRalv/4GLdyuFbPRt6Z4/ra1mNXL7fko6 XRYGNnqiDy/s1xseWpyjZJZrGZR6c9hlkKJD15RWngYxBLgBdduwZ86TSneeXTSS5Vsu GqtQqcWeZt9aIE1BHd5SqHoyNbC3fWwbKlswgCq9ddEPQ3+kFnh18Nl+xqXGsOFXv9no gyQA== X-Forwarded-Encrypted: i=1; AJvYcCUZI8E8mcxU9WlRcPGtyh7kMjNtD7nCdFQEoV6omMS++v4WBopN8lfk8gG7MfMfb/evOoH1dc0USat0actFIESYzmT4ATk1Qie/YQC39ttGMpaA/fvETg46NShECjzIiv0Qnh8MTydkNQ== X-Gm-Message-State: AOJu0Yx2I3kCwnBkFqPRT3vo+HBUDLum64pmMNAV55fGmIRQF5jxdDj8 eIKp5rgbhwvuYWrl5qMmbfAQHtOhsANMAlK8I2zEOiM0aFYwcQtaRMnWgxKE X-Google-Smtp-Source: AGHT+IFeHDGSA+QAyafS2TtVU1J/1Dkb2Gia83aSlBRyZ3jVJqe+9leIlLY+hrkaEuBU5R1qWCwRDQ== X-Received: by 2002:a05:600c:3d14:b0:428:6f4:57ff with SMTP id 5b1f17b1804b1-428e6b93fc0mr47288355e9.35.1722774864927; Sun, 04 Aug 2024 05:34:24 -0700 (PDT) Received: from qamajeed.Home ([39.45.131.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e88f833asm92848145e9.47.2024.08.04.05.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 05:34:24 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH v2 5/6] ACPI: button: Use strscpy instead of strcpy. Date: Sun, 4 Aug 2024 17:33:12 +0500 Message-Id: <20240804123313.16211-5-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240804123313.16211-1-qasim.majeed20@gmail.com> References: <20240804123313.16211-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Replace strcpy() with strscpy() in the ACPI button driver. strcpy() has been deprecated because it is generally unsafe, so help to eliminate it from the kernel source. Link: https://github.com/KSPP/linux/issues/88 Signed-off-by: Muhammad Qasim Abdul Majeed --- drivers/acpi/button.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index cc61020756be..9dda4a3998f8 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -521,7 +521,7 @@ static int acpi_button_add(struct acpi_device *device) struct input_dev *input; const char *hid = acpi_device_hid(device); acpi_status status; - char *name, *class; + char *class; int error = 0; if (!strcmp(hid, ACPI_BUTTON_HID_LID) && @@ -540,27 +540,26 @@ static int acpi_button_add(struct acpi_device *device) goto err_free_button; } - name = acpi_device_name(device); class = acpi_device_class(device); if (!strcmp(hid, ACPI_BUTTON_HID_POWER) || !strcmp(hid, ACPI_BUTTON_HID_POWERF)) { button->type = ACPI_BUTTON_TYPE_POWER; handler = acpi_button_notify; - strcpy(name, ACPI_BUTTON_DEVICE_NAME_POWER); + strscpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_POWER); sprintf(class, "%s/%s", ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER); } else if (!strcmp(hid, ACPI_BUTTON_HID_SLEEP) || !strcmp(hid, ACPI_BUTTON_HID_SLEEPF)) { button->type = ACPI_BUTTON_TYPE_SLEEP; handler = acpi_button_notify; - strcpy(name, ACPI_BUTTON_DEVICE_NAME_SLEEP); + strscpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_SLEEP); sprintf(class, "%s/%s", ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP); } else if (!strcmp(hid, ACPI_BUTTON_HID_LID)) { button->type = ACPI_BUTTON_TYPE_LID; handler = acpi_lid_notify; - strcpy(name, ACPI_BUTTON_DEVICE_NAME_LID); + strscpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_LID); sprintf(class, "%s/%s", ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID); input->open = acpi_lid_input_open; @@ -579,7 +578,7 @@ static int acpi_button_add(struct acpi_device *device) snprintf(button->phys, sizeof(button->phys), "%s/button/input0", hid); - input->name = name; + input->name = acpi_device_name(device); input->phys = button->phys; input->id.bustype = BUS_HOST; input->id.product = button->type; @@ -636,7 +635,7 @@ static int acpi_button_add(struct acpi_device *device) } device_init_wakeup(&device->dev, true); - pr_info("%s [%s]\n", name, acpi_device_bid(device)); + pr_info("%s [%s]\n", input->name, acpi_device_bid(device)); return 0; err_input_unregister: From patchwork Sun Aug 4 12:33:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Qasim Abdul Majeed X-Patchwork-Id: 816816 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 44B7F48CE0; Sun, 4 Aug 2024 12:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774870; cv=none; b=uEsiYlBzZc8y4ER8CnZ/T1JQSUwdfPeSinF+w4s7d0VbaB6wfgpWI7aM4PJmJI7xILPSto0rK/0xQA7wX9I8GwwpCRk0g4BLWovqnOCNNne66vzxyYC39xuvEvHe4ndI7JxLkqWToi05Hlf7XhdBwKb/rW8RugYAchPUVfsPucI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722774870; c=relaxed/simple; bh=Zqu6IN3uMtGrOXHt38sgoQIzQsR4MLchASujTxmZM1I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N86HVmQ8CUA+vk1H5VnBmy4bYlbWUTntfPlOPIg+zU6K/oWOVCcpwBeUbO3kOGF0uFU800rGHmFYiYIoOFGcxFt7DZ+hLhCU1qBmfdKQ3tg0NaQN5eB5Mfn6UbVgi2AcK5Y67Lu0gDrDbJOq+LhBmPryewogT9Md4WAAF7Qldig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=htybqFKm; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="htybqFKm" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2f025b94e07so121804131fa.0; Sun, 04 Aug 2024 05:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722774867; x=1723379667; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CcOqHeXbaXwSJzQv6OvP4E1IqsOv4RTjOEMViMUcM4E=; b=htybqFKm6kIDwXqcf9OR4JMokv1h9vRKDtkvCisnq5WwjxuCgp4Jo3wbskfg1JH8rx 5Z2pIGuAIPj38HFD+uMPqJSepXMJiSVekC66/Rucaq+6Q1Vux6ZNpXhIi4405COU9XaG qW5nSnYFQ4NCU76PtPwc200XiTuzJ5M6HGo0BXN/XTIlDQDBRmdgpIjKwM5tYILJ8NRN Z6hpuxPn+PQh/kY69kf1jKLWsACdyF/eHMpHYmSyJfpk6oXGG3eTnzgy6bbxDq5KCXxi egUKq5QRQ3m78y54hfNV5KNddjC6VDdO6LoEWjMOED/fITWVIa4Kdk4E+Kydr+FF2qRV dy5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722774867; x=1723379667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CcOqHeXbaXwSJzQv6OvP4E1IqsOv4RTjOEMViMUcM4E=; b=jdwlAODYS7OLUg+jtCDP0NLx2w/ZLNyYLDrkoU/IUJwat3uTFdJbaStUgFsyCAx+Py 9O5ZEMVd2HKhTF/7SHO5oNS/rmNjg60f/i1HMhcuVHzihcoCti2G/IfgkWHYMbSSjbro OqYHBJ+FJ0Jaofw5eGZOqLdBUKqmrlsssOBHNrs+PQXCvD+mMdzpExV9WxvY0IddObBq 2iH2l+GW3BQAbastQP4jvOpEyuLmDSeJowLZTIky33tiIA5wi7xErxOKPV6SakL7d6Hu UwQmSe2OpiGP5poGB2Hf6CP4YD46Jz3roW4Jb12LL+G7WsvID+oxE4fk85dxvoRCNBy1 9BXA== X-Forwarded-Encrypted: i=1; AJvYcCWpWf6tZpcuIEGvCfS7+N04uuqq4ytDEhHASe85+y+4G1U8Rh3MtPtLiW4W9v4zq4lugzannimm7ELMnJQDKf/yvmawCS5gWX8P6XFnssCJd0KlddwfpBjr8N29QfbrUsFBbOqkWApBNw== X-Gm-Message-State: AOJu0YxZYGw7+5P1YhhyyLA5op+Lx5pZvqb40S3wMMPr+7gtaWw1JB2r vo7NDmAhjA/sN91yckfrhuUKPWDY812FRaCnKLgPgJUOZmck3k0r X-Google-Smtp-Source: AGHT+IHLzciFjdyduAWE/0WOIXimmZVuerYCXVbtqRo/hW/vpwW76RfH4CTO1DiUPdjbohR+Qs1y9g== X-Received: by 2002:a2e:9d47:0:b0:2ef:2c62:f058 with SMTP id 38308e7fff4ca-2f15ab03fd7mr58788201fa.39.1722774866941; Sun, 04 Aug 2024 05:34:26 -0700 (PDT) Received: from qamajeed.Home ([39.45.131.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428e88f833asm92848145e9.47.2024.08.04.05.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 05:34:26 -0700 (PDT) From: Muhammad Qasim Abdul Majeed To: rafael@kernel.org, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Muhammad Qasim Abdul Majeed Subject: [PATCH v2 6/6] ACPI: bus: Define and use a macro for device and class name length. Date: Sun, 4 Aug 2024 17:33:13 +0500 Message-Id: <20240804123313.16211-6-qasim.majeed20@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240804123313.16211-1-qasim.majeed20@gmail.com> References: <20240804123313.16211-1-qasim.majeed20@gmail.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Muhammad Qasim Abdul Majeed --- include/acpi/acpi_bus.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 1a4dfd7a1c4a..74ed1170fe66 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -226,11 +226,12 @@ struct acpi_device_dir { #define acpi_device_dir(d) ((d)->dir.entry) /* Plug and Play */ - +#define MAX_ACPI_DEVICE_NAME_LEN 40 +#define MAX_ACPI_CLASS_NAME_LEN 20 typedef char acpi_bus_id[8]; typedef u64 acpi_bus_address; -typedef char acpi_device_name[40]; -typedef char acpi_device_class[20]; +typedef char acpi_device_name[MAX_ACPI_DEVICE_NAME_LEN]; +typedef char acpi_device_class[MAX_ACPI_CLASS_NAME_LEN]; struct acpi_hardware_id { struct list_head list;