mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carmeli Tamir <carmeli.tamir@gmail.com>
To: hirofumi@mail.parknet.co.jp, jthumshirn@suse.de,
	sergey.senozhatsky@gmail.com, akpm@linux-foundation.org,
	axboe@kernel.dk, martin.petersen@oracle.com, bvanassche@acm.org,
	linux-kernel@vger.kernel.org, carmeli.tamir@gmail.com
Subject: [PATCH 0/2] fat: Added macros to determine the FAT FS variant (12/16/32bit)
Date: Mon, 10 Dec 2018 14:41:55 -0500	[thread overview]
Message-ID: <1544470917-6443-1-git-send-email-carmeli.tamir@gmail.com> (raw)

Along the FAT FS code, the FAT variant (whether this is FAT12, FAT16 or FAT32) is
determined by checking the fat_bits field of struct msdos_sb_info. 
This is somewhat error prone as it forces the usage of magics (12, 16, 32)
multiple times in the code.

This series replaces the places in which the variant is checked with three simple
macros - IS_FAT12, IS_FAT16 and IS_FAT16.

The introduction of these simple macros makes a clearer API for determining the variant,
rather than searching the code for some field in a struct, and therefore
increases the code's maintainability and readability.

Carmeli Tamir (2):
  fat: Moved macros that won't work without fat.h
  fat: New macros to determine the FAT variant (32, 16 or 12)

 fs/fat/cache.c                |  2 +-
 fs/fat/dir.c                  |  4 ++--
 fs/fat/fat.h                  | 28 ++++++++++++++++++++++------
 fs/fat/fatent.c               | 17 +++++++----------
 fs/fat/inode.c                | 12 ++++++------
 fs/fat/misc.c                 |  2 +-
 include/uapi/linux/msdos_fs.h |  5 -----
 7 files changed, 39 insertions(+), 31 deletions(-)

-- 
2.7.4


             reply	other threads:[~2018-12-10 19:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 19:41 Carmeli Tamir [this message]
2018-12-10 19:41 ` [PATCH 1/2] fat: Moved macros that won't work without fat.h Carmeli Tamir
2018-12-10 19:41 ` [PATCH 2/2] fat: New macros to determine the FAT variant (32, 16 or 12) Carmeli Tamir
2018-12-10 20:09   ` Joe Perches
2018-12-14  3:16     ` OGAWA Hirofumi
2018-12-14  8:14       ` Tamir Carmeli
2018-12-14  9:49         ` OGAWA Hirofumi

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=1544470917-6443-1-git-send-email-carmeli.tamir@gmail.com \
    --to=carmeli.tamir@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=jthumshirn@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sergey.senozhatsky@gmail.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®