Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1268048rwd; Sun, 14 May 2023 16:25:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ62CGL3a4z22JGBLfrqnbhXUzv8hx4GqYCN+VRdJkitpEvzgNAHwLwitXFn0UcB8T71vNJQ X-Received: by 2002:a05:6a20:1612:b0:105:fd78:cb50 with SMTP id l18-20020a056a20161200b00105fd78cb50mr2491420pzj.42.1684106728690; Sun, 14 May 2023 16:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684106728; cv=none; d=google.com; s=arc-20160816; b=ipAveW6p4JbEwvWzmhPRAXlISFr2QGePg0PxQusVYEixt3eLxm9GkjwUcoEN2a18Ew 26VY61+FsP2wyBlGsE7op1jxyzqMju11utT8k2+w8gSspvTQJWAZ4iE0+oAJsLUGSMrp oTSkLaZ4gTXIyzjSMzf3q0nkUQ5hrcOc6Y4HxmeN36FsGDmOoUqJ6Z158KPweqRWdE56 17PgY8msCyO31Y3gkFNYopy5LkXKbU8EwqiOGXbX03R9IBIPDwEk7RXJzYIHHKGe1ptK 1DDzAc7cxd40p1bR0u/w0ERRqTzwduEzoquucdDRUyqVeHgb2J2z/Mli6UkiD7AbsOWj EYoQ== 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 :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=kYd1j0RXBpyBJ6t+mTLRHUGY0oI4ePJGe3Ut4FRsZdk=; b=M0jwai4/VeOD56M6hUT1anEKcojpAWplwRXdz8oI4ceuGoUA85/1WENc245olIiEQm 8U1Ixu5JJ1DX7v/WdUEJVhqQuBa9VMbR1fMhIaSbjLMCfv+T9Z70uN9e9WmjJePWurgk mAj/TYvsEXuircnv61U74aR/H0E9cXPlI71SUdm090fNOJBfafd87wAO/L/vk2EdF5Bx scwFXeaa8v6354JJASCuxCCKj9Pdl5OqFMarboCCNT1UuteIvtuFQSdz+PT6zIK+pFlS VzkBfPJohO5OHadEan5Y5nuJOPzKO5xUKXh/lvByjVfO3x8qMM1vTPETyIyszWTbtRWW VKmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="pbm/Xmn7"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a633d02000000b00528cea36032si16081870pga.10.2023.05.14.16.25.13; Sun, 14 May 2023 16:25:28 -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=@kernel.org header.s=k20201202 header.b="pbm/Xmn7"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233548AbjENWxZ (ORCPT + 99 others); Sun, 14 May 2023 18:53:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbjENWxY (ORCPT ); Sun, 14 May 2023 18:53:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DFF61BB; Sun, 14 May 2023 15:53:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D39C261267; Sun, 14 May 2023 22:53:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 930BBC433D2; Sun, 14 May 2023 22:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684104802; bh=hhVyC/OAoNTAaTDUMLdOJPMwd8d8UWMVRdN3Lw1WEsw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pbm/Xmn7WNwWfLiZpv3qGVDQG9SFqLDVYorUZ/kWU0MzbOQjwwOdvuDSG7TUGcHZ1 In9wg3WZ1wlrOJBQ18Ngg2hzQ+tGzlQ/oZZO9TaONmKP0WJK73RKTQDgykr7keO6OB 6xtignbQz6DMk1OxB8+1UWzYXW1g2gIXJvU/5sLkJVqxXdIloKjxEChUzscpInTOge IUkleJVRLCrQ1LVGd5/JFFmbuA5KaTpFvmmjqxAOqy6WYAmcDs1bJS4oBspHTp6g2t N1K8p/4xTfqBT9d9iEEvdyF8QuoOWM/K0tZTCqC/IrMgFCaWesm3D4kvDtV3MRwzvA fQvmbYx04Ys/w== Message-ID: Date: Mon, 15 May 2023 07:53:20 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2] ata: libata-core: Simplies if condition Content-Language: en-US To: Yahu Gao Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Yahu Gao , Jiwei Sun References: <20230422121415.6276-1-yahu.gao@outlook.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,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 On 4/28/23 10:53, Yahu Gao wrote: > ping ... > > 在 2023/4/22 20:14, Yahu Gao 写道: >> From: Yahu Gao >> >> Replace conditions of avoid issuing [P]IDENTIFY to PMP. Please be a little more descriptive. Something like: Simplify the condition used in ata_dev_revalidate() to not issue identify commands to port multiplier devices. would be better. >> >> Reviewed-by: Jiwei Sun Where does this review come from ? I have never seen an email for it. I cannot accept this tag without seeing the email for it. >> Signed-off-by: Yahu Gao >> >> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c >> index 14c17c3bda4e..53f65d751189 100644 >> --- a/drivers/ata/libata-core.c >> +++ b/drivers/ata/libata-core.c >> @@ -3802,11 +3802,7 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class, >> return -ENODEV; >> >> /* fail early if !ATA && !ATAPI to avoid issuing [P]IDENTIFY to PMP */ >> - if (ata_class_enabled(new_class) && Please keep the above "ata_class_enabled(new_class) &&" condition: if (ata_class_enabled(new_class) && new_class == ATA_DEV_PMP) { While keeping this condition is logically not necessary, having it makes the code easier to understand. >> - new_class != ATA_DEV_ATA && >> - new_class != ATA_DEV_ATAPI && >> - new_class != ATA_DEV_ZAC && >> - new_class != ATA_DEV_SEMB) { >> + if (new_class == ATA_DEV_PMP) { >> ata_dev_info(dev, "class mismatch %u != %u\n", >> dev->class, new_class); >> rc = -ENODEV;