Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3953254ybv; Tue, 25 Feb 2020 10:17:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxk5qFW1Gnh+S3p9sj02IwTEuDZ8UX4uYWqKD2YVPDJXzlFVjkG3XRg5pL1QTwSHVODf38u X-Received: by 2002:aca:c709:: with SMTP id x9mr179399oif.130.1582654630933; Tue, 25 Feb 2020 10:17:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582654630; cv=none; d=google.com; s=arc-20160816; b=e2xhoY28krJy6zN1Bh8I0+kPS0jPmDCxefI8tw19sGsbIs2XPiBypcdYFm+1OziFCV 8EmPH2LXfsxZhENE1zgCu58+6bde9ASKuI7OF69Wgtzvl54WVq3LYTqndYnorGblc4Yy SisHZOedvKuUFRD0MS+ZT6h7ee+bBOVJBAy13qGUKszZdRhuTKZAylVX6PWOVx7tX5jp ggaEAUWmAukrzH9vkPW2mTgMhkgiWP71rKCNO0jZ3MxhnBj/fl5mtb4C/rst4ruzC287 7TXfa1BPDORR5somJADoZS7+V5W7I+AZDPQPZLGOEDhzsovDMy7ah5Ay6SotLys1/XZY 6FMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UvK4chv0ycqniPTTYXnMbgA4t3mTwavjt7WtOqsAgHE=; b=yjDAoeMgwfaEn8ljsBAaObX4T7c0xgAoZXG++yxnW0rkw2Rdzr/+TBmkZgbAOY8hKh hocLr3lY+NF9EhdyrW974wP6s8lovkxB721NmHZkqPcsuKHV98GGlPMa+hUet7Vp1dz4 sB1HS1fHZ7DRs/+kvYOEPYHcluNQHceY+A2mFCNA0iBab8ATaZIu1IbYovXaxRxyV7WZ tws7W9r25DQ5zyTVa4rGSJBuXkw4Go5uRzskHl3AtXB/45GIZf3G33AcmszatARNtjvz OkJg4p2e76znc5S8ClUykJC7Ikk2U/pQJkxuM0r+dzyQaj8azv4jb8O2j4yaDHvnCzxw haZA== 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 l80si7129119oib.268.2020.02.25.10.16.57; Tue, 25 Feb 2020 10:17:10 -0800 (PST) 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 S1731418AbgBYSPw (ORCPT + 99 others); Tue, 25 Feb 2020 13:15:52 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:31550 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbgBYSPw (ORCPT ); Tue, 25 Feb 2020 13:15:52 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 01PIFfwi001143; Tue, 25 Feb 2020 19:15:41 +0100 Date: Tue, 25 Feb 2020 19:15:41 +0100 From: Willy Tarreau To: Linus Torvalds Cc: Denis Efremov , Jens Axboe , Linux Kernel Mailing List , linux-block Subject: Re: [PATCH 01/10] floppy: cleanup: expand macro FDCS Message-ID: <20200225181541.GA1138@1wt.eu> References: <20200224212352.8640-1-w@1wt.eu> <20200224212352.8640-2-w@1wt.eu> <28e72058-021d-6de0-477e-6038a10d96da@linux.com> <20200225034529.GA8908@1wt.eu> <20200225140207.GA31782@1wt.eu> <10bc7df1-7a80-a05a-3434-ed0d668d0c6c@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 25, 2020 at 10:08:51AM -0800, Linus Torvalds wrote: > On Tue, Feb 25, 2020 at 7:22 AM Denis Efremov wrote: > > > > I think that for the first attempt changing will be enough: > > -static int fdc; /* current fdc */ > > +static int current_fdc; /* current fdc */ > > and > > -#define FD_IOPORT fdc_state[fdc].address > > +#define FD_IOPORT fdc_state[current_fdc].address > > Please don't do this blindly - ie without verifying that there are no > cases of that "local fdc variable shadowing" issue. That's exactly what I'm doing. In fact I first renamed the variable and am manually checking all places which do not compile anymore. Hence the surprizes. > Of course, such a verification might be as easy as "generates exact > same code" rather than looking at every use. That's exactly what I'm doing. > And btw, don't worry too much about this being in an UAPI file. I'm > pretty sure that's because of specialty programs that use the magical > ioctls to do special formatting. They want the special commands > (FD_FORMAT etc), but I don't think they really use the port addresses. > > So I think it's in a UAPI file entirely by mistake. OK this will help me, thanks for the hint :-) > We should at least try moving those bits to the floppy.c file and > remove it from the header file. Makes sense. > For example, doing a Debian code search on "FDPATCHES" doesn't find > any user space hits. Searching for "FD_STATUS" gets a lot of hits, but > thos all seem to be because it's a symbol used by user space programs, > ("file descriptor status"), not because those hits actually used the > fdreg.h header file. > > So we can remove at least the FD_IOPORT mess from the header file, I bet. > > Worst case - if somebody finds some case that uses them, we can put it back. I like that. And at least we'll know how they use it (likely without the dependency on fdc). Thanks, Willy