Message ID | 20230323123704.37983-1-andriy.shevchenko@linux.intel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2888075wrt; Thu, 23 Mar 2023 05:45:34 -0700 (PDT) X-Google-Smtp-Source: AK7set9AnJ6dX/CAMmq63SnU1y5FRgK2Y4DBNeaDDI6edIJc4DyeQ55cf/SEd3a5Go7mTwaHDxB1 X-Received: by 2002:a05:6a20:2a2a:b0:d9:2d4e:c08c with SMTP id e42-20020a056a202a2a00b000d92d4ec08cmr2893762pzh.61.1679575533988; Thu, 23 Mar 2023 05:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679575533; cv=none; d=google.com; s=arc-20160816; b=TN46/6lfs3w9E9dam/8f8Sg2zMqqYs7xA4qTueAUbiCZ0lfq3M3HtTc0NXzPBwZaRs pFt2XznjNx5VhJuEB+jC4nrQltCsuwqCxdsMVWP42BsOrfYFBuFUhpgZfGiCUgEemfFh FKA7GWFsOB4v37P9GuZuqVMRMklxEY/LheDR7esgMulGl4KTaVf6oXDTwk4Aa7nyHZSL i5y6H70oSeLWMzXV4a+Mp1zG2gKlu+qSmo87ai69cqijWCgRlYmEQ2or5vyUV/n2q9g3 kTzkHrwYWsa+Rwkt3HRx+QAPJYpvbehX2sZtcELKzZLLENMNrsizS1meKjKM94erigF4 V5dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WnNM92H4TnOSeAtoa/Tf5BS0Ugc1vGBizxzFyFswM40=; b=JdSkJkLo1oDY04JPX8lbh3E2Hnmwr/jab779JV/ETyNWU1M98tMf11hpmcGp9FSAnb r7OKKPFklMEOrNzfLDLeOVTmx0eJPQcL5k5qZdZVF6REaT3BmYg51frhVFb/NpLd4zG/ kv46ERTcMlHOv1mEQivZl6OglegxoIBusAIIIZ9fKz8DKUwV6JkGb8jomQNC6s9GxOP2 Il6sKntMO4vJRGAvOJFq32LuZ1KpXHu35vjNlK11iQ3zjQUy+dmK2wmoiZvotFHP8Be9 l8il7fP3TgXQvS1rZUf5Agd4ZlwoPhmEZO4naP9RrsqFK1Xs61ow/1wDggEHZKtTBHZr RAJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HhT9sPs7; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020aa79a49000000b006261ac05ae4si18275759pfj.374.2023.03.23.05.45.21; Thu, 23 Mar 2023 05:45:33 -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=@intel.com header.s=Intel header.b=HhT9sPs7; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbjCWMgr (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 08:36:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbjCWMgl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 08:36:41 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DF91B56F; Thu, 23 Mar 2023 05:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679574998; x=1711110998; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oFMi59KYeaqcmAy2tfu/4MDHteFRDFzaVTDWfROxUbE=; b=HhT9sPs7UFz67CCZeTnUn+pA/D/PDpg7ZcfJANyeNa/svjJEDVAwAdri CY6bMBpoaEZXgbOOwyasoTz1YRfLb6MAmsLRQRg0kq4jwdyJek0UHYfTT +0PvH6pHCHRIzTa+DXnHmioqex0WCgXGO+CfDzcMrFMK57txDLDKoA+M4 c6evi8Npy73saogVnfn3sLUDxTdS1oy4JOVC7oKtZ71oGHADOJ/PrKWKv J05HcvefXYbUbAJdNZ3CpI/48AdYDQb4/fhtoFn0xD1iKc84eGq7Epuoq 0F+oi19P66ilHyTN64nQncW2HUS1z7CHgPRGKcobW1kLuK8fKb4mz284v w==; X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="341011534" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="341011534" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 05:36:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10657"; a="856466575" X-IronPort-AV: E=Sophos;i="5.98,283,1673942400"; d="scan'208";a="856466575" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 23 Mar 2023 05:36:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 14784D0; Thu, 23 Mar 2023 14:37:06 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Kees Cook <keescook@chromium.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Cezary Rojewski <cezary.rojewski@intel.com>, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Theodore Ts'o" <tytso@mit.edu>, Jan Kara <jack@suse.com>, Andy Shevchenko <andy@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org> Subject: [PATCH v2 0/3] lib/string_helpers et al.: Change return value of strreplace() Date: Thu, 23 Mar 2023 14:37:01 +0200 Message-Id: <20230323123704.37983-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761162594990678847?= X-GMAIL-MSGID: =?utf-8?q?1761162594990678847?= |
Series |
lib/string_helpers et al.: Change return value of strreplace()
|
|
Message
Andy Shevchenko
March 23, 2023, 12:37 p.m. UTC
It's more convenient to have strreplace() to return the pointer to the string itself. This will help users to make their code better. The patch 1 kills the only user of the returned value of strreplace(), Patch 2 converts the return value of strreplace(). And patch 3 shows how it may be useful. That said, the series can be routed via fs tree, with or without the last patch. In v2: - removed not anymore used variable (LKP) - added tag (Jan) - fixed wording (Kees) - actually return the pointer to the string itself Andy Shevchenko (3): jbd2: Avoid printing outside the boundary of the buffer lib/string_helpers: Change returned value of the strreplace() kobject: Use return value of strreplace() fs/jbd2/journal.c | 6 ++---- include/linux/string.h | 2 +- lib/kobject.c | 3 +-- lib/string_helpers.c | 12 ++++++++---- 4 files changed, 12 insertions(+), 11 deletions(-)
Comments
On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: > It's more convenient to have strreplace() to return the pointer to > the string itself. This will help users to make their code better. > > The patch 1 kills the only user of the returned value of strreplace(), > Patch 2 converts the return value of strreplace(). And patch 3 shows > how it may be useful. That said, the series can be routed via fs tree, > with or without the last patch. Since there are no comments, who can apply this (patches 1 and 2)? Greg, are you fine with the kobject change? > In v2: > - removed not anymore used variable (LKP) > - added tag (Jan) > - fixed wording (Kees) > - actually return the pointer to the string itself > > Andy Shevchenko (3): > jbd2: Avoid printing outside the boundary of the buffer > lib/string_helpers: Change returned value of the strreplace() > kobject: Use return value of strreplace() > > fs/jbd2/journal.c | 6 ++---- > include/linux/string.h | 2 +- > lib/kobject.c | 3 +-- > lib/string_helpers.c | 12 ++++++++---- > 4 files changed, 12 insertions(+), 11 deletions(-)
On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote: > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: > > It's more convenient to have strreplace() to return the pointer to > > the string itself. This will help users to make their code better. > > > > The patch 1 kills the only user of the returned value of strreplace(), > > Patch 2 converts the return value of strreplace(). And patch 3 shows > > how it may be useful. That said, the series can be routed via fs tree, > > with or without the last patch. > > Since there are no comments, who can apply this (patches 1 and 2)? > Greg, are you fine with the kobject change? Sure, want me to take them all through my driver-core tree? thanks, greg k-h
On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote: > On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote: > > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: > > > It's more convenient to have strreplace() to return the pointer to > > > the string itself. This will help users to make their code better. > > > > > > The patch 1 kills the only user of the returned value of strreplace(), > > > Patch 2 converts the return value of strreplace(). And patch 3 shows > > > how it may be useful. That said, the series can be routed via fs tree, > > > with or without the last patch. > > > > Since there are no comments, who can apply this (patches 1 and 2)? > > Greg, are you fine with the kobject change? > > Sure, want me to take them all through my driver-core tree? Fine by me! Dunno about others. Kees?
On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote: >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote: >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: >> > > It's more convenient to have strreplace() to return the pointer to >> > > the string itself. This will help users to make their code better. >> > > >> > > The patch 1 kills the only user of the returned value of strreplace(), >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows >> > > how it may be useful. That said, the series can be routed via fs tree, >> > > with or without the last patch. >> > >> > Since there are no comments, who can apply this (patches 1 and 2)? >> > Greg, are you fine with the kobject change? >> >> Sure, want me to take them all through my driver-core tree? > >Fine by me! Dunno about others. Kees? Yeah, that's cool by me. :)
On Wed, Apr 05, 2023 at 07:58:40PM -0700, Kees Cook wrote: > On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote: > >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote: > >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: > >> > > It's more convenient to have strreplace() to return the pointer to > >> > > the string itself. This will help users to make their code better. > >> > > > >> > > The patch 1 kills the only user of the returned value of strreplace(), > >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows > >> > > how it may be useful. That said, the series can be routed via fs tree, > >> > > with or without the last patch. > >> > > >> > Since there are no comments, who can apply this (patches 1 and 2)? > >> > Greg, are you fine with the kobject change? > >> > >> Sure, want me to take them all through my driver-core tree? > > > >Fine by me! Dunno about others. Kees? > > Yeah, that's cool by me. :) Greg, does this slip through the cracks?
On Mon, Jun 05, 2023 at 05:04:43PM +0300, Andy Shevchenko wrote: > On Wed, Apr 05, 2023 at 07:58:40PM -0700, Kees Cook wrote: > > On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote: > > >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote: > > >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: > > >> > > It's more convenient to have strreplace() to return the pointer to > > >> > > the string itself. This will help users to make their code better. > > >> > > > > >> > > The patch 1 kills the only user of the returned value of strreplace(), > > >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows > > >> > > how it may be useful. That said, the series can be routed via fs tree, > > >> > > with or without the last patch. > > >> > > > >> > Since there are no comments, who can apply this (patches 1 and 2)? > > >> > Greg, are you fine with the kobject change? > > >> > > >> Sure, want me to take them all through my driver-core tree? > > > > > >Fine by me! Dunno about others. Kees? > > > > Yeah, that's cool by me. :) > > Greg, does this slip through the cracks? It did. Can someone resend this? thanks, greg k-h
On Mon, Jun 05, 2023 at 06:57:48PM +0200, Greg Kroah-Hartman wrote: > On Mon, Jun 05, 2023 at 05:04:43PM +0300, Andy Shevchenko wrote: > > On Wed, Apr 05, 2023 at 07:58:40PM -0700, Kees Cook wrote: > > > On April 5, 2023 7:38:40 AM PDT, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > > >On Wed, Apr 05, 2023 at 04:24:42PM +0200, Greg Kroah-Hartman wrote: > > > >> On Wed, Apr 05, 2023 at 04:34:31PM +0300, Andy Shevchenko wrote: > > > >> > On Thu, Mar 23, 2023 at 02:37:01PM +0200, Andy Shevchenko wrote: > > > >> > > It's more convenient to have strreplace() to return the pointer to > > > >> > > the string itself. This will help users to make their code better. > > > >> > > > > > >> > > The patch 1 kills the only user of the returned value of strreplace(), > > > >> > > Patch 2 converts the return value of strreplace(). And patch 3 shows > > > >> > > how it may be useful. That said, the series can be routed via fs tree, > > > >> > > with or without the last patch. > > > >> > > > > >> > Since there are no comments, who can apply this (patches 1 and 2)? > > > >> > Greg, are you fine with the kobject change? > > > >> > > > >> Sure, want me to take them all through my driver-core tree? > > > > > > > >Fine by me! Dunno about others. Kees? > > > > > > Yeah, that's cool by me. :) > > > > Greg, does this slip through the cracks? > > It did. Can someone resend this? Done as v3. 20230605170553.7835-1-andriy.shevchenko@linux.intel.com