From patchwork Mon Apr 17 20:41:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 84453 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2393692vqo; Mon, 17 Apr 2023 13:50:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZFG+t32taWmr7hPdjNqcwiEBNRIeSgHfw5fsmNrHlXDZc7YtgI+SKpOJ/8sGfi479STTfb X-Received: by 2002:a17:90a:3b47:b0:247:55a4:e777 with SMTP id t7-20020a17090a3b4700b0024755a4e777mr8751178pjf.49.1681764622623; Mon, 17 Apr 2023 13:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681764622; cv=none; d=google.com; s=arc-20160816; b=IZT3AoDcSGBnrZXvWW8PU0jLdceBMTrgVp4hpx5H+BEN3Njp1geYoQyybj8jnWgmDA SQZmhcC8MZzI2UO28XggzIWeIno/d7UHHpmOqwnk2tD8UABNsQCfo1x0S54TwlWKT1Ew NVYr77JGwk0hvhQFMEv7Oa3UWfb/j0CLtS1UFKzlScoAOdssDWZPBNMMpsm/MLnULvhc +UO4RAqg22uOmWjNqCjCKsGcT35W3TqXsETAwlfWVdmuygWG+BB2LxWxWsYPLqgUMoAY jta62eVidN5L533dhLBm32Pu9w1OwE0QM1Doc8mjGBn1GlpYSK7EWbUZAGZOv6Jxd+FO cDjw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=uY8LBeth5vJNi2Lzp3GMfyHfSkopsbeWtmhmmgyT3GM=; b=VlpfHLkcOEIaLpo1vTt2bl0VO7ddyltLptzT//ew3ZADMhEVkHn7M657mSqis5B7fq Fg/Soc5Z32y0BqTXuunN4cMsqL2YNTKOL6EhA8dVDwVvQmtx7vPsleuRJmDrD2k3/D3y C8ht9ZKDw3FnX0nOe84Bowo9G0vL9ukfKcUhjJyQtc+BnV4WsFEUHk8++KqxpW6XIw/C YY5HmhB+lEmnXH+pTnKbAeIwvaOVTeuAe1mg1wDdPbd7aEgQRi+dEM8x6C6D4+TndnLv WGhPWt23JnzkUAwrz76kUjh22hV05ZRGOhBhmjzmaj7Ev76tNnwMOzvbpH4nauB1URRU Jx2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@orange.fr header.s=t20230301 header.b="bgyBqcn/"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020a63f145000000b0050b51e62c1asi12712210pgk.63.2023.04.17.13.50.09; Mon, 17 Apr 2023 13:50:22 -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=@orange.fr header.s=t20230301 header.b="bgyBqcn/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbjDQUlV (ORCPT + 99 others); Mon, 17 Apr 2023 16:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjDQUlT (ORCPT ); Mon, 17 Apr 2023 16:41:19 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34733C3F for ; Mon, 17 Apr 2023 13:41:17 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id oVf0plYozzvWyoVf0pNzt5; Mon, 17 Apr 2023 22:41:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1681764076; bh=uY8LBeth5vJNi2Lzp3GMfyHfSkopsbeWtmhmmgyT3GM=; h=From:To:Cc:Subject:Date; b=bgyBqcn/j2enXfq0We5FO0LJwl3YbpRpB8UKfmiOxo89kCIl5sFQm+wFEZWYILNL/ WgtA20N8NCK7UXc6DFOug/ah6STLYj/UyNbSBtmF4Yokc+9LFBvGnpJRmdtIsQR2iT I79Sf7tyOJFUFFeru2VRetn1o1dBzwBSYfjU1Q6Lbnnb9MWZhKTgPhVuWnEAEPs/tM 4QkVX7bJdKpow3y9Rz5iv8P1mJoR8bYNl5jjsB73GxO1ojLCm+TuEjRTw8YrkBTlPk QKvES/I5i+kRUTYbIMCFFKX+x+zUlfFyS1YOhxHAzuq6pq1btq094g5YnaEPrqyNZo O3LljMigC2TjQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Apr 2023 22:41:16 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-nvme@lists.infradead.org Subject: [PATCH] nvmet-auth: remove some dead code Date: Mon, 17 Apr 2023 22:41:13 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763458021004249009?= X-GMAIL-MSGID: =?utf-8?q?1763458021004249009?= 'status' is known to be 0 at the point. And nvmet_auth_challenge() return a -E or 0. So these lines of code should just be removed. Signed-off-by: Christophe JAILLET Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- The dead code became obvious after commit be2ada6d0ed0 ("nvmet-auth: fix return value check in auth receive") --- drivers/nvme/target/fabrics-cmd-auth.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c index 7970a7640e58..038032e46145 100644 --- a/drivers/nvme/target/fabrics-cmd-auth.c +++ b/drivers/nvme/target/fabrics-cmd-auth.c @@ -483,15 +483,6 @@ void nvmet_execute_auth_receive(struct nvmet_req *req) status = NVME_SC_INTERNAL; break; } - if (status) { - req->sq->dhchap_status = status; - nvmet_auth_failure1(req, d, al); - pr_warn("ctrl %d qid %d: challenge status (%x)\n", - ctrl->cntlid, req->sq->qid, - req->sq->dhchap_status); - status = 0; - break; - } req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_REPLY; break; case NVME_AUTH_DHCHAP_MESSAGE_SUCCESS1: