Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2896074ybv; Mon, 24 Feb 2020 13:55:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzQvcW9XCtmPdIHiWs97KJjKSmNKZXgMT0sv+LrG2apXFb++iUZuZI5gZ8L+Nmmx/DG2tMN X-Received: by 2002:a05:6830:4a7:: with SMTP id l7mr39634543otd.372.1582581338464; Mon, 24 Feb 2020 13:55:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582581338; cv=none; d=google.com; s=arc-20160816; b=gRWDhGnqd/j4zjMN5E99+GGrMEfWFfqkslgBB7VI7xK1Iln0bwM8+AuHaiqIke/vP2 FaDaKUVFbecbYtHIRwvRC37s2YOTLBgYDPoWU+GJruKlRXP8ANzk/gQu97E3Ebc3Eopo 8w4H3c2yQ9wpAdhYi1idSC6+E41kI8mKPuVuvk1IJp5wRitcNNDrf01/IBEZ6c4WF/R0 YZPdjzyGtdPTjoLPsm/ovkjO6xzLjC6XspRKxHuWqdo25N2hO26Qk0w0fdNgEjMRPTcC iYTqDgIrAhu4pb7QROg56AdSckiwimeavJvYdW8ZgwjB9Ta8D45EGApdeVetNSnPjxyV ojVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5XuyignvH4d5GLfKgfJb+g8gkqcI95RWBR4W4WVX7AA=; b=dyxFxczrG86eztD6+PVhQkvvF89ja+csYLrAKg76fPvKdjM0h02KK5ZNn1qOQ13FKh tQyIqK0qWRmbafeuP9r3JtWJRlmnZehot5FRfjjZtV5N7vZEH3djd/LMY2l53xSX+GKi /kaEhlOEUNlABW+DT3CfcbIR5OiqqaqbDKJEfSbFIOs20B4Q0D0xIh7n8vyDWiy/pWh9 LNaxQKaD+KEYU6tf6b2osgNcX8xz/iV76DWY7LfcaZrLNgHafCSxlhb2rzJauxGuF717 2oYD/xBzF0b26Aekp06388caqxt1fHsg46HBzwy4IA3aHVENV/f6tGMBm7O0kCVO5L8+ cvxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AtiEK30p; 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 z129si5659973oia.17.2020.02.24.13.55.26; Mon, 24 Feb 2020 13:55:38 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=AtiEK30p; 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 S1728218AbgBXVyI (ORCPT + 99 others); Mon, 24 Feb 2020 16:54:08 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45473 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727554AbgBXVyH (ORCPT ); Mon, 24 Feb 2020 16:54:07 -0500 Received: by mail-lj1-f196.google.com with SMTP id e18so11775295ljn.12 for ; Mon, 24 Feb 2020 13:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5XuyignvH4d5GLfKgfJb+g8gkqcI95RWBR4W4WVX7AA=; b=AtiEK30pYt+3beHkK87zyVbW+qDAYJlbkd0TiDCu6tlrTVZ0Twny1U+XoXYS9WKUX8 BpZqBNxHSI+1oBqNYdIeDY8EcwnbNkUkPmT0bLEzVPa7lfTFcBkAqimEh73dLdvyJ4uh 87cz/bQOr0vU6VwfEOKctFokpv/75L2FGtd3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5XuyignvH4d5GLfKgfJb+g8gkqcI95RWBR4W4WVX7AA=; b=ZQUabXAiXVOrl8y3hg0m45e1JBax3jhiiN1y0b6QC29MdBZN/i1M/zpafDPTm40Ua/ 6EdLSGfpym7wtyMxli4WOWqGcmQBNaK9S97Crcix923YhBiVJlAwY0I/tM/9Y1PeLx+a PuGVnFT7ewGNa5ld4LA7lMyuAskvTAsIyDTLzxEEuLOqWbwh8hnxI2+YTqLuvVHaRLBD CSgX8jjEaBFc+MOgXgW3Xm0E02PJRk3DoEjTwlXvJY1lV2dCk/W48vXmICWKB3wxK3Dh vv1F+0jqzhMBMuwE4n5aKBCXuoTpexroHO9qQTdgExYrNPw79K8UIXm6ey8ksuYqoSD6 /wGA== X-Gm-Message-State: APjAAAV6vMuLCDRsgJQNZpelEYyNdQn9e+2IWHK9/D24Aw6RVqzm8Ior FBAlP69iRX6lKXCnNsZOTF6gb9GkpzE= X-Received: by 2002:a2e:8702:: with SMTP id m2mr32402456lji.278.1582581245033; Mon, 24 Feb 2020 13:54:05 -0800 (PST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id u9sm6729789ljk.33.2020.02.24.13.54.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Feb 2020 13:54:04 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id a13so11779677ljm.10 for ; Mon, 24 Feb 2020 13:54:04 -0800 (PST) X-Received: by 2002:a2e:909a:: with SMTP id l26mr30211282ljg.209.1582581243727; Mon, 24 Feb 2020 13:54:03 -0800 (PST) MIME-Version: 1.0 References: <20200224212352.8640-1-w@1wt.eu> <20200224212352.8640-2-w@1wt.eu> In-Reply-To: <20200224212352.8640-2-w@1wt.eu> From: Linus Torvalds Date: Mon, 24 Feb 2020 13:53:47 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 01/10] floppy: cleanup: expand macro FDCS To: Willy Tarreau Cc: Denis Efremov , Jens Axboe , Linux Kernel Mailing List , linux-block 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 On Mon, Feb 24, 2020 at 1:24 PM Willy Tarreau wrote: > > Macro FDCS silently uses identifier "fdc" which may be either the > global one or a local one. Let's expand the macro to make this more > obvious. Hmm. These macro expansions feel wrong to me. Or rather, they look right as a first step - and it's probably worth doing this just to have that "exact same code generation" step. But I think there should be a second step (also with "exact same code generation") which then renames the driver-global "fdc" index as "current_fdc". That way you'll _really_ see when you use the global vs local ones. The local ones would continue to be just "fdc". Because with just this patch, I don't think you actually get any more obvious whether it's the global or local "fdc" index that is used. So I'd like to see that second step that does the -static int fdc; /* current fdc */ +static int current_fdc; change. We already call the global 'drive' variable 'current_drive', so it really is 'fdc' that is misnamed and ambiguous because it then has two different cases: the global 'fdc' and then the various shadowing local 'fdc' variables (or function arguments). Mind adding that too? Slightly less automatic, I agree, because then you really do have to disambiguate between the "is this the shadowed use of a local 'fdc'" case or the "this is the global 'fdc' use" case. Can coccinelle do that? Linus