From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
Marcin Slusarz <marcin.slusarz@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH V2 11/13] drivers/block/floppy.c: Remove obfuscating CODE2SIZE macro
Date: Wed, 27 Jan 2010 13:28:17 -0800 [thread overview]
Message-ID: <1264627697.14552.100.camel@Joe-Laptop.home> (raw)
In-Reply-To: <cover.1264624291.git.joe@perches.com>
And use DIV_ROUND_UP instead
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/block/floppy.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 6124070..d559964 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -2143,7 +2143,6 @@ static void format_interrupt(void)
cont->redo();
}
-#define CODE2SIZE (ssize = ((1 << SIZECODE) + 3) >> 2)
#define FM_MODE(x, y) ((y) & ~(((x)->rate & 0x80) >> 1))
#define CT(x) ((x) | 0xc0)
@@ -2347,7 +2346,7 @@ static void rw_interrupt(void)
DRS->first_read_date = jiffies;
nr_sectors = 0;
- CODE2SIZE;
+ ssize = DIV_ROUND_UP(1 << SIZECODE, 4);
if (ST1 & ST1_EOC)
eoc = 1;
@@ -2647,7 +2646,7 @@ static int make_raw_rw_request(void)
raw_cmd->track = TRACK << STRETCH(_floppy);
DR_SELECT = UNIT(current_drive) + PH_HEAD(_floppy, HEAD);
GAP = _floppy->gap;
- CODE2SIZE;
+ ssize = DIV_ROUND_UP(1 << SIZECODE, 4);
SECT_PER_TRACK = _floppy->sect << 2 >> SIZECODE;
SECTOR = ((fsector_t % _floppy->sect) << 2 >> SIZECODE) +
FD_SECTBASE(_floppy);
prev parent reply other threads:[~2010-01-27 21:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 20:46 [PATCH 00/13] drivers/block/floppy.c cleanups Joe Perches
2010-01-27 20:46 ` [PATCH 01/13] drivers/block/floppy.c: Remove REPEAT macro Joe Perches
2010-01-27 20:46 ` [PATCH 02/13] drivers/block/floppy.c: Unclutter redo_fd_request logic Joe Perches
2010-01-27 20:46 ` [PATCH 03/13] drivers/block/floppy.c: Remove unnecessary argument from [__]reschedule_timeout Joe Perches
2010-01-27 20:46 ` [PATCH 04/13] drivers/block/floppy.c: Remove #define FLOPPY_SANITY_CHECK Joe Perches
2010-01-27 20:46 ` [PATCH 05/13] drivers/block/floppy.c: DPRINT neatening Joe Perches
2010-01-27 20:46 ` [PATCH 06/13] drivers/block/floppy.c: Use __func__ where appropriate Joe Perches
2010-01-27 20:46 ` [PATCH 07/13] drivers/block/floppy.c: Use %pf in logging messages Joe Perches
2010-01-27 20:46 ` [PATCH 08/13] drivers/block/floppy.c: Remove some unnecessary casting Joe Perches
2010-01-27 20:46 ` [PATCH 09/13] drivers/block/floppy.c: Convert raw_cmd_copyin from while(1) to label: goto Joe Perches
2010-01-27 20:46 ` [PATCH 10/13] drivers/block/floppy.c: Add __func__ to debugt Joe Perches
2010-01-27 20:46 ` [PATCH 11/13] drivers/block/floppy.c: Remove obfuscating CODE2SIZE macro Joe Perches
2010-01-27 21:16 ` Jiri Slaby
2010-01-27 20:46 ` [PATCH 12/13] drivers/block/floppy.c: Remove misleading, used once FD_IOCTL_ALLOWED macro Joe Perches
2010-01-27 20:46 ` [PATCH 13/13] drivers/block/floppy.c: Remove unnecessary casting in fd_ioctl Joe Perches
2010-01-27 21:28 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264627697.14552.100.camel@Joe-Laptop.home \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=bzolnier@gmail.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.slusarz@gmail.com \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®