From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from va-2-41.ptr.blmpb.com (va-2-41.ptr.blmpb.com [209.127.231.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 332B8494835 for ; Wed, 23 Sep 2026 11:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.231.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790162164; cv=none; b=j7o3vxW0EmIMRUrV0lK9kZY86h+XnB+mC1NiW87aiTxNm8Lwe3mTKjuig6KTFcZk2PlqT4/QnTttAoaBILTt9pXj7iukf/JiVaWcrhUoxkNMo8HUbVsbnc7z5br79sF6JYf+D5QfnhhdcS+s59S92+C/2tk1xA3r0fVAhxh2PZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790162164; c=relaxed/simple; bh=jitZB8F9F1v+1W/BfCoAkSqOsagliyLwkW9wj0NiVOA=; h=References:Cc:From:To:Mime-Version:In-Reply-To:Subject:Message-Id: Date:Content-Type; b=OcqLsvOGP6wHqVBLAHEehK8IpHZDdycpPt54RbH5qlwNHQAT83/tC2gDg2vcWZwZ233L+urW1X1ECY4TT01JMSuDtGSwfOJwYfIBxXzvpMM8Hk4w8uf4h8V5N+5UuBQkpFJcKawl37DKDbD26KhmKIm8FqnSSbUpwstVcRsJPNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fygo.io; spf=pass smtp.mailfrom=fygo.io; dkim=pass (2048-bit key) header.d=fygo-io.20200929.dkim.larksuite.com header.i=@fygo-io.20200929.dkim.larksuite.com header.b=jgGTrKD0; arc=none smtp.client-ip=209.127.231.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fygo.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fygo.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fygo-io.20200929.dkim.larksuite.com header.i=@fygo-io.20200929.dkim.larksuite.com header.b="jgGTrKD0" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=fygo-io.20200929.dkim.larksuite.com; t=1790162147; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=vTXwUoG0YrOP5+/xSMF7ok6KIOTZTTi+Llnc0nIw16w=; b=jgGTrKD0Q75EsnzTWpuyxo4oEqVskfVSFEyhkxXw9Z5DMLSGWpdPt23v07N7Kk2OvXCZFa HtL3NidZ86VU9MvRNS0YvrBCOnr7HWgm8EvfO2bQL1/noU4TF2RRgdhi2uL3Rl0vtRkES4 b+UB1Rv2ER09Uwtc7PT5gDXb51I7LhUV44l7VCowZXZr9MFTGqJRyQ2lcGsgMzIexOl4sm uQ1O6KDDQTmvCAszaNiaUa+JBFSUsQnu5VB72KpbN1sbhOgupjqSO/WG6qJmrBBuVfvEWb s9K/13R4+t+3VJVlzjg1QI0YM6lqfmtW5sRJECuWrZ+ulKuxXxYNDrfTXzFd5w== References: <20260921081009.278532-1-peng.fan@oss.nxp.com> <20260921081009.278532-2-peng.fan@oss.nxp.com> X-Original-From: yu kuai Cc: , "Peng Fan" , From: "yu kuai" Received: from [192.168.1.104] ([39.182.0.179]) by smtp.larksuite.com with ESMTPS; Wed, 23 Sep 2026 11:15:46 +0000 Content-Transfer-Encoding: quoted-printable To: "Peng Fan (OSS)" , "Song Liu" , "Li Nan" , "Xiao Ni" , "yu kuai" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 User-Agent: Mozilla Thunderbird In-Reply-To: <20260921081009.278532-2-peng.fan@oss.nxp.com> Reply-To: yukuai@fygo.io Subject: Re: [Patch V2] md/raid: use assign_bit() where applicable Message-Id: X-Lms-Return-Path: Date: Wed, 23 Sep 2026 19:15:43 +0800 Content-Type: text/plain; charset=UTF-8 =E5=9C=A8 2026/9/21 16:10, Peng Fan (OSS) =E5=86=99=E9=81=93: > From: Peng Fan > > Convert open-coded if/else with set_bit/clear_bit to the assign_bit API. > > Done with Coccinelle semantic patch: > // set_bit -> clear_bit =3D> assign_bit > > @@ > expression cond, bit, addr; > @@ > > -if (cond) > - set_bit(bit, addr); > -else > - clear_bit(bit, addr); > +assign_bit(bit, addr, cond); > > // clear_bit -> set_bit =3D> assign_bit > > @@ > expression cond, bit, addr; > @@ > > -if (cond) > - clear_bit(bit, addr); > -else > - set_bit(bit, addr); > +assign_bit(bit, addr, !cond); > > Signed-off-by: Peng Fan > --- > > V2: > Separate device-mapper and mraid > https://lore.kernel.org/all/20260918141737.3023011-1-peng.fan@oss.nxp.c= om/ > > drivers/md/md.c | 22 ++++++---------------- > drivers/md/raid5-cache.c | 6 ++---- > drivers/md/raid5.c | 6 ++---- > 3 files changed, 10 insertions(+), 24 deletions(-) Applied to md-7.4 --=20 Thanks, Kuai