Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp732130rwb; Wed, 28 Sep 2022 08:25:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7u/N1yIywE6r/JIFWxJvyonr3uuEXpAZ13nZCPk6P60JM0UlchLYsjBHH71BVyc96aIlE0 X-Received: by 2002:a17:90b:4d07:b0:1ef:521c:f051 with SMTP id mw7-20020a17090b4d0700b001ef521cf051mr11406702pjb.164.1664378729270; Wed, 28 Sep 2022 08:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664378729; cv=none; d=google.com; s=arc-20160816; b=CtZEnjgTrOzpgv6GrLRGzIINcthUZAb0B+4TaVMPLrWACDEEwwcyz8nmPrE09jrayS Z0+Beg60L4AJ6T8YZS6Mdlked27znAaHVDQooeOglZtrSCFkPac3XCcpJvFOp8OL5gZG VK/s6h2nA79qfxsJLDzxSP2rKMja9Xf3Hw+f7p4T36VKLzXZIVQW2I4FVxYyuvM0zaSI FeDwAbm1sTpw11pDvAHGegb0JOuK3Gin0SdkHMSxFTtnevTKiuRh/XQdOTWwmADhx9bQ pwEhRJDSjr5Yyq9Dn47GpFhcmnaDWZYMhUDLz0S4oakKpmU80l6Pdub7OANo/fr2spAE BJ4A== 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=7Xepm2wyWyIljOm4G98bA9eOW+A+xeMzjvlBte+Lyv4=; b=rtfBGU5qxInlDrW40F6jvrJ8A2ze/h6UVsq1sqRO0voZ8fgb+2HiieRjo+cA0fuJmC xCCBCBTizZyCi/GSf6gT7v0no4+GUs1y8iwex1CTaDmxMF2EnpW97Ji21eJPpZieejqx GHDhSEcw1HdgLkPHl2UXZzzi8A/ozyF5iYLaz3A1L3DEMu/tt3kpe43KmI8l+qKuhGhj Eizv5a3BCisPRe3mj9DKz7SOEgNGZgJ+RY9pQTpJVnTiP6prB6H4qztbHVW5O+V2b4l8 CSjw7nPYOIbzBzpn3IvsBalqRqe1jjBKxGaE3vqX2jooC3tMdXTn1ORr/UG1bEkHmpAs bEtA== 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 g18-20020a62e312000000b0052db0fc1a5csi3004170pfh.229.2022.09.28.08.25.17; Wed, 28 Sep 2022 08:25:29 -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 S234015AbiI1N4a (ORCPT + 99 others); Wed, 28 Sep 2022 09:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231703AbiI1N42 (ORCPT ); Wed, 28 Sep 2022 09:56:28 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B4FB2B196; Wed, 28 Sep 2022 06:56:25 -0700 (PDT) Received: from fraeml738-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4McyhK6qbhz6HJG9; Wed, 28 Sep 2022 21:56:17 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml738-chm.china.huawei.com (10.206.15.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 28 Sep 2022 15:56:22 +0200 Received: from [10.126.175.219] (10.126.175.219) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 28 Sep 2022 14:56:22 +0100 Message-ID: <99efb876-69b1-eb7c-dfa6-8ac621a25438@huawei.com> Date: Wed, 28 Sep 2022 14:56:24 +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 1/6] scsi: libsas: Add sas_task_find_rq() To: Johannes Thumshirn , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "jinpu.wang@cloud.ionos.com" , Damien Le Moal CC: "hare@suse.de" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxarm@huawei.com" , "ipylypiv@google.com" , "changyuanl@google.com" , "hch@lst.de" References: <1664368034-114991-1-git-send-email-john.garry@huawei.com> <1664368034-114991-2-git-send-email-john.garry@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.175.219] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 28/09/2022 14:17, Johannes Thumshirn wrote: >> +static inline struct request *sas_task_find_rq(struct sas_task *task) >> +{ >> + struct scsi_cmnd *scmd; >> + >> + if (!task || !task->uldd_task) >> + return NULL; > Is anyone actually calling sas_task_find_rq with a NULL task? Yeah, unfortunately. An example - the only one I think - is in the pm8001 driver: pm8001_ccb_alloc() function which takes a task pointer which may be NULL, and this function calls sas_task_find_rq() > That doesn't make a lot of sense from an API POV for me, having > the only argument allowed to be NULL (and not being a *free() > kind of function). I suppose that I could change to only call sas_task_find_rq() for non-NULL sas_task pointers (and remove the task check). Thanks, John