From patchwork Tue Mar 7 22:45:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 65949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp10789wrd; Tue, 7 Mar 2023 15:04:18 -0800 (PST) X-Google-Smtp-Source: AK7set//wibp+jc0NeBFNe/4xMjE7b2QUtGDBSTVS22xDjTv/FPHSFW+xwNI+TFMECBanSLzZs+z X-Received: by 2002:aa7:c1c4:0:b0:4c5:bc48:d422 with SMTP id d4-20020aa7c1c4000000b004c5bc48d422mr13123524edp.7.1678230258685; Tue, 07 Mar 2023 15:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678230258; cv=none; d=google.com; s=arc-20160816; b=SL2tFqcibPbiI3lQNl4hPYcBjQ7f+9yU4iyI8t6JM37UPVyBpjnNzqsqmdrJ/71ErV 6VvcmarBvM6gZDVfvN4IRUzk16Ahm4SKkot1ygVnweJnRy8VIpoxtl/VbqDr1Vu0eWYw SMo9Lcc58tEyTBe1hIx+O4zBdbn0T4mynqVp46aSlU7AVDTSRYcYGADFnDwnwYjI9f3K feQhY4VCnT150coA2Gu6FEfbVf2B+g2hjWcMrh5fi0FxKifGWgxvVsRmRQi0ZU/jh7qi LIpkqmL/MRTu3min6EiswIDB81kr1G2Q4Oy5kQIpaaekyvftO9HOaqnQNppWvKHq3IRF vcSA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=i5s39yySUz+SHiMEbv7pflgYBsYdlWC40wAlOX/X4EI=; b=yqohPwR4w+DknPwH31Ie4B4hKFv6Sjcu6o39o3raIv5PFLe6S+fyRjs7yBAvwLpunc 0JOKAAMvxa1qaX8KNZz7V3QMJ2daEKEOcoqlljfBXyDLn5DAclFMxd1dn1QXTEySHZp9 brJ4meH9vcHTInXv0UJHhmY/Wi3yjDLErXXQ4ingDtTxE+eo0L1JCenEA4fcqZ0A2GPA gNmp1IqKOj3sXVzqSJQnyVxG8q71BFqRmLAhKbvM/no9jq6x4MvW5eoe3sait9zuyoDe Vw9zE140uc7bTrvgIWN5sxjhOysSj6FosO0QHwo4Fy7Y9KvLRpAasIzlvmcWuNs/tFCJ 9rKQ== ARC-Authentication-Results: i=1; mx.google.com; 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 di8-20020a170906730800b008b17569b4d9si5612980ejc.361.2023.03.07.15.03.54; Tue, 07 Mar 2023 15:04:18 -0800 (PST) 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; 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 S231135AbjCGWrM (ORCPT + 99 others); Tue, 7 Mar 2023 17:47:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjCGWrB (ORCPT ); Tue, 7 Mar 2023 17:47:01 -0500 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3DFF240D2; Tue, 7 Mar 2023 14:46:49 -0800 (PST) Received: from gsql.ggedos.sk (off-20.infotel.telecom.sk [212.5.213.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id 2A4F67A0568; Tue, 7 Mar 2023 23:46:48 +0100 (CET) From: Ondrej Zary To: Damien Le Moal , Sudip Mukherjee Cc: Christoph Hellwig , Sergey Shtylyov , Jens Axboe , Tim Waugh , linux-block@vger.kernel.org, linux-parport@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/32] pata_parport-bpck6: don't cast pi->pardev to struct pardevice * Date: Tue, 7 Mar 2023 23:45:58 +0100 Message-Id: <20230307224627.28011-4-linux@zary.sk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230307224627.28011-1-linux@zary.sk> References: <20230307224627.28011-1-linux@zary.sk> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759751971481292345?= X-GMAIL-MSGID: =?utf-8?q?1759751971481292345?= pi->pardev is struct pardevice *, no need to cast it to the same type. Also clean up the return mess. Signed-off-by: Ondrej Zary Reviewed-by: Sergey Shtylyov --- drivers/ata/pata_parport/bpck6.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c index 4d6edb9c1245..fa1f7d4fe3cb 100644 --- a/drivers/ata/pata_parport/bpck6.c +++ b/drivers/ata/pata_parport/bpck6.c @@ -74,30 +74,18 @@ static void bpck6_disconnect(struct pi_adapter *pi) static int bpck6_test_port(struct pi_adapter *pi) /* check for 8-bit port */ { dev_dbg(&pi->dev, "PARPORT indicates modes=%x for lp=0x%lx\n", - ((struct pardevice *)(pi->pardev))->port->modes, - ((struct pardevice *)(pi->pardev))->port->base); + pi->pardev->port->modes, pi->pardev->port->base); /*copy over duplicate stuff.. initialize state info*/ PPCSTRUCT(pi)->ppc_id=pi->unit; PPCSTRUCT(pi)->lpt_addr=pi->port; - /* look at the parport device to see if what modes we can use */ - if(((struct pardevice *)(pi->pardev))->port->modes & - (PARPORT_MODE_EPP) - ) - { - return 5; /* Can do EPP*/ - } - else if(((struct pardevice *)(pi->pardev))->port->modes & - (PARPORT_MODE_TRISTATE) - ) - { + /* look at the parport device to see what modes we can use */ + if (pi->pardev->port->modes & PARPORT_MODE_EPP) + return 5; /* Can do EPP */ + if (pi->pardev->port->modes & PARPORT_MODE_TRISTATE) return 2; - } - else /*Just flat SPP*/ - { - return 1; - } + return 1; /* Just flat SPP */ } static int bpck6_probe_unit(struct pi_adapter *pi)