Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp28029rwb; Fri, 16 Sep 2022 23:41:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aleppYgBoJmH33JKyCZ6Fl2kH9LoMFwddOOBFCtQPuIIZMDvtqpLy70w6zgN4/2t2Bu+3 X-Received: by 2002:a17:907:6e25:b0:780:6c7c:3f99 with SMTP id sd37-20020a1709076e2500b007806c7c3f99mr5764196ejc.197.1663396885273; Fri, 16 Sep 2022 23:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663396885; cv=none; d=google.com; s=arc-20160816; b=ifZh/CVIapEhjl8kJBKeF3VXnUHI5mA99qdC4+1L54uc3EO/w9JExKQDS89/5rRypT OEsbnXJXj9GcH4ryedroFTB/di7RYSZ3l+V+R6f65MpfCFf8by59tz+OlGmSTNt2++EA ThcaYiYkEu92fOgSuPeJ/djz2ub3r0u1iPlOT0KakjWzt7+CS2hm0iRuwcb9wcJhNMIJ npT1B2rKwLBoT8JZ8+QYDY7TYryKywavo6srRUFj76790stkk8bIeB+8bJjvrZTYwnhK 6gke8r1RJ2zTD7tx7l+W6AUQAxAND0Ap8+R+YtbAghvwLj9L8KMePLtwscY/SYIHHtps 3qfg== 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=n9TQarA5HFDvEKCCTRUTj+Y9jic5HRzWblDS8dMVBcs=; b=edlrCcfF+nYEaCn6TdCtO4l3ZXF3I7jUsI4xcau+WzPR1RsxzaVwYmaeoorz+qbo4f E91m/J8YvlEsdfmPJFaeU11aRMHvILA4C8X2fH/bMrTllq/p3pOcBDk4MOWt1F/G1lzF U6vHF7kF3uMa5a1ao/pb1JfhyO7LqoS6tSseZrNkAtGIROfR0aYqXkXTRyJFDF49Qzem y11dgtqvDNgdl+NQzIJr/ZbyG1ooOCfFMSZqM6sddWGMOW64K77WjkimwHSAtke8G1+0 hLpgXkxNmrXe9dhDD5VppVLuUv1klA5NuhB7k378jpgU1Ce/30L/Ox7M9IcMo9RCrHHd B/yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=piZsHqUm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc32-20020a1709078a2000b0077d08e266ccsi16079596ejc.158.2022.09.16.23.40.59; Fri, 16 Sep 2022 23:41:25 -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=@163.com header.s=s110527 header.b=piZsHqUm; 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=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229550AbiIQG0e (ORCPT + 99 others); Sat, 17 Sep 2022 02:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiIQG0c (ORCPT ); Sat, 17 Sep 2022 02:26:32 -0400 Received: from mail-m972.mail.163.com (mail-m972.mail.163.com [123.126.97.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C9A048EA3 for ; Fri, 16 Sep 2022 23:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=n9TQa rA5HFDvEKCCTRUTj+Y9jic5HRzWblDS8dMVBcs=; b=piZsHqUmKrV9g5gYH+XAj slB5OEMIlxz0ZAfscZrxoOeOlX3lAZ/AkcO5Z9mIhOHDuouF0n15Dk/E0G9WNpUR CRn6XiG9w8tbgpts5xEtDjRKFKeeaG5xhILoM9KDL/puwJSbz/9Jl3yjoFnqESy0 vSa0KKfeecrW10IAbF9jsc= Received: from DESKTOP-CE2KKHI.localdomain (unknown [124.160.210.227]) by smtp2 (Coremail) with SMTP id GtxpCgC3K+5_aCVj8qg3eQ--.56440S2; Sat, 17 Sep 2022 14:26:09 +0800 (CST) From: williamsukatube@163.com To: nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org Cc: dan.j.williams@intel.com, vishal.l.verma@intel.com, dave.jiang@intel.com, William Dean Subject: [PATH -next] device-dax: simplify code in devm_register_dax_mapping Date: Sat, 17 Sep 2022 14:26:06 +0800 Message-Id: <20220917062606.1701-1-williamsukatube@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GtxpCgC3K+5_aCVj8qg3eQ--.56440S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFWfAFWDuw4xtr1fGFWrGrg_yoW3trX_Gr yrAFyxWwnIg3WfGw17Crn3Zry3tF1DuF4fZrs0qa43Gw18Ca1kuF4vyrnrCr97XrWxWr98 t3Z0gr1FyFnrGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRM5l8DUUUUU== X-Originating-IP: [124.160.210.227] X-CM-SenderInfo: xzlozx5dpv3yxdwxuvi6rwjhhfrp/1tbiUQF-g2DEPMIy+wAAs- X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 From: William Dean It could directly return 'devm_add_action_or_reset' to simplify code. Signed-off-by: William Dean --- drivers/dax/bus.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 1dad813ee4a6..251c53061764 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -772,11 +772,8 @@ static int devm_register_dax_mapping(struct dev_dax *dev_dax, int range_id) return rc; } - rc = devm_add_action_or_reset(dax_region->dev, unregister_dax_mapping, + return devm_add_action_or_reset(dax_region->dev, unregister_dax_mapping, dev); - if (rc) - return rc; - return 0; } static int alloc_dev_dax_range(struct dev_dax *dev_dax, u64 start, -- 2.25.1