From nobody Sat Oct 4 04:57:35 2025 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (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 DF33724339D for ; Wed, 20 Aug 2025 10:22:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755685332; cv=none; b=d/zk/5uY99qDBfbqLoLHyogRcFuOhR44Lt0GvuFLjjy4/MaW/Ya/hhbG2WNL03eO95BK62Ybfs6eZjxHLz9jiGlkovEQTdwRuysgLmKZml0ONC4ujCMxQtLv0qRAfLqnqOvYpifNvV0+5jsxWlEWd0r0+Oz6JNXZOSJi7RyOdSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755685332; c=relaxed/simple; bh=yPmx2NpBFo/eQiaZItuCSTDGjoPBXIBBgjdLKtn25ks=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T9WhXs5HdOj6cSzBjddelRrUf9MRiY0pVzkgBwl004vXSWplh4pzVu+TKSFtBNN2ibYm1DXnSljLJhgD8P8Ggej2ibnkbak2cxP3RINWQnpi6U0VtbttobMpapEsigqDsdSjgLk+0Vwsoaf2FBiPIbc/VFaweDbyehq28BmHky4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=GKUD28Sd; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="GKUD28Sd" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1755685317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=v1LgTQHA3Xhf/L11p5n5Wj5Gb0sAQMkBeBHPrqYHHMk=; b=GKUD28SdH7tZnCYITZ7dAjfgQ/NJhfPXbPhoZ0lyVgFro/MgASXLI91gcJwHhNYuklJj56 6unNyZMaYhvJm+sF5EdqmpO38Ec7CTvug2Jc84wB6LcNk1qRoANcUphg6VT2ODvQ/hJpUy yX3kj6wzWNV6PV9bHRfw1Vnf7FZnkx0= From: Thorsten Blum To: Arnd Bergmann , Greg Kroah-Hartman Cc: Thorsten Blum , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dw-xdata: Use str_write_read() in dw_xdata_start() and dw_xdata_perf() Date: Wed, 20 Aug 2025 12:21:09 +0200 Message-ID: <20250820102108.760382-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Remove hard-coded strings by using the str_write_read() helper function and silence the following two Coccinelle/coccicheck warnings reported by string_choices.cocci: opportunity for str_write_read(write) opportunity for str_write_read(write) Signed-off-by: Thorsten Blum --- drivers/misc/dw-xdata-pcie.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/misc/dw-xdata-pcie.c b/drivers/misc/dw-xdata-pcie.c index efd0ca8cc925..a604c0e9c038 100644 --- a/drivers/misc/dw-xdata-pcie.c +++ b/drivers/misc/dw-xdata-pcie.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 #define DW_XDATA_DRIVER_NAME "dw-xdata-pcie" =20 @@ -132,7 +133,7 @@ static void dw_xdata_start(struct dw_xdata *dw, bool wr= ite) =20 if (!(status & STATUS_DONE)) dev_dbg(dev, "xData: started %s direction\n", - write ? "write" : "read"); + str_write_read(write)); } =20 static void dw_xdata_perf_meas(struct dw_xdata *dw, u64 *data, bool write) @@ -195,7 +196,7 @@ static void dw_xdata_perf(struct dw_xdata *dw, u64 *rat= e, bool write) mutex_unlock(&dw->mutex); =20 dev_dbg(dev, "xData: time=3D%llu us, %s=3D%llu MB/s\n", - diff, write ? "write" : "read", *rate); + diff, str_write_read(write), *rate); } =20 static struct dw_xdata *misc_dev_to_dw(struct miscdevice *misc_dev) --=20 2.50.1