Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2197650rwr; Fri, 21 Apr 2023 05:56:24 -0700 (PDT) X-Google-Smtp-Source: AKy350YK6ozh/rRDEBROo7b+oqSHxW6lit2CwKVt+9wHzuBv/kysM1luOFFj6x1uNP/h9jv7N+HO X-Received: by 2002:a05:6a00:14cf:b0:63b:5257:6837 with SMTP id w15-20020a056a0014cf00b0063b52576837mr5673898pfu.1.1682081783939; Fri, 21 Apr 2023 05:56:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682081783; cv=pass; d=google.com; s=arc-20160816; b=KxzFi5tx4wHtciWYl28eX7rOR+SMmoDQltNRh8Noz/cHyGZkC5weeqbH3+IGXjRrqa 8sBU3n83E7UvQo7VTqhlM9Y5NW41Ty+1oFr3EUoSJyFdn6qbmFMdm4/UqXaOMM/Lxo1j YH5GcpVAJ3GARANYRWiqAIrRoyfq7gJ75yHh0rBeYl4s3qQqvDTnMYBn/nMROV703FLv yBjzXn1dvy8fkSk9ZW3oDqgFqznk6ItF6raxp67maaMTYgDlPq8gq7mTRjCKL6xeCvrL cysNvEWuegj4srqVjikj3xWxsvvlJ30ic5S1M5Ic/Ilo9Q0lcA3tyLHGhpwMR4K8Dpi2 d93A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=MY2pTY8kUUdFTh2z8x8In2ZsYg1xABHrgzb1S/dzqZY=; b=YZlqDADeIivMIucp+DZrLWDQBiy0Iu8hq3Xsy9/8RoiW642mEoHpxTdJA68VCr9gP6 NkBqwvQlXqUf2MnlQThkrMF0qfhh3PCgvj2QYM9It/D7MmdgGwW8nDLOsCCZmq7eSzXf Der5N5VZGRTndmElfyoCXTdy7Z4N37ol+usFXHFCCdYZqXoZeZuwKLjVOPjQEtS1V9zv BytsGWo//JuH8W+YBOV304Az8u7/8st/yArroAdyLZYmO4ZssuhgZ9NUntnzgDL88z3d An3VlovNsMP1SNuzGHIHL6cWREX2ezZVh1pc+QeUbqweJcC5c8q1GymSmYIjA5JjoVoI /GMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@outlook.com header.s=selector1 header.b=ewsilWUF; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=outlook.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r29-20020aa7963d000000b0063f18073138si1966655pfg.99.2023.04.21.05.56.11; Fri, 21 Apr 2023 05:56:23 -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=@outlook.com header.s=selector1 header.b=ewsilWUF; arc=pass (i=1); 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=QUARANTINE dis=NONE) header.from=outlook.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232120AbjDUMz2 (ORCPT + 99 others); Fri, 21 Apr 2023 08:55:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjDUMz0 (ORCPT ); Fri, 21 Apr 2023 08:55:26 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2057.outbound.protection.outlook.com [40.92.98.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 129723590; Fri, 21 Apr 2023 05:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ElZK0Ev5rbTb2cVIf+mQGDZYO4g9dA8HXoZLj5a+N5iegW8YwPnaGwvuDm4GBoofbOX1c+x5OUhxAHea8NlgidGsVmvpVfym5q9J83NdBYSd2R0KO0HNGBSjk3cRvV4geHKvfKsmY/ZyUagwmqoTflfL2KhJ2q2GEwXaItW//TO8TYkR8A2q5aenZi1sZIOVxLSJz21xnOqmXME0AaJNrYuZsdlYEQoPNSyAlf6n+sXwAQ57SgTrX1mihI00ycRIvZ6khloX/l0wJds5lJG/XBFaivpWILnwVeXw1kxqx+XGrS79zuxkWtrV4aK0K3eRFZm8TGIHIhnVs1vk8Baebg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MY2pTY8kUUdFTh2z8x8In2ZsYg1xABHrgzb1S/dzqZY=; b=NR+x30MF09MJcRRUfixJ8HaysHl3Fe5MFsW2oj911dBHjkmtA6LBiOspg8EiSH5PGh1tXDkUMJ2LXU605Fzb3qTHrb7IjaBwg2rL6jQjKRjuFjvVTld1IIOgHstiGGfT2XPY7NhFSh0f6hfZtRHNGk/PEXAcqhi0nT+KTiIsPmE9B8U1mhbO/Y94Qba3x9qfl0r3nvg0GZ+6VwaCo4tW8Mq+pmD1eWoCtS5nYxI6CCDD5Ijltui91o0wxxP6j1TZ/khotKPvyhWIVJmALxIX7aSUqMUIHLIBP3jlc681B7xjpycSh8gIyso1Asv1UBnJ6zpDxwT7TLceiVa46yVg5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MY2pTY8kUUdFTh2z8x8In2ZsYg1xABHrgzb1S/dzqZY=; b=ewsilWUFqa/b/bs0oYGUKqDUqhzN4dLWSr5fVr6SySI2dtBNTw40b6GA7FV58V+CCnYg32oxH/0brwqtfcPo7eVHnhdBPdx6Bcl01ZHutNSmbvPxtvWEOoIh6tTDjsTvsvCzBLJhrxTNFUvKS/dmk5AvnaRjaeifDeMpMSmNcp6HxsF2/T6MWVPtQ5lxIjoIawnuto5BLD8IKoF9MzvV+gMtXaZ69leozQ/JkRRt0MqzM3Hf5fN0k80VRoTa/MQHoVma0IQ8dmJqe0119kZrtGmcFrUql7dzHhfK1c7l0bWgMHTwV+pVbU7MVcFA6XBfN5tt4Bd6Ci7JySnmiPvCPA== Received: from OS3P286MB0632.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:d9::7) by OSZP286MB2459.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:15d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 12:55:22 +0000 Received: from OS3P286MB0632.JPNP286.PROD.OUTLOOK.COM ([fe80::4ac1:a1e6:7a7:f317]) by OS3P286MB0632.JPNP286.PROD.OUTLOOK.COM ([fe80::4ac1:a1e6:7a7:f317%3]) with mapi id 15.20.6319.022; Fri, 21 Apr 2023 12:55:22 +0000 From: Yahu Gao To: dlemoal@kernel.org Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, yahu.gao@outlook.com, Yahu Gao , Jiwei Sun Subject: [PATCH] drivers/ata: Improve performance and readability Date: Fri, 21 Apr 2023 20:54:40 +0800 Message-ID: X-Mailer: git-send-email 2.39.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [ZOTzQl5VOUNvbPwkkRwHdbMRzhAbQrqb] X-ClientProxiedBy: SG2PR01CA0197.apcprd01.prod.exchangelabs.com (2603:1096:4:189::8) To OS3P286MB0632.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:d9::7) X-Microsoft-Original-Message-ID: <20230421125440.3365-1-yahu.gao@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3P286MB0632:EE_|OSZP286MB2459:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c5d464b-45ba-4aa7-3608-08db4267aac5 X-MS-Exchange-SLBlob-MailProps: quCBMN2EvO+pwSJDZ6uR9xq1vwH3MjLkzsJ7EDxhfx7TqHfQJTxHQmnSagDGwE+KsQm1mE7x9zCpSpOm8/XkHRhBRfXDUSEPziIrZ1lmtKAgNNKRhiFKRWOLv7SDR+hTuAcGX9z6aoU8A48k6DYx4n5qIhv3CD9/AyA4TBM6338MUKCRY8QzqL3izXoHVTj4vUegIe2kFUHoSjNEFBF4FY2IcbxH5i+HE9uN3YFBq+BoHzzZtHecs8cOdQNA2hy4iYIkzElInG4fsRzLOiC1m/IX5vYmEkf1yxWSZXaz+Cba80GhODp4zH94zMiYj1BE/49Nswdhn6GDQ+zsBlc7iw7L4GvAC977kteNloQydHHtAKWvSJc64m3p8ZLE368VVmmckwI3agv43IUd/LT92kQdEW4OZn6NvZT+KoPcx/m+ov3pnFmucgK7RPXhhXSobcVRwGbMPw5YcP3IgwajUvO+JPWcbbp+dJHcb1iYsp6cTNUa6WDWwNH9eR3XbYBAQYmUIKCGetHcbyJOQMwXexIyfWOYIKWCdoDsUQczQFeH0nMhasSKoLvmsZe6P6ueQkPh56lSqDlWhjCic/HT60kCTIOedZ1hWNNiHXZEYzhNk7NflOw5kH0ai3vFsF2Mj3i9tcPCnxEqeP822dQ4pcoEn9vxzUzpTSflxChKW+4Fw/44/OJpnWjXbk58Ha9LBZuP+NrgOISXCLHKLJwaGw== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qnAvCd0yEedOB6KcVkiN9GDVHu0G9JXy171Cq68aj7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ZWpsRHFFE19AGNjJn7HRK1uk3fg=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c5d464b-45ba-4aa7-3608-08db4267aac5 X-MS-Exchange-CrossTenant-AuthSource: OS3P286MB0632.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 12:55:22.1650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZP286MB2459 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,RCVD_IN_MSPIKE_H2,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 From: Yahu Gao Replace conditions of avoid issuing [P]IDENTIFY to PMP. Reviewed-by: Jiwei Sun 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) && - 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; -- 2.39.1