Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2886057ybv; Mon, 24 Feb 2020 13:41:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzsQ97gX9UYP93+lPqdeCzE/2BKNvJNbSHxByids1BlDVVAAI0IBlOrFPZshn7TH+oETIZr X-Received: by 2002:a9d:bb8:: with SMTP id 53mr37874018oth.150.1582580463908; Mon, 24 Feb 2020 13:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582580463; cv=none; d=google.com; s=arc-20160816; b=Z4MRJpHRjOu9luV7uWS5vkOvIYK8bS3mX8yu0rcT0mEsEcnAAqHPZbCChsfqrFFbXU sFWaf2Fde5wMj5LFESYfkvP8sA11rSSfNQSIlUBDTkxDaQ7y9R2nP7su/Mh6WZGMUwmb 2Xcrvc5XQFyFaIEawnKrNHEBk+0IMNf0Bw4B0hxSXvJBIGaau4pzIgmhOEIipD/cUu0J 9mzn6ax052im0FAqH7fokOto0BG35xw1GUvICjZfoM0Q0hKpThWPrhhQH5fUy/nEM+c9 VqWfQHylkS2KE9iQCyd64/k3mxPUyv9OkqtC0/QTXHfjKIJh4zRsyMWdhPvwFLKGBdDB e4nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=ZPSm9dclgi0mwKi7DT/pn580xdAXi9KkwSnsfKKEp4w=; b=vRk4Dyi5Ub3p8e2OZ7IEswAK6bbjCzRzVgjYBid8A2D84NJStdj2Fb1UWFQKEMax2g uSqaVLR4XiKVNvKeoYVZWsALpr3i9CKhZ8TBk7+9xA/sSzNShvRR82gj0i9JzKUOMgDM OulpauIIQ29BONmpFRdQV70HOh8iUd2QUUxAQEffPPo46/naBz8m9qge+iRMRTVzRWcr DVXIGk1/t2/f8IveC1IQ64DqsP/0aB9bot3SuIshJErcsnhDc69G7r3AG86ZBbJObsHC 3eQH1v8hY8Dk9OB+pbCzi2JAHWvHOgnuodTdZXFMYW7nbQDXoA7G2esop0pGBGl7XxXq zFpQ== 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 193si5171021oie.51.2020.02.24.13.40.51; Mon, 24 Feb 2020 13:41:03 -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 S1728086AbgBXVkm (ORCPT + 99 others); Mon, 24 Feb 2020 16:40:42 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:31498 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727554AbgBXVkl (ORCPT ); Mon, 24 Feb 2020 16:40:41 -0500 X-Greylist: delayed 986 seconds by postgrey-1.27 at vger.kernel.org; Mon, 24 Feb 2020 16:40:39 EST Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 01OLO4kA008691; Mon, 24 Feb 2020 22:24:04 +0100 From: Willy Tarreau To: Denis Efremov Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Linus Torvalds , Willy Tarreau Subject: [PATCH 00/10] floppy driver cleanups (deobfuscation) Date: Mon, 24 Feb 2020 22:23:42 +0100 Message-Id: <20200224212352.8640-1-w@1wt.eu> X-Mailer: git-send-email 2.9.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As indicated in commit 2e90ca6 ("floppy: check FDC index for errors before assigning it") there are some surprising effects in the floppy driver due to some macros referencing global or local variables while at first glance being inoffensive. This patchset aims at removing these macros and replacing all of their occurrences by the equivalent code. Most of the work was done under Coccinelle's assistance, and it was verified that the resulting binary code is exactly the same as the original one. The aim is not to make the driver prettier, as Linus mentioned it's already not pretty. It only aims at making potential bugs more visible, given almost all latest changes to this driver were fixes for out-of- bounds and similar bugs. As a side effect, some lines got longer, causing checkpatch to complain a bit, but I preferred to let it complain as I didn't want to break them apart as I'm already seeing the trap of going too far here. The patches are broken by macro (or sets of macros when relevant) so that each of them remains reviewable. I can possibly go a bit further in the cleanup but I haven't used floppies for a few years now and am not interested in doing too much on this driver by lack of use cases. Willy Tarreau (10): floppy: cleanup: expand macro FDCS floppy: cleanup: expand macro UFDCS floppy: cleanup: expand macro UDP floppy: cleanup: expand macro UDRS floppy: cleanup: expand macro UDRWE floppy: cleanup: expand macro DP floppy: cleanup: expand macro DRS floppy: cleanup: expand macro DRWE floppy: cleanup: expand the R/W / format command macros floppy: cleanup: expand the reply_buffer macros drivers/block/floppy.c | 971 +++++++++++++++++++++++++------------------------ 1 file changed, 499 insertions(+), 472 deletions(-) -- 2.9.0