Received: by 10.192.165.148 with SMTP id m20csp768099imm; Fri, 27 Apr 2018 07:14:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZohKb/iw1G1PLooF2sXfev7eVIih0Oa3Mj+NG5MYsfptf5VOR5/OMx5AeNzC8KdYSuLXaYN X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr2533424pld.268.1524838441683; Fri, 27 Apr 2018 07:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838441; cv=none; d=google.com; s=arc-20160816; b=jFmaRVXE5//+0YM0OOhJGZBxDvcJt3Ho1hYNlvDBxDSMyJwurzSvE9alZzss2NJiAF 5H2o9txOlew7iTVyvD46MZKey3jVsjORo0dZ0jjmhwaKGMJkmjTyVcvcQH3tC9RDrarW fNKYIECh1s4Y+BYrSLvrVMy9TZEzKBTBbiL0DYANcx/kwuLRY7T2YzgaOXT/a3i0Rv0O qmNRK8O0bcJKDyltTqOW7mGseWXXKO7IQIQYS4ZIsRcKbw070oZaExG6nk8LArE74kWL a9per685pdrCvtZWfqRKFikXB6oTFgzYYTxXA0glVGtsi7lXhMOcD/nI40sEuc2ISxbf JuSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=KCnk/XAjAee1ps++pw3ZUeiSGm1kcfSb0guWzSJZiQg=; b=LH59ptHlm0OtzTuYc5w8ZP9dh0gqYM9FKaULDYmMDbt/gnH2cN1I0F3NJQlwO9i9MM wgOenkC7GCW3Oq4eOyddyTMqpMBhlKVZZJ3eSY11si3C2rgRzmderMdF6bbtT/tv6WIr D0Dw3opi306IgUuLE+rbghlC82czFpRw+cvQRgFeF8WA/gqg+uY/qW7eK6Jk1GepKLxE GkO5wJReXbnmsnxLatJ1HtbR1GhD/Ax3EDmxO2VF8lBRqSr++Ode8Er7vHezMaO1At0e Wu446ZsO1eSkxSatndZvs8kW5MC9p5ZHC5Vj2gtWTa8eb3ivYJnZX+Ie/4mYlPl2JPLn x1GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si1278223pgu.612.2018.04.27.07.13.47; Fri, 27 Apr 2018 07:14:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935251AbeD0OMq (ORCPT + 99 others); Fri, 27 Apr 2018 10:12:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:57182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935010AbeD0OMm (ORCPT ); Fri, 27 Apr 2018 10:12:42 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FBA721895; Fri, 27 Apr 2018 14:12:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FBA721895 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laurent Vivier , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Jens Axboe , Stan Johnson , Finn Thain Subject: [PATCH 4.16 69/81] block/swim: Rename macros to avoid inconsistent inverted logic Date: Fri, 27 Apr 2018 15:59:11 +0200 Message-Id: <20180427135747.323596278@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Finn Thain commit 56a1c5ee54f69dd767fb61d301883dc919ddc259 upstream. The Sony drive status bits use active-low logic. The swim_readbit() function converts that to 'C' logic for readability. Hence, the sense of the names of the status bit macros should not be inverted. Mostly they are correct. However, the TWOMEG_DRIVE, MFM_MODE and TWOMEG_MEDIA macros have inverted sense (like MkLinux). Fix this inconsistency and make the following patches less confusing. The same problem affects swim3.c so fix that too. No functional change. The FDHD drive status bits are documented in sonydriv.cpp from MAME and in swimiii.h from MkLinux. Cc: Laurent Vivier Cc: Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org Cc: Jens Axboe Cc: stable@vger.kernel.org # v4.14+ Tested-by: Stan Johnson Signed-off-by: Finn Thain Acked-by: Laurent Vivier Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/swim.c | 8 ++++---- drivers/block/swim3.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -110,7 +110,7 @@ struct iwm { /* Select values for swim_select and swim_readbit */ #define READ_DATA_0 0x074 -#define TWOMEG_DRIVE 0x075 +#define ONEMEG_DRIVE 0x075 #define SINGLE_SIDED 0x076 #define DRIVE_PRESENT 0x077 #define DISK_IN 0x170 @@ -118,9 +118,9 @@ struct iwm { #define TRACK_ZERO 0x172 #define TACHO 0x173 #define READ_DATA_1 0x174 -#define MFM_MODE 0x175 +#define GCR_MODE 0x175 #define SEEK_COMPLETE 0x176 -#define ONEMEG_MEDIA 0x177 +#define TWOMEG_MEDIA 0x177 /* Bits in handshake register */ @@ -612,7 +612,7 @@ static void setup_medium(struct floppy_s struct floppy_struct *g; fs->disk_in = 1; fs->write_protected = swim_readbit(base, WRITE_PROT); - fs->type = swim_readbit(base, ONEMEG_MEDIA); + fs->type = swim_readbit(base, TWOMEG_MEDIA); if (swim_track00(base)) printk(KERN_ERR --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -148,7 +148,7 @@ struct swim3 { #define MOTOR_ON 2 #define RELAX 3 /* also eject in progress */ #define READ_DATA_0 4 -#define TWOMEG_DRIVE 5 +#define ONEMEG_DRIVE 5 #define SINGLE_SIDED 6 /* drive or diskette is 4MB type? */ #define DRIVE_PRESENT 7 #define DISK_IN 8 @@ -156,9 +156,9 @@ struct swim3 { #define TRACK_ZERO 10 #define TACHO 11 #define READ_DATA_1 12 -#define MFM_MODE 13 +#define GCR_MODE 13 #define SEEK_COMPLETE 14 -#define ONEMEG_MEDIA 15 +#define TWOMEG_MEDIA 15 /* Definitions of values used in writing and formatting */ #define DATA_ESCAPE 0x99