Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp163543rwe; Wed, 31 Aug 2022 18:50:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4C4uqf6aaF5SQfUYFD5Hdmrf6gcrdl2tkSNUk6lqkCwReIQI2BEEF0gAR5J0z/aazkjOC2 X-Received: by 2002:a05:6a00:26e2:b0:538:23a6:4d62 with SMTP id p34-20020a056a0026e200b0053823a64d62mr19073593pfw.26.1661997009676; Wed, 31 Aug 2022 18:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661997009; cv=none; d=google.com; s=arc-20160816; b=FzJvL24mEe5R8X4lElKYQ7r/iQL3QcF5qZros+M6clU7kq36jGo+JY9fQM+gY0VR91 op24iaD2t97JULlHbjWAavSE4K/Uo+gWVCge35+AE8XdQlVWuEIuXSTjYvK9OibtCUEp xYMKFoD1PjQm30zMnbib9PmHrQ5gbER0dlVDBA9pFkG0/TvsPMS7WBJJb8MQLM1ZBjAv A8TEdjbhEiejVWRDqouy7hAnPvTlaiZb/b6t6sEKH3OfFAqbO+0JvDyulV0Jc6sUPVnp bldzu+Ro46SoPPG2UMO3IjcZIr+26sld6DvzNvy9UpaEXC3KMoLSOFycZ7/nFkh8qC2Q y05A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=L02Sp50hPwKNmfsR7li6CwKxaHvMpyrjFzMp+2/RDYc=; b=FWhTxRG8PtJKkvvDwheC0m8t9W1gRPkUObcOn+vYHyOgeibMIYbSzIrIWXxjNXyMEd ubItICla28+DZHknXVNToIOtFs8H0AXqdQdkHRftk/sj3i9JixpvhYSvsQhKgkU5TzS3 e5x+zhYUHhwMW81jtm1Z60YGTD5oTmLO5z5V978gxaO4L9lst6uciSkoEW55AcVQnl73 sAyHI54oDzy9IgKaST9a+LirNiUyENQYJ1Tm4C8yJsG5AqI7hqngIhWmMkEn6gAORirx JjqE3EPejHekkpqyCrhY7ZaCoBUtbVbO5BPhn0R8AYfeqiyao9ioIeLlDcwD3goCaCzk TFVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YifSQirQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay36-20020a056a00302400b0053a8225dc47si5312668pfb.55.2022.08.31.18.49.59; Wed, 31 Aug 2022 18:50:09 -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=@gmail.com header.s=20210112 header.b=YifSQirQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiIAAv0 (ORCPT + 99 others); Wed, 31 Aug 2022 20:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbiIAAvZ (ORCPT ); Wed, 31 Aug 2022 20:51:25 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF917D87E6; Wed, 31 Aug 2022 17:51:22 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id p185so16027379pfb.13; Wed, 31 Aug 2022 17:51:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date; bh=L02Sp50hPwKNmfsR7li6CwKxaHvMpyrjFzMp+2/RDYc=; b=YifSQirQGhLAjW66wrrOh4zVneYTdfs1QnXaG48PYfcduXj4zsFO077Z/ZDE0cDM2q YfbcDVb5XJAp2l/Qxug9wF150vOWJvZaJCT5P0SpLPkPASaOxxr4Nnu3vg76nIW/xEEV BtGeqxUQEtVJ7mA/0ddwxHYmjKGboY7hpx2TCvgmvc5no+ksC2UFDwshDIkpyJiNKHr5 tXxWsq76ISWPQj+WmuWNb6V7NH+wB7MjLL2Gss/cR8g06jWvQ8FR+W3B9ME5rT7/cqbK hYq+sef+l77lOoYSQlkyyymIEsXKN6q8U7k5gWcDbz8tlb6WoXNIK3Az5ujmv1bOmlZB VAkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date; bh=L02Sp50hPwKNmfsR7li6CwKxaHvMpyrjFzMp+2/RDYc=; b=ZnsTq/ZkhxCHlUkYkXoCNxlyw4QxuQU97V7+89mFsYrLId4fX3xPRHXDvHHx/NfKNS /603BUBC54j4reATSEu3RVPg2xGURSAnOQ073Bu7QHf9yZ0i8YZgKbbiJcxIi8u6JZJh P3VmHVH29DToT9JFJwRq5bSL/JED4UZZNaABz4smsb9Sa/3GumvlAhBEeuRWl7+X287+ 5sgPf1fHpMbgn69cZePU45lUkA5KLvUazcRA/kHSbjdh96aC+mPrXzTJg//E/RQgIrQl U/VE+FVl0iFwIWAoWw6opjBt75/S1NgXray6d5ZOTzfpbDC50V7+gpzYAF8FE2t+5irk osBw== X-Gm-Message-State: ACgBeo3/cggA4b1KCsNUAQCt5hF0sn6PxtqqtBPOKxH5p37l4OAjm5NT zpSmSCtwND0q9JYB1zfK8mo= X-Received: by 2002:a63:d1f:0:b0:422:7774:1969 with SMTP id c31-20020a630d1f000000b0042277741969mr23785234pgl.88.1661993481278; Wed, 31 Aug 2022 17:51:21 -0700 (PDT) Received: from carlis-virtual-machine ([156.236.96.164]) by smtp.gmail.com with ESMTPSA id d81-20020a621d54000000b0052ac12e7596sm11771524pfd.114.2022.08.31.17.51.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 17:51:20 -0700 (PDT) Date: Thu, 1 Sep 2022 08:51:14 +0800 From: To: Damien Le Moal Cc: jejb@linux.ibm.com, martin.petersen@oracle.com, bvanassche@acm.org, johannes.thumshirn@wdc.com, himanshu.madhani@oracle.com, zhangxuezhi1@coolpad.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: csiostor: convert sysfs snprintf to sysfs_emit Message-ID: <20220901085114.4a6a5a99@carlis-virtual-machine> In-Reply-To: References: <20220831141046.406837-1-zhangxuezhi3@gmail.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, 1 Sep 2022 09:23:58 +0900 Damien Le Moal wrote: > On 8/31/22 23:10, Xuezhi Zhang wrote: > > From: Xuezhi Zhang > > > > Fix up all sysfs show entries to use sysfs_emit > > > > Signed-off-by: Xuezhi Zhang > > --- > > drivers/scsi/csiostor/csio_scsi.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/scsi/csiostor/csio_scsi.c > > b/drivers/scsi/csiostor/csio_scsi.c index > > 9aafe0002ab1..39e8c3c26a19 100644 --- > > a/drivers/scsi/csiostor/csio_scsi.c +++ > > b/drivers/scsi/csiostor/csio_scsi.c @@ -1366,9 +1366,9 @@ > > csio_show_hw_state(struct device *dev, struct csio_hw *hw = > > csio_lnode_to_hw(ln); > > if (csio_is_hw_ready(hw)) > > - return snprintf(buf, PAGE_SIZE, "ready\n"); > > + return sysfs_emit(buf, "ready\n"); > > else > > While at it, you could remove this useless else here. > > > - return snprintf(buf, PAGE_SIZE, "not ready\n"); > > + return sysfs_emit(buf, "not ready\n"); > > Extra space after the ",". Hi, OK, I see. Thanks. > > > } > > > > /* Device reset */ > > @@ -1430,7 +1430,7 @@ csio_show_dbg_level(struct device *dev, > > { > > struct csio_lnode *ln = shost_priv(class_to_shost(dev)); > > > > - return snprintf(buf, PAGE_SIZE, "%x\n", > > ln->params.log_level); > > + return sysfs_emit(buf, "%x\n", ln->params.log_level); > > } > > > > /* Store debug level */ > > @@ -1476,7 +1476,7 @@ csio_show_num_reg_rnodes(struct device *dev, > > { > > struct csio_lnode *ln = shost_priv(class_to_shost(dev)); > > > > - return snprintf(buf, PAGE_SIZE, "%d\n", > > ln->num_reg_rnodes); > > + return sysfs_emit(buf, "%d\n", ln->num_reg_rnodes); > > } > > > > static DEVICE_ATTR(num_reg_rnodes, S_IRUGO, > > csio_show_num_reg_rnodes, NULL); >