Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1405176ybh; Sun, 19 Jul 2020 19:07:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsPKn1yPHobXs66cLAtEoKwHyzL0zRVcYG5z377QLzynwurg538LM/joh0CWIIG1v+BSKX X-Received: by 2002:a05:6402:1bdd:: with SMTP id ch29mr19519353edb.134.1595210871825; Sun, 19 Jul 2020 19:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595210871; cv=none; d=google.com; s=arc-20160816; b=NcajEQHelsvRhq36ZgOziPerYcYXLaJ0AFiCEdmCwYd3V46jxiEenTvn7idJYmWGWg 48oiriPasWZsvmsVQ1n5gWJxkMGCgzwLsiQ+VG126qDi9sr7aPugBtL1PCpnZtAPPy4Z wZ6+N7YkK39k7qkrMiBjNJErBEXlKd7ocftVZ1MCOaZIKU15szjf1GtH75GgEtp451So w+7quUMz0O8vvULrayrTpA3ppasx48oYoF37CydhLKVKVm9I2qutHSQCsSbtTHVxUoKo hIrF0woZP1+dLhg9wf/gGTGCJQK2PF8yDOkcTGzUwK3hlOCPXQwfUqK2v9ZEc387O+5Y qgsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=D3H6QfB/9bQ0cuzGWQcNKtIJHCWsB8Tn2iHl0bno/p8=; b=eloitsPk6Czrih1vOfuUDWly1KQObFp2Yr3iX6iSYZK6MOc/BU+/O3Oc72QaouJjeW +doQHzT9nVhGAnsWs+GHQANsGlGgk6Pjqyn85YCycRFAXYlSUD7PSsOVLZ7GqHa4iU0k 06G2cdFTysqahCIm57SDCOZnedF90M0TsCcIaHeHqYfUM9imFPCCFefM1aOHt6QOlHLK 7Gfd2JjpPWpJm+tx95RuY1jySsS7rpEeKJnRQzaoYhpJw7sf5UYwny5oLHHeZMs0Et2g 08yzgJmukFUOwsuJX+zM4S+cnWq4BRel6ZRDrz8enXQkixfuYFAhE0O69Z+irKYRRN+m 1yJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si564042ejh.123.2020.07.19.19.07.28; Sun, 19 Jul 2020 19:07:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbgGTCHT (ORCPT + 99 others); Sun, 19 Jul 2020 22:07:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:42042 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726225AbgGTCHT (ORCPT ); Sun, 19 Jul 2020 22:07:19 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 559488765EB5FCFC14C9; Mon, 20 Jul 2020 10:07:16 +0800 (CST) Received: from [127.0.0.1] (10.174.178.16) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Jul 2020 10:07:01 +0800 Subject: Re: [PATCH v2] scsi: scsi_transport_sas: add missing newline when printing 'enable' by sysfs To: Bart Van Assche , , , CC: , , References: <1594975472-12486-1-git-send-email-wangxiongfeng2@huawei.com> <88b08a41-55b2-ae5d-fbe5-24439429855f@acm.org> From: Xiongfeng Wang Message-ID: Date: Mon, 20 Jul 2020 10:07:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <88b08a41-55b2-ae5d-fbe5-24439429855f@acm.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.16] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2020/7/19 4:25, Bart Van Assche wrote: > On 2020-07-17 01:44, Xiongfeng Wang wrote: >> diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c >> index 182fd25..e443dee 100644 >> --- a/drivers/scsi/scsi_transport_sas.c >> +++ b/drivers/scsi/scsi_transport_sas.c >> @@ -563,7 +563,7 @@ static ssize_t do_sas_phy_enable(struct device *dev, >> { >> struct sas_phy *phy = transport_class_to_phy(dev); >> >> - return snprintf(buf, 20, "%d", phy->enabled); >> + return snprintf(buf, 20, "%d\n", phy->enabled); >> } > > For future sysfs show function patches, please use PAGE_SIZE as second > snprintf() argument or use sprintf() instead of snprintf() because in > this case it is clear that no output buffer overflow will happen. Using Thanks for your advice. I will follow it in the future patches. > any other size argument than PAGE_SIZE makes patches like the above > harder to verify than necessary. Anyway: > > Reviewed-by: Bart van Assche Thanks, Xiongfeng >