Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp235219rdh; Mon, 18 Dec 2023 18:20:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKGiJBJ2tD+MEMKfWE2bGMqUNyBZNq8AaVfafpNrPHeOUv2/EjZlQFF6GPvqdGcEHKY1KR X-Received: by 2002:a2e:80cf:0:b0:2cc:6ff0:a690 with SMTP id r15-20020a2e80cf000000b002cc6ff0a690mr1152751ljg.20.1702952407358; Mon, 18 Dec 2023 18:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702952407; cv=none; d=google.com; s=arc-20160816; b=Otjj+GH7FFS1nC0xEtld1UHG8o48XEjz9OGuyP2APmQiLS1ehcu+EpUlhB9YbNtmty YtdzOesfzIfwKZoKwS0uQXF4O/1YQuMGOcYfWByV81ZoMbRLQnjOIOFhGQZyxyukUxMJ rNLttKQ3ZvoQL/l7X+60eZ4m5wJUeOXqejylJ/ELQFbgRNAKukCvAKn0EcCeVX1frzfI 7HjHd2c3Yy1KABYv8WVL4l6CU5XlMfDCnBvEwcuwQySsYCylogbh0pzMrgq1IZcoAwVN kUovEZVXqSI4Avvf0II3hn4f8C0ZrPxXMQnZLal8t5IUcHapw5jkQ772rTDKAKpk5yX/ 245A== ARC-Message-Signature: i=1; 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:dkim-signature; bh=OQDM0B40P70QPcL6XBur2Jg9WhefsXBhpyrJKEmGblg=; fh=9ySyJJtnwCb1HzmO3DsNU+crD/Mh5DxgjrAEmhkaIh4=; b=f28lo05P2LL5aFp/Aha6klbQB8V9T5vvSfsDZhURX5kTMUruTi3HNCbJVGDZa8kbSU zZBGxQ5npvXILCqNEcNT4+R3BKMgVAY+kRL+PlgNFtVDz201jbuV6X6Dgpzq2BR7y6F7 5b2JSav7bYwwX+tFP6QGJ1DyKg9Yh1itH6rHHRssTKsobpDD+HZgQ1t/YRjVGRa4ji2u i44+ADPfo4PARbw4w7EyQnftnnl/ekiEmL1ZMYNiFVREBD29itJc9R2rCp1+0eQ/JvFd WBziiOuQ9pZJC2F8v7AXRKBUNj2/6qNOiFanFeUDRrYrUyRkxql9sf/xWJow7yevksWX Op0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=PvbFtVRM; spf=pass (google.com: domain of linux-kernel+bounces-4586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.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 dg8-20020a0564021d0800b0055345da52b5si1453604edb.253.2023.12.18.18.20.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 18:20:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4586-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=@oracle.com header.s=corp-2023-11-20 header.b=PvbFtVRM; spf=pass (google.com: domain of linux-kernel+bounces-4586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.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 1574C1F24828 for ; Tue, 19 Dec 2023 02:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D31C8474; Tue, 19 Dec 2023 02:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="PvbFtVRM" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (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 EE1B45253; Tue, 19 Dec 2023 02:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BJ0ItNq024921; Tue, 19 Dec 2023 02:19:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2023-11-20; bh=OQDM0B40P70QPcL6XBur2Jg9WhefsXBhpyrJKEmGblg=; b=PvbFtVRMSS4CbqW/yv2CGx+uGwoaJz1MMwmIYgfc7Ue1ZrhawopFlrWH1P8CXhh36uWY W9iO+vdyFx4rDfYYujB6vNUj+1NUgPKwK3mIMQwi/Jejbgz/57rscyYDrtJ6+3rQN+NV PbUZb66b7pRP0n8iyukkNY4QiT+ttdZnl9DBmnmElEgCwJ5Bp41ESu0JUO67/wtf4Xqc HJg0mVBBBKl32Ro4TMqiPG4/fE5haAxbBOUFYiVIzQykfMfnsPFmucdc81ySLxhVMGdD rEgDMUSXNJzk9ytjYZ+qjVxvWZ1mgypYnlbBfLEiJhDhnI3KHa2rug6GIPz1yANM0mIs Tg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3v12p44un9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Dec 2023 02:19:12 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3BJ1k9v8020935; Tue, 19 Dec 2023 02:19:11 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3v12b69t76-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Dec 2023 02:19:11 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BJ2J7Z9012682; Tue, 19 Dec 2023 02:19:11 GMT Received: from ca-mkp2.ca.oracle.com.com (mpeterse-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.251.135]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3v12b69t3t-4; Tue, 19 Dec 2023 02:19:11 +0000 From: "Martin K. Petersen" To: Hannes Reinecke , "James E.J. Bottomley" , Bart Van Assche , Justin Stitt Cc: "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode Date: Mon, 18 Dec 2023 21:18:48 -0500 Message-ID: <170294822166.2675590.301399188654325708.b4-ty@oracle.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231212-strncpy-drivers-scsi-fcoe-fcoe_sysfs-c-v2-1-1f2d6b2fc409@google.com> References: <20231212-strncpy-drivers-scsi-fcoe-fcoe_sysfs-c-v2-1-1f2d6b2fc409@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-18_15,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312190017 X-Proofpoint-GUID: Tkj1uZp2qXkZ3E1TAzz3YUYkkT_vGBTd X-Proofpoint-ORIG-GUID: Tkj1uZp2qXkZ3E1TAzz3YUYkkT_vGBTd On Tue, 12 Dec 2023 23:19:06 +0000, Justin Stitt wrote: > Instead of copying @buf into a new buffer and carefully managing its > newline/null-terminating status, we can just use sysfs_match_string() > as it uses sysfs_streq() internally which handles newline/null-term: > > | /** > | * sysfs_streq - return true if strings are equal, modulo trailing newline > | * @s1: one string > | * @s2: another string > | * > | * This routine returns true iff two strings are equal, treating both > | * NUL and newline-then-NUL as equivalent string terminations. It's > | * geared for use with sysfs input strings, which generally terminate > | * with newlines but are compared against values without newlines. > | */ > | bool sysfs_streq(const char *s1, const char *s2) > | ... > > [...] Applied to 6.8/scsi-queue, thanks! [1/1] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode https://git.kernel.org/mkp/scsi/c/edc22a7c8688 -- Martin K. Petersen Oracle Linux Engineering