Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7521631rwl; Thu, 23 Mar 2023 05:37:31 -0700 (PDT) X-Google-Smtp-Source: AK7set/8b/kaxALzKhh96XVIAyPin8iltKKWLa2iEPcVGoM7i1sFh1fKca3DwYdZImkv1wuF+hql X-Received: by 2002:a17:906:24cb:b0:930:8590:95ef with SMTP id f11-20020a17090624cb00b00930859095efmr5665597ejb.18.1679575050876; Thu, 23 Mar 2023 05:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679575050; cv=none; d=google.com; s=arc-20160816; b=HZB0OX7q2Pyu2lu6T6V4v/BxlBRUZiDh7w/KR5EOrJOTYthHdTR+ZKrewxhYFzFYMZ V7TXo3LZX5d6Shbai3VzDn+TViN/cSuSB24gxB7wsNJlD69n2/JSfc/70/FdaJ4vt2mF vUQ+JLbhbQ2SjaPTVYpEG2GzD3m+K0g8gm52v9fr+/HLMzR1vdMZToJKaLpbyyYnFa8Y OrlF8BeVxYwKjhbQGfA/zEpt2zcqjxLNZKAhs6sO5WI+/Mg53Th4vGokiP8nZbXTxm7b H0DfYUfrYZe01arTAR7E3kMJP7DVURmpl5T8GZphWQs4NwIKRrndKKKRYadnRCl5mUD2 PC9w== 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=p6LtwxajX+t+Rqm6QNjT0hoTzya308sB674Dr6gikZhGZ3mVqK2Tb10SppmRrNeukV 4ukP2272TMxAwhcghfTfonZjfCfbwrET2/xMTv6S7YuJmtzIDcO7bVSaEFkiKuFjELVI CeC+qIlDbAD8/ttGDTi34Ab6hYhb5pByIFPh2UV+aGxuzxcDPX/e4Xz8mCKKHvBLF4yG 7Xtv7xwJSkvRGcgwBxiM2YADVnYs7M+qZR2U05orfAIUHvR9f+S4NTfC7kE0DmWLZFRS IwvxP6Eu85OgBl8iqopAid3gALfRvKbTlAk0yxrvQDG3SieqLGki5dNEbpfZT6k1VQh3 yHAQ== 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-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10-20020aa7d98a000000b00501d43ed1d3si8059297eds.215.2023.03.23.05.37.07; Thu, 23 Mar 2023 05:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S231867AbjCWMgp (ORCPT + 99 others); Thu, 23 Mar 2023 08:36:45 -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 ); 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 To: Kees Cook , Greg Kroah-Hartman , Andy Shevchenko , Cezary Rojewski , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Theodore Ts'o" , Jan Kara , Andy Shevchenko , "Rafael J. Wysocki" 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: X-Mailing-List: linux-ext4@vger.kernel.org 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(-) -- 2.40.0.1.gaa8946217a0b