Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1041018imi; Fri, 1 Jul 2022 01:34:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t8oyfeKrJuBR/nHWTCqethZnOQDOzojjl2+MF58amXaYt6S3sK3V0BNzYfaovWrcS+SiU7 X-Received: by 2002:a17:902:ce8b:b0:16a:4a3e:4fa1 with SMTP id f11-20020a170902ce8b00b0016a4a3e4fa1mr18875554plg.167.1656664498792; Fri, 01 Jul 2022 01:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656664498; cv=none; d=google.com; s=arc-20160816; b=rSfVZnxVXlxbfIskxU7W9woNdmbxDkUS4hS2WoRghIgcZypH+ge210hTYQW10a+71d RJF+SW8ZgxcKFz+5zaQCdZJt5xk/6FKKXHC3eZT3LZ40UzPKAz+b2J+Kcy3nzlgKnQtF JbfxBUFSPtkantUfXkXidSc628QWWJGlUYZJIY/yQN4n9hZPyrx/P8usKOkFWtFKOays YYeHR/2KeVuaUl1dXValthDt0mZ3BKIc4227zRdsHfxToPFiWF4PGNfH4kfDR/QTsUXR ocY0VVdgzv6t2x+BQheNjNYMUggz3cuYV6gDywZL9m2pGcHVm6CzelguHRrv9Hg3nu9j Zc0w== 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:subject:user-agent:mime-version:date:message-id; bh=I10/ge5RvF7ZH/HEQGpYkK5vepYPy+IzSLrLybdETD4=; b=aaIQq4HJ51xKvP4ogWaC+2RTQww5k9/LaN9Rr6Xxrp+cTi7FEC/K3VtzRr3hV1D4cJ xMc7dWRx2Mv1AEY81QUMO4dULHoNwsHmETThRUlAZlfPSyWEQjteVtfDd3HPXMjFd1V1 yDP6Z29RDqFuhNpRBLKZDzCMe6+aljCYneTbvZaej+oNY1+5sOd56D+Ribo3tP5DGJNy gs2GBvQAAt4aJK3Z84NACIm+Od/8Hgp14wdVd26SgMZ/iJ0JZLb/vgIgBG/3W32woad0 8K8o3h9F/QkMofuwPtOK73f5TNfyTADhBqPQ/yMq/bgwoIAkID+5HFTWMdU0eOKgG3jv EDZA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a170902e80600b00168b5301386si833004plg.84.2022.07.01.01.34.40; Fri, 01 Jul 2022 01:34:58 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236161AbiGAIC4 (ORCPT + 99 others); Fri, 1 Jul 2022 04:02:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236068AbiGAIC3 (ORCPT ); Fri, 1 Jul 2022 04:02:29 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67DC86F35D; Fri, 1 Jul 2022 01:02:28 -0700 (PDT) Received: from fraeml708-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LZ6yN5ZSQz67y8S; Fri, 1 Jul 2022 15:58:20 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml708-chm.china.huawei.com (10.206.15.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 1 Jul 2022 10:02:25 +0200 Received: from [10.126.173.51] (10.126.173.51) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 1 Jul 2022 09:02:24 +0100 Message-ID: <17c90e55-4560-fa37-398a-4de3838704ca@huawei.com> Date: Fri, 1 Jul 2022 09:02:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v5 3/5] scsi: core: Cap shost max_sectors according to DMA limits only once To: Damien Le Moal , , , , , , , CC: , , , , , , References: <1656590892-42307-1-git-send-email-john.garry@huawei.com> <1656590892-42307-4-git-send-email-john.garry@huawei.com> <5f79d8e7-0035-cfb0-d612-3e1c7f243f22@opensource.wdc.com> From: John Garry In-Reply-To: <5f79d8e7-0035-cfb0-d612-3e1c7f243f22@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.173.51] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,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 01/07/2022 00:41, Damien Le Moal wrote: >> >> shost->dma_dev = dma_dev; >> >> + if (dma_dev->dma_mask) { >> + shost->max_sectors = min_t(unsigned int, shost->max_sectors, >> + dma_max_mapping_size(dma_dev) >> SECTOR_SHIFT); >> + } > Nit: you could remove the curly brackets... But it being a multi-line > statement, having them is OK too I think. > tglx seems to think that they are ok, and I generally agree (now): https://lore.kernel.org/linux-arm-kernel/877djwdorz.ffs@nanos.tec.linutronix.de/ AFAICT coding-style.rst is ok with them in this scenario too Cheers, John