Received: by 10.192.165.148 with SMTP id m20csp764168imm; Fri, 27 Apr 2018 07:10:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo4DPH/D5SRmOMwHHHzMl/msuGPyMOgQ9ATgYRuf4VkikkUfQA1NaWCXLvHGe8+eXty/sYA X-Received: by 10.98.102.79 with SMTP id a76mr2370254pfc.162.1524838231784; Fri, 27 Apr 2018 07:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838231; cv=none; d=google.com; s=arc-20160816; b=DM4wJemiN8AgOXhHfKyTfxaY8vdc42LrDAMqNuPPmmSOguj0SwA030floqfGhJ1zkX lcc70SLit1Pknh1CuZ4/TOgRvOIw764540EiMNYaFdXkcr6ntTWvoGNk9cQJ6WKz2LSY PiU/PLSpQ4O2oTgUP/9BYtqWqKgy2aapQDt6769vnTG2KY1M0CwinPnmDbZZyqLoYW4i aPv9SnBeVN+6knjqnF9L9LDKuvvdhxeE72t6nc1BGEdraKl05NmJxoAmWhdCWlBJWspH p8AlvYOipQRLKtbEusbj9AcT6BncjQPSpss+qVBDy1t67Jt0y87h+OZIc9kbc0o9YNB5 cYNw== 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=q7hhHXPVuFknG5tYJAYb73DXd4r/bFxObo9z09qtTlg=; b=IFdAi2bKR5KZ0UANvg+g+OtZ0YgIS++l1/GKPPvCp7ppRY8OBFbaNxgYETiClehL/5 AWrB46icTa5NXN48UgotQ1Od0Vqyx+HBg7aWI9PEWG3z3hzomoD2HgsfVYJxFgdHlktq JYIbwAnkLdTpYDCvwFBq7s7IHMdDBFzd52ifIbeflPI+V7q/UsOVh7CKw9ow4qFVMXH1 Pw+1bDalyTiAALPmxbAYHUmZvaMPa/DJZYbFK4FN8/4DJX9Uj4/MzqZRkjIciugJ/WMg Zi55NCWW6gSFEFN8blpiFwGAshUB3yxGehqIL4J5ofcWtI2pAgHYcaIplbe6hQoDboKy DiBA== 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.10.17; Fri, 27 Apr 2018 07:10:31 -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 S934634AbeD0OJN (ORCPT + 99 others); Fri, 27 Apr 2018 10:09:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:54544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934621AbeD0OJI (ORCPT ); Fri, 27 Apr 2018 10:09:08 -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 44644218BC; Fri, 27 Apr 2018 14:09:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44644218BC 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.14 72/80] block/swim: Rename macros to avoid inconsistent inverted logic Date: Fri, 27 Apr 2018 15:59:05 +0200 Message-Id: <20180427135736.636590672@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@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.14-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