Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp406322rwb; Sun, 25 Sep 2022 23:49:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YIckZIt/UJbxv69r7fBRAPk2iSly9jzBVV/bxYTJxrwd5X4oYVCRPqXw+9NUT7G7th82V X-Received: by 2002:a05:6402:1767:b0:457:205c:433c with SMTP id da7-20020a056402176700b00457205c433cmr6943548edb.83.1664174970126; Sun, 25 Sep 2022 23:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664174970; cv=none; d=google.com; s=arc-20160816; b=ZNn7tmwFLkSAqKQGHUhXakBKXK48HK1JFJM9Ha+twknG6DM5dchAr/bLhhbNo7L3t6 OboxcVeH1NZziGncl+9tSybzav1imSxUFBq1cDyAAs8qtc7yt+wF+9bcKKA0jt0ieYBc qbtHpeST1sYCXKLymm9/yZC95aTMrGqLdT95k4ek5xZOdE4D4dPpL9l3LVIl9lGG8Gml XKj2PW+0kknAK7Ff69zGMVYfoysH3E7uO9GYTa5kcjorYwQzyzI39My8a0xb3QUYdUrk g5i+gggji2ILRk7MO2W7Cfkiit94iOA8wRLCQm5g9DGviJ4kLckCuoHneasHTUD4i2EQ F6dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sQb2JmefVYNSR5MgcX37Ilj9xnV/1y4mDFuh2VtRjEc=; b=VCc5Nf09KsaRC42jcp9yK/3djb/cTIoziKmm9Rgjx66CvZd4U/VZtF4QH0KOQatcTi YvTv7M9shFHEVZN3XkQ0/t8R/sedlsKB7Agh9lRWMLd+ip2s1BXUaDwG25iVSi8Pgipj +h5CCkWTDAXMCLBNJqG+WOWnoPH1KOMPbvnza3XRxWldzLmXvM/L/h+/oli9cktD7S0P 5v0J6eYwLIFm+Z8vYoQ2w2OOWn1QdDjr1ajE/0FVv56POLjVK/mrekmycDHZ9D0WW74d 1JrAHkkIgvgB3uqlguH3z9XA+AwDPi+J/ALM+/NA7kMN15oymKQcqKosqTqi4kS5Xf6g wsXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="AvYivGI/"; 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=ionos.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji13-20020a170907980d00b007836cf66256si3292609ejc.596.2022.09.25.23.49.05; Sun, 25 Sep 2022 23:49:30 -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=@ionos.com header.s=google header.b="AvYivGI/"; 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=ionos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233222AbiIZGJ3 (ORCPT + 99 others); Mon, 26 Sep 2022 02:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232425AbiIZGJ1 (ORCPT ); Mon, 26 Sep 2022 02:09:27 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3224AA185 for ; Sun, 25 Sep 2022 23:09:26 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id w8so9149259lft.12 for ; Sun, 25 Sep 2022 23:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=sQb2JmefVYNSR5MgcX37Ilj9xnV/1y4mDFuh2VtRjEc=; b=AvYivGI/oFyhxCAUC0JBlztAoDXQX238Ae2UmwTjy8xt16mJeLjVq4bbWv8BEFNyjG n5n4sbjqE4JaHlk5LYDOvhXoF6LAiioLA+koGnvdSiT1r/9FDd7cCyZIqbI4YZfetSC5 v3nTte2CORbMLep618e3saY8Ute37/KuqIpRE5Qwb7wL5p0eBNlYCWKjqPzJpdii/xX/ t7O7ZN6fc5gzfWgraJ53gI9rRtHT0x5IbSZhbOmPVF6I0fPuPQQeuxAEC6/VFjP3u09E pn8skrkLYBSgmmRVTkUszlGEnw4+sNmLcITd7xeM9UkMtckr22RM8Fpn6t1JVbRUfek9 mANQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=sQb2JmefVYNSR5MgcX37Ilj9xnV/1y4mDFuh2VtRjEc=; b=QnQVNlZwqEQTiELtiG+MNTTo2a0axdMZ8MJXKk/wGn6nKbvRL1cMgUbDXrEMsim9FU I5p9NWhI6YTtbCDyXcVOQt/ZXMBlnnuLQLsceRNYE/YtbM2sfst7KbDsZ89xm8bVwN+B Nh+JRFPodWclW8C1jOOOvJrglv4fgS806aTGVQ3FP2ZeAiLsqhsC+DbGNoS2+uNwimeu Xv7bP5+8fErvqcykESUHBB9NPPb3GVpz8PIV7XbP/TV88IMSq/dxTy/HrNdXSwdmvZdn qSrXLQK45EHmV/28/5F5K9Bh5eb0weuMWz5PX5AcT8FOLlfY1dERG4KVw7GgE8hmwcQ7 N9+A== X-Gm-Message-State: ACrzQf2TdnynNyP0BacAr/q9y5tFu1aSXQpHowo6Bk1RAUj9gN9elNgs +kbHBnf5rDTJx/GYEHxv1VaClX7KTEdKXVcOilfKnw== X-Received: by 2002:a05:6512:1087:b0:49e:5f7b:ffad with SMTP id j7-20020a056512108700b0049e5f7bffadmr9089274lfg.471.1664172564462; Sun, 25 Sep 2022 23:09:24 -0700 (PDT) MIME-Version: 1.0 References: <20220924073455.2186805-1-yanaijie@huawei.com> In-Reply-To: <20220924073455.2186805-1-yanaijie@huawei.com> From: Jinpu Wang Date: Mon, 26 Sep 2022 08:09:13 +0200 Message-ID: Subject: Re: [PATCH v2 0/8] scsi: libsas: sas address comparation refactor To: Jason Yan Cc: martin.petersen@oracle.com, jejb@linux.ibm.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hare@suse.com, hch@lst.de, bvanassche@acm.org, john.garry@huawei.com, jinpu.wang@ionos.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE 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 Sat, Sep 24, 2022 at 9:24 AM Jason Yan wrote: > > Sas address conversion and comparation is widely used in libsas and > drivers. However they are all opencoded and to avoid the line spill over > 80 columns, are mostly split into multi-lines. > > To make the code easier to read, introduce some helpers with clearer > semantics and replace the opencoded segments with them. > > v1->v2: > First factor out sas_find_attached_phy() and replace LLDDs's code > with it. > Remove three too simple helpers. > Rename the helpers with 'sas_' prefix. > Hi Jason, Thx for doing this. > Jason Yan (8): > scsi: libsas: introduce sas_find_attached_phy() helper > scsi: pm8001: use sas_find_attached_phy() instead of open coded > scsi: mvsas: use sas_find_attached_phy() instead of open coded > scsi: hisi_sas: use sas_find_attathed_phy() instead of open coded These 4 look good to me. Reviewed-by: Jack Wang > scsi: libsas: introduce sas address comparation helpers > scsi: libsas: use sas_phy_match_dev_addr() instead of open coded > scsi: libsas: use sas_phy_addr_same() instead of open coded > scsi: libsas: use sas_phy_match_port_addr() instead of open coded These helpers are too simple to replace, we add more loc in the end. > > drivers/scsi/hisi_sas/hisi_sas_main.c | 12 ++------ > drivers/scsi/libsas/sas_expander.c | 40 ++++++++++++++++----------- > drivers/scsi/libsas/sas_internal.h | 17 ++++++++++++ > drivers/scsi/mvsas/mv_sas.c | 15 +++------- > drivers/scsi/pm8001/pm8001_sas.c | 16 ++++------- > include/scsi/libsas.h | 2 ++ > 6 files changed, 54 insertions(+), 48 deletions(-) > > -- > 2.31.1 >