Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp104544rwl; Tue, 4 Apr 2023 19:54:04 -0700 (PDT) X-Google-Smtp-Source: AKy350afwEACq935YqfEp6g1PuogJOAPViPvMla7pR4niq9R3C2LEPMMohzfZEh82scu5Ub+nEaP X-Received: by 2002:a17:90b:380c:b0:237:3f83:61f3 with SMTP id mq12-20020a17090b380c00b002373f8361f3mr5056816pjb.16.1680663244457; Tue, 04 Apr 2023 19:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680663244; cv=none; d=google.com; s=arc-20160816; b=0MWHeCVVEyiw9ofyVmtevajxJaJHdT3uv5P1E4mRPsY86ma3jTMWik+e/h+fMsDuLu 4oOwY92k/+BrLwCyf6Ty5KBD8R9m6P77jDH+aNyx7oKhpwY4kxB0opeBhdgWpBJ5V3va cdH+wuTj2IU4b8CkozWyzzyOYA9Ayfk+OHXXxd5Uquz2+659xSp6YByreZz6JLXGBSXE KtjxnZTJwROL/5DuH0uSm0bF/CAhNZi2uc+JsqSgITJdICIr/NzFpMYiGk7MFE7T1P6M TvhAAvn+fMvrS2kiOjmgHNSYaKAqDxI4nlaJLAG9V7gjSjyAp6qX9hJK0JUM2xLxCTZu 0A2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Ij35UsgQFtqmUbvrmP0oqLgol9rEDxKS71bsVWjh9II=; b=gdBCqneRorHd8GZa9+WDtvvgYhe7ayrOlaVz9sFa1AbfejcGCcvFD43hm4HwRh6bSI O9pkKTHu9C1J/bO9r3O3Qn/Nr+oOILoHuW21kYBk3R4NM9GL+sJjBozSV01vwzr91IPt n2WLp5qfImZuWDOUFTIA1inK5pcE07U2Hk75Jx4EtEWSVrpr/w3+T/vP+VLRw6vaN79A 312FYWN7prAgwcSvzPlSHXylr+7/dSHzobImSUIZS9/Up8otlmPOIqVtA1PEGJTEVvuI MXhcw51aqeZZNIH0+HkLtnWUhn70+/nKFWs+NyOR9JC86r60MpUe70LBXxdYfz8PDGqf ZgSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TqDL4650; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik3-20020a170902ab0300b0019ce74dd5c8si11004738plb.529.2023.04.04.19.53.52; Tue, 04 Apr 2023 19:54:04 -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=@kernel.org header.s=k20201202 header.b=TqDL4650; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236740AbjDECoO (ORCPT + 99 others); Tue, 4 Apr 2023 22:44:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235365AbjDECoN (ORCPT ); Tue, 4 Apr 2023 22:44:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA8163A9F for ; Tue, 4 Apr 2023 19:44:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 577B9622B7 for ; Wed, 5 Apr 2023 02:44:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51673C433EF; Wed, 5 Apr 2023 02:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680662651; bh=B0fG8cDrSJuSDznhEKKjqRypY7IlcyPQWYknjOL91/U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TqDL4650iHQQ4XJgPKE6jUNLNPE07IhUmhp0txUNL9Nc6Soy58PxSjBscDuItmmzb QOm2cMUtVMJ3/o6kSrAFMX+RwgcddNIZtiZJPavoohuC8MFmO+tBq/SG8wD9bgiVCs ruFaipp0phX492gv3+yNPwyOzJniOJ04cNyMeYxBdV0bHrtciiKlrNDK4jfKxwHOXJ 6HuXo4xAqweFzIJTv6udZ3fe/NyPRGPL3UGx//vx46L6a9YE7uCjw/iXienGwbd3HT EV6TrRLdE5YdL6T1ZEBeH0C3fhdaAlBwNFm2mcRerT/8Yu5c2IkhnO0YWAYnFaddFV fZkgcY5tAn0iw== Message-ID: <3918411a-77fc-48d7-5b80-c4b84203a39c@kernel.org> Date: Wed, 5 Apr 2023 10:44:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] f2fs: convert to use sysfs_emit Content-Language: en-US To: Yangtao Li , Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20230331113305.77217-1-frank.li@vivo.com> From: Chao Yu In-Reply-To: <20230331113305.77217-1-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org On 2023/3/31 19:33, Yangtao Li wrote: > Let's use sysfs_emit. > > Signed-off-by: Yangtao Li > --- > fs/f2fs/sysfs.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c > index 9ddc6ee19433..2c0b2cb05a3a 100644 > --- a/fs/f2fs/sysfs.c > +++ b/fs/f2fs/sysfs.c > @@ -312,19 +312,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a, > > if (!strcmp(a->attr.name, "ckpt_thread_ioprio")) { > struct ckpt_req_control *cprc = &sbi->cprc_info; > - int len = 0; > int class = IOPRIO_PRIO_CLASS(cprc->ckpt_thread_ioprio); > int data = IOPRIO_PRIO_DATA(cprc->ckpt_thread_ioprio); > > - if (class == IOPRIO_CLASS_RT) > - len += scnprintf(buf + len, PAGE_SIZE - len, "rt,"); > - else if (class == IOPRIO_CLASS_BE) > - len += scnprintf(buf + len, PAGE_SIZE - len, "be,"); > - else > + if (class != IOPRIO_CLASS_RT && class != IOPRIO_CLASS_BE) > return -EINVAL; > > - len += scnprintf(buf + len, PAGE_SIZE - len, "%d\n", data); > - return len; > + return sysfs_emit(buf, "%s,%d\n", class == IOPRIO_CLASS_RT ? "rt" : "be", data); Exceed 80 columns. Thanks, > } > > #ifdef CONFIG_F2FS_FS_COMPRESSION