Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3609573ybi; Mon, 29 Jul 2019 09:25:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5PaedkJ+8R3v9EcXKn9qgLOx6KkQ2fQFndMawjGXxA2Q9Q4Zzf3mo6KM0aONroMplT2Nz X-Received: by 2002:a65:6709:: with SMTP id u9mr77074751pgf.58.1564417517748; Mon, 29 Jul 2019 09:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564417517; cv=none; d=google.com; s=arc-20160816; b=Y5+8QaKDEAVNlrPrORfs79UoU4Hooe5NdRAbTn9YxU3K44WAeLUtRPa2hrlpPXXVUM wYkhWJ/x11pSBH/g6gWS8+V1a1wE95Vt3TzEPwE8aSjJrXLzPmkPCPqX7rb05o8gk3v0 aTOPVpGrY9hreKksRmRdqAfb87aUTxFWNopZaNjXquWwWgx4+jeAEmsi+s0S06pTc7nN 0/aRNLIsRZ6UQXlVNBWHny+OpIlOiPCZzINoxAJCoJXuSZy2qr0KF4BEaZNEolYKCksj JCj1opWaDGSbQWkemGpPPtYx+lSuhp0ra4022EpRNu+MBTCg+Sv/WGA8GtQn7BBsKJIe dOlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=ID3S8AXMaqtPd62+34tqU+I1K0sOrkCK8bonK/JaG1E=; b=y6i9vFWJsgw+nWcECoSsKCcasIAElduL5N8reuRUMfDgzQ3H8Q38X8IJ99zntoQVs/ oHcmjBGoSu/w2+n0NiAMV9jZkl2hA6qHfrBkP+OsuDL18k9+Jfl3hi1MQXAno+B2o/tm 9J3Qd2YJuIGr0NuUpQtBYeOtnArRyiCDERF2MJH0GnKfh4KPOK5+ya/E0vWFidVplxy9 q5Z8US9ZDOkFPASqd2s+NSz3cLzVq70c1O1zpLU4imlhCfqLAB1S9qEHLTrrPt2SkqQV AiuPw/BpqfpWwOdyNORx2t4lxOlbMTzpPAStdsJQI1V0ACTRINGu+3OS2hWstRK423vS 9PLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bwRQRbSz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si26027763plr.134.2019.07.29.09.24.59; Mon, 29 Jul 2019 09:25:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bwRQRbSz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728733AbfG2POX (ORCPT + 99 others); Mon, 29 Jul 2019 11:14:23 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:40410 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbfG2POW (ORCPT ); Mon, 29 Jul 2019 11:14:22 -0400 Received: by mail-pf1-f196.google.com with SMTP id p184so28187623pfp.7 for ; Mon, 29 Jul 2019 08:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ID3S8AXMaqtPd62+34tqU+I1K0sOrkCK8bonK/JaG1E=; b=bwRQRbSzvwE3OKuWwSi4Minic0ZtZcaBDU7DYRPLNzeTAghIwyhd55QnlibgdAPiHH PDQA/qN+TwhHa/4KNIh6pII9/Qs0PUwS3ctw++P88wFXXLaeFBdVIkH8jP4i15yHF23T 2aSgUFnvF0+mmKhBn0QvmUXHXTf2IJa+6qmvJZzanVsHdrRs0WdXZgaDgdQ1ophmZB0G P4ocTQ3Ld+6ggzTZuSZlvoL45/xvU2ttcOtuWe0Yp0SPfrY65fZZ5uRy1fdKNXFEh+Tt FmT2ZAgxnM03PmaEELkpY45q6+lQkvF3sBPbpHEXU8QvmX9qlahZGIc3csRgDS68qg/D DOWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ID3S8AXMaqtPd62+34tqU+I1K0sOrkCK8bonK/JaG1E=; b=X/eEqBEzeF3TEJmhOKYFvP7aFw94nM9aOV5Oo5fG+2VMleYQxmFg0uYrC080A1H076 /9xr8bZIp+0RK08Uf5cpom3R+i/ELs/dKlmNz0aluwJBYgBZlr75KF5ARpyTlE7ucVk0 MVgHe01VAfg0e7oKhQh/+QY1RP/keIXb9wsLkBwQgU6uJwH4nsUeW44kgw4bHFYZSwq2 oixY3+krtZbcGsOSVp/s6XhGubX9mGvEtidxfZkMaxQFyNFfVmgesjzkBwx6lXNiGago gz9NKVGxzu+8NgBnjdFQIjWKbM9Y0SAmi027NcMMSSAsi0QOJe4C6bxQFYkOR5RwtJLF 98AA== X-Gm-Message-State: APjAAAWa4TocMCuXUGxssB2PimiUbY+jWIY2QLmImLd5rxW7BaVCsQG4 //FLp6sVjplwaaAkYY3hRl8= X-Received: by 2002:a65:6081:: with SMTP id t1mr106125219pgu.9.1564413262031; Mon, 29 Jul 2019 08:14:22 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id a12sm104957041pje.3.2019.07.29.08.14.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 08:14:21 -0700 (PDT) From: Chuhong Yuan Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH 03/12] dma-debug: Replace strncmp with str_has_prefix Date: Mon, 29 Jul 2019 23:14:16 +0800 Message-Id: <20190729151416.9388-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org strncmp(str, const, len) is error-prone. We had better use newly introduced str_has_prefix() instead of it. Signed-off-by: Chuhong Yuan --- kernel/dma/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c index 099002d84f46..0f9e1aba3e1a 100644 --- a/kernel/dma/debug.c +++ b/kernel/dma/debug.c @@ -970,7 +970,7 @@ static __init int dma_debug_cmdline(char *str) if (!str) return -EINVAL; - if (strncmp(str, "off", 3) == 0) { + if (str_has_prefix(str, "off")) { pr_info("debugging disabled on kernel command line\n"); global_disable = true; } -- 2.20.1