From nobody Sun Feb 8 01:29:43 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D327EC7EE2E for ; Mon, 5 Jun 2023 17:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235151AbjFERGB (ORCPT ); Mon, 5 Jun 2023 13:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbjFERF6 (ORCPT ); Mon, 5 Jun 2023 13:05:58 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90D9EF1; Mon, 5 Jun 2023 10:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685984753; x=1717520753; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Uqba7KW+LSTrR6KDuN+F/tgiTmPx6AhRcJexGJYfzL0=; b=gZnt7i7S5RAKnCKhWoOseINM9UweFOim683+c0tM4l+IvhnrTiEsvNsw JAbAU1C6zGh/Jgx/2ys2TRPKu32shLHlX47KJdo9lEMBGzeqdPFOutF6E sXVfRKyebWO6uAl1SSnvYo2BJLsEGI2CyZNgM23CdLIWozuWyhe7pHjfY l9Nxg6UnQShrJF8Q7HpHEZB+EtoN5++Oz4mwgOXik1k7dVyxUHOZIqEDC eU/oQPvR4mY32FA+j5qW6AJJtHJwXa5CPKCnY9K/cT2jPhSqrirF88/rR s3YfBWRqAuPdYQ4yjKUwKZbtbhqMVxwOqK5YTIKOdCtUO9LfCAyauBLRi Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="356431378" X-IronPort-AV: E=Sophos;i="6.00,218,1681196400"; d="scan'208";a="356431378" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 10:05:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10732"; a="773807505" X-IronPort-AV: E=Sophos;i="6.00,218,1681196400"; d="scan'208";a="773807505" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 05 Jun 2023 10:05:49 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id AE297379; Mon, 5 Jun 2023 20:05:56 +0300 (EEST) 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 v3 3/3] kobject: Use return value of strreplace() Date: Mon, 5 Jun 2023 20:05:53 +0300 Message-Id: <20230605170553.7835-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230605170553.7835-1-andriy.shevchenko@linux.intel.com> References: <20230605170553.7835-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since strreplace() returns the pointer to the string itself, we may use it directly in the code. Signed-off-by: Andy Shevchenko --- lib/kobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/kobject.c b/lib/kobject.c index f79a434e1231..16d530f9c174 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -281,8 +281,7 @@ int kobject_set_name_vargs(struct kobject *kobj, const = char *fmt, kfree_const(s); if (!t) return -ENOMEM; - strreplace(t, '/', '!'); - s =3D t; + s =3D strreplace(t, '/', '!'); } kfree_const(kobj->name); kobj->name =3D s; --=20 2.40.0.1.gaa8946217a0b