Message ID | 20230207070839.370817-2-ZiyangZhang@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2696210wrn; Mon, 6 Feb 2023 23:14:45 -0800 (PST) X-Google-Smtp-Source: AK7set9kQgVFZJfeURdnPZiPnQjOf2SpVsQDIADzmd0sJxRMV+YIEzuLVDbOG/xGnC9K1WtsCK45 X-Received: by 2002:a05:6a21:3386:b0:be:bea0:7137 with SMTP id yy6-20020a056a21338600b000bebea07137mr3071722pzb.5.1675754084804; Mon, 06 Feb 2023 23:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675754084; cv=none; d=google.com; s=arc-20160816; b=xz65dwL1sY/y35guVqfKkKUMxtTl2fN85kXqGexiGIW2EYZuV6HZkhFneBEHxK6wCF E67YSnqBPS+b5Ya6X0IH1lb58SyshuCG4Br1EU2w1uLqFQQ7bnjtaVilhxM77j5hNINh EdROPadMzYNDiOVQrCj6O1T0Pw94UjMlSROZtI6DuWt4SJ5fVQ6llvlLsE/2jtbeDhct oDlS6eW0bHvi6JQ52IrK8djUuqCp74djISLSXb1WFRf92J6XrSURM0LqVbXYyA26jxlC PM4DUCNu2QCHm5Ebm8HnPojw9/LhFn+KpbUNeM3JVqcwf1srOL8dnxGIxCSzO6KnLt1Z da8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=BaMHEhS2bgTBrsIE3hfubz2L+LxH2WuV/15neQ3F0rs=; b=hK517qXOYkoN9X/YvEQ3NkdmTcGUAYZzHmP/tMoUjLRcIXT5hxS5apFqQbvP7lnihq JR0TCwmZDM/ErpBl9muHRBv5nCmwwaPXc3iTH+0z+PAUUu4NDgy+ny5gpDm4qdb0Z7aY f6k6bwxqRKnXrKBL/9IN8uv0HFc5RrfsPAYvA4/NLd4Yd5Zi0GXsz470HZhjbf/J/o9O z0Rz35kOCnRePBk8y1iAUn/wZZswIsJgAUyAuFbUApIdiNhPRMPvH2TIB+Ozna7cNG0m pCkSVq033ynlo8wxw+m16qtF15YBl8zBz33V45S8KPmZPileTaQftHhI25bgB8TkF9GP eoeg== 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u128-20020a637986000000b004faf3a3a9d1si4099279pgc.443.2023.02.06.23.14.31; Mon, 06 Feb 2023 23:14:44 -0800 (PST) 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbjBGHJM (ORCPT <rfc822;kmanaouilinux@gmail.com> + 99 others); Tue, 7 Feb 2023 02:09:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjBGHJI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 7 Feb 2023 02:09:08 -0500 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40352D50; Mon, 6 Feb 2023 23:09:04 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=ziyangzhang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vb64zFV_1675753740; Received: from localhost.localdomain(mailfrom:ZiyangZhang@linux.alibaba.com fp:SMTPD_---0Vb64zFV_1675753740) by smtp.aliyun-inc.com; Tue, 07 Feb 2023 15:09:02 +0800 From: Ziyang Zhang <ZiyangZhang@linux.alibaba.com> To: axboe@kernel.dk, ming.lei@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, joseph.qi@linux.alibaba.com, Ziyang Zhang <ZiyangZhang@linux.alibaba.com> Subject: [PATCH RESEND 1/3] ublk: remove unnecessary NULL check in ublk_rq_has_data() Date: Tue, 7 Feb 2023 15:08:37 +0800 Message-Id: <20230207070839.370817-2-ZiyangZhang@linux.alibaba.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20230207070839.370817-1-ZiyangZhang@linux.alibaba.com> References: <20230207070839.370817-1-ZiyangZhang@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757155514800003836?= X-GMAIL-MSGID: =?utf-8?q?1757155514800003836?= |
Series |
cleanup for ublk
|
|
Commit Message
Ziyang Zhang
Feb. 7, 2023, 7:08 a.m. UTC
bio_has_data() allows a NULL bio so the NULL check in
ublk_rq_has_data() is unnecessary.
Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
---
drivers/block/ublk_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Feb 07, 2023 at 03:08:37PM +0800, Ziyang Zhang wrote: > bio_has_data() allows a NULL bio so the NULL check in > ublk_rq_has_data() is unnecessary. > > Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Thanks, Ming
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c932e9ea5a0f..55fccce68a9c 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -322,7 +322,7 @@ static inline struct ublk_queue *ublk_get_queue(struct ublk_device *dev, static inline bool ublk_rq_has_data(const struct request *rq) { - return rq->bio && bio_has_data(rq->bio); + return bio_has_data(rq->bio); } static inline struct ublksrv_io_desc *ublk_get_iod(struct ublk_queue *ubq,