From patchwork Fri Jul 21 14:57:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 123911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp271264vqg; Fri, 21 Jul 2023 08:09:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlFf5dD+ip7pxuijh1akO2eoih6noxDFIc8gCDZVRgATr2V7ERsDEdFXPLV3A6FiWK7o+Whs X-Received: by 2002:a17:903:32c6:b0:1b5:5a5f:368a with SMTP id i6-20020a17090332c600b001b55a5f368amr4520974plr.27.1689952166852; Fri, 21 Jul 2023 08:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689952166; cv=none; d=google.com; s=arc-20160816; b=tJdqMa4b0PRiJRsoHxc5cbEcavrbRIK8WRmTvWB7fxtRYV9sUOT/ePFfPZQNi6jc/B wIIfvjn8GqL86x0qRbPL5iPXXdlxVHixB6AxRQe1PJsShmxaVfH08hEdQmmt6qfP59Be +427HIerc0OkloMz+z43H5xBJkS0P3c5mg//MgbwBWIRdkHhWjVMjdILcNcy7kmOlxVS 7WJ2UpOaEIDrZdlb9SYmwl9Zce0Gjf7c02h3A2KBRNImjdyhmtmME9yCCvmoGwfGzyfJ UYjDEM0NsUp1yvVXsZR+QaKnRvFxn3QBZINKwSkS2SI9kkhXqfRe938zJN1EMzovla+i 3fUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=f2neACeDJ1+U5hIJSVUczEa3DOnNyGY7zXGD+yxpeF8=; fh=dULtXulU1fZsQ2TLLbkfk+jPlwseaQT703Ct4vpllVY=; b=0mDjFLV++6kO0DSmPDHKdxcLZwwMDzSAQmXY9MEPLlefLv3fNsw+0K3/wYIhg/zS5O 3yxBMujq/33NxKP+a8AwcCtXs7HSoIeEU0runt40Af/zhvjBX2pJoeSJxBmVyKrcUwro N8GuyYWIK66pgGtNnYwbWBjWBQzfbbBh9FT6NKvXHshI78BwcIMlbCG9QoucstScOePz NZSh3R7tCRVkRAqboTaWJAs8/eJ2kExtXg1ydaKQt+um1Jysqz7bniX1OIQOHsZLdeVk f9jSa3idFC+V0f+WNhCnL2s9GYL6vh/9lYMmzyd/l9zqVcXt4QD7UNy5Oo6yWQpk81gb dM/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QzPiB2fu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a170902d58b00b001b7fa4d1a7esi3209612plh.507.2023.07.21.08.09.06; Fri, 21 Jul 2023 08:09:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QzPiB2fu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231415AbjGUO5N (ORCPT + 99 others); Fri, 21 Jul 2023 10:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbjGUO5L (ORCPT ); Fri, 21 Jul 2023 10:57:11 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C14134 for ; Fri, 21 Jul 2023 07:57:10 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fbea14700bso16923045e9.3 for ; Fri, 21 Jul 2023 07:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689951428; x=1690556228; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=f2neACeDJ1+U5hIJSVUczEa3DOnNyGY7zXGD+yxpeF8=; b=QzPiB2fuOh3QbLglcuzUYmvpmwOadloHNR7KNKK4YP99C1z0LBvNqNC4tejkfjEbwF iQ9wuiCxVxESyxtmOyPi4jyorV8tlAaH95aMiogz4/TGd0yYFwvf3dqKpPow5DgOQEE3 xb4cXBZoaP1waE/hWOoJPs8VS30z7Kor+mIoP1OpwyZsN31Dc8xVYSUwRNCD6tU76LiB sbxezuv/I5ZEjFuanb8Ek+cconJ5Rj0IrnmJqV+XeZZBZ3SdvUgYcDQUKLRcavSzXB6v C528YcUr3YO+1axe9o+kY7r7HGVLsu7rNnkbZjlo9kmX4w+DAvIzWAswnTKbgGi3y4Q+ mqTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689951428; x=1690556228; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f2neACeDJ1+U5hIJSVUczEa3DOnNyGY7zXGD+yxpeF8=; b=Zm7EO8u0hUKYrVZYvXRt/+AovsnZdMuBNR8mRsW5DpJFMmxKXlRfGUMzl2/ge0swyJ SBhFPNJx+kvyI5O2mkghxL5VDCX+RcLjL4TM25qdrSxQTkoxhvTBNS7BsMEs6BdYPc24 gtUrCcYNVpEiYs2c5U+ptBW8rJQTXsMfJ5C00eu4kGiLvE+rLLcp7v6DctM3v9IZgQxG F6CsHm0sTzGGxHlwx7qlphEQvrmyHc7la3VdQ7XcJDW87cGn60pwxRMPOQvHqlzs2pjP TyTfcvviZPAM+zT3nHEzWWWvsgY6zF23nbwhDJo4tuoy22qCdUe4R+PiVYIur5n1v5Cm Pl9Q== X-Gm-Message-State: ABy/qLZhVZsomnJzmKnZ+/vI5YOfDhacrNoJx1nmOuhvOGHkHnIUNxwH nSjYeyE6TD1pGHLDaIvSRJpOHw== X-Received: by 2002:a1c:7903:0:b0:3fb:ab7d:ad95 with SMTP id l3-20020a1c7903000000b003fbab7dad95mr1608352wme.4.1689951428639; Fri, 21 Jul 2023 07:57:08 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id e19-20020a05600c219300b003fbe791a0e8sm3469484wme.0.2023.07.21.07.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 07:57:06 -0700 (PDT) Date: Fri, 21 Jul 2023 17:57:00 +0300 From: Dan Carpenter To: Michal Hocko Cc: Andy Shevchenko , Andrew Morton , Stephen Rothwell , Mel Gorman , Vlastimil Babka , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] lib/string_helpers: Use passed in GFP_ flags Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772043283170115382 X-GMAIL-MSGID: 1772043283170115382 This patch doesn't affect runtime because all the callers pass GFP_KERNEL as the allocation flags. However, it should use the passed in "gfp" as the allocation flags. Fixes: 0ee931c4e31a ("mm: treewide: remove GFP_TEMPORARY allocation flag") Signed-off-by: Dan Carpenter Reviewed-by: Andy Shevchenko --- lib/string_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/string_helpers.c b/lib/string_helpers.c index d3b1dd718daf..be517c25737d 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -668,7 +668,7 @@ char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp) char *buffer, *quoted; int i, res; - buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); + buffer = kmalloc(PAGE_SIZE, gfp); if (!buffer) return NULL; @@ -704,7 +704,7 @@ char *kstrdup_quotable_file(struct file *file, gfp_t gfp) return kstrdup("", gfp); /* We add 11 spaces for ' (deleted)' to be appended */ - temp = kmalloc(PATH_MAX + 11, GFP_KERNEL); + temp = kmalloc(PATH_MAX + 11, gfp); if (!temp) return kstrdup("", gfp);