mtd: cleanup last uses of MTD_DEBUG config macros
Some messages that were tied to CONFIG_MTD_DEBUG_VERBOSE can now simply be enabled using dynamic debugging features, if necessary. There's no need for special debugging functions here. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
This commit is contained in:
committed by
Artem Bityutskiy
parent
87ed114bb2
commit
278981c541
@@ -139,24 +139,20 @@ static int find_boot_record(struct INFTLrecord *inftl)
|
|||||||
mh->FormatFlags = le32_to_cpu(mh->FormatFlags);
|
mh->FormatFlags = le32_to_cpu(mh->FormatFlags);
|
||||||
mh->PercentUsed = le32_to_cpu(mh->PercentUsed);
|
mh->PercentUsed = le32_to_cpu(mh->PercentUsed);
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_DEBUG_VERBOSE
|
pr_debug("INFTL: Media Header ->\n"
|
||||||
if (CONFIG_MTD_DEBUG_VERBOSE >= 2) {
|
" bootRecordID = %s\n"
|
||||||
printk("INFTL: Media Header ->\n"
|
" NoOfBootImageBlocks = %d\n"
|
||||||
" bootRecordID = %s\n"
|
" NoOfBinaryPartitions = %d\n"
|
||||||
" NoOfBootImageBlocks = %d\n"
|
" NoOfBDTLPartitions = %d\n"
|
||||||
" NoOfBinaryPartitions = %d\n"
|
" BlockMultiplerBits = %d\n"
|
||||||
" NoOfBDTLPartitions = %d\n"
|
" FormatFlgs = %d\n"
|
||||||
" BlockMultiplerBits = %d\n"
|
" OsakVersion = 0x%x\n"
|
||||||
" FormatFlgs = %d\n"
|
" PercentUsed = %d\n",
|
||||||
" OsakVersion = 0x%x\n"
|
mh->bootRecordID, mh->NoOfBootImageBlocks,
|
||||||
" PercentUsed = %d\n",
|
mh->NoOfBinaryPartitions,
|
||||||
mh->bootRecordID, mh->NoOfBootImageBlocks,
|
mh->NoOfBDTLPartitions,
|
||||||
mh->NoOfBinaryPartitions,
|
mh->BlockMultiplierBits, mh->FormatFlags,
|
||||||
mh->NoOfBDTLPartitions,
|
mh->OsakVersion, mh->PercentUsed);
|
||||||
mh->BlockMultiplierBits, mh->FormatFlags,
|
|
||||||
mh->OsakVersion, mh->PercentUsed);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mh->NoOfBDTLPartitions == 0) {
|
if (mh->NoOfBDTLPartitions == 0) {
|
||||||
printk(KERN_WARNING "INFTL: Media Header sanity check "
|
printk(KERN_WARNING "INFTL: Media Header sanity check "
|
||||||
@@ -200,19 +196,15 @@ static int find_boot_record(struct INFTLrecord *inftl)
|
|||||||
ip->spareUnits = le32_to_cpu(ip->spareUnits);
|
ip->spareUnits = le32_to_cpu(ip->spareUnits);
|
||||||
ip->Reserved0 = le32_to_cpu(ip->Reserved0);
|
ip->Reserved0 = le32_to_cpu(ip->Reserved0);
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_DEBUG_VERBOSE
|
pr_debug(" PARTITION[%d] ->\n"
|
||||||
if (CONFIG_MTD_DEBUG_VERBOSE >= 2) {
|
" virtualUnits = %d\n"
|
||||||
printk(" PARTITION[%d] ->\n"
|
" firstUnit = %d\n"
|
||||||
" virtualUnits = %d\n"
|
" lastUnit = %d\n"
|
||||||
" firstUnit = %d\n"
|
" flags = 0x%x\n"
|
||||||
" lastUnit = %d\n"
|
" spareUnits = %d\n",
|
||||||
" flags = 0x%x\n"
|
i, ip->virtualUnits, ip->firstUnit,
|
||||||
" spareUnits = %d\n",
|
ip->lastUnit, ip->flags,
|
||||||
i, ip->virtualUnits, ip->firstUnit,
|
ip->spareUnits);
|
||||||
ip->lastUnit, ip->flags,
|
|
||||||
ip->spareUnits);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ip->Reserved0 != ip->firstUnit) {
|
if (ip->Reserved0 != ip->firstUnit) {
|
||||||
struct erase_info *instr = &inftl->instr;
|
struct erase_info *instr = &inftl->instr;
|
||||||
@@ -475,30 +467,30 @@ void INFTL_dumptables(struct INFTLrecord *s)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printk("-------------------------------------------"
|
pr_debug("-------------------------------------------"
|
||||||
"----------------------------------\n");
|
"----------------------------------\n");
|
||||||
|
|
||||||
printk("VUtable[%d] ->", s->nb_blocks);
|
pr_debug("VUtable[%d] ->", s->nb_blocks);
|
||||||
for (i = 0; i < s->nb_blocks; i++) {
|
for (i = 0; i < s->nb_blocks; i++) {
|
||||||
if ((i % 8) == 0)
|
if ((i % 8) == 0)
|
||||||
printk("\n%04x: ", i);
|
pr_debug("\n%04x: ", i);
|
||||||
printk("%04x ", s->VUtable[i]);
|
pr_debug("%04x ", s->VUtable[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
printk("\n-------------------------------------------"
|
pr_debug("\n-------------------------------------------"
|
||||||
"----------------------------------\n");
|
"----------------------------------\n");
|
||||||
|
|
||||||
printk("PUtable[%d-%d=%d] ->", s->firstEUN, s->lastEUN, s->nb_blocks);
|
pr_debug("PUtable[%d-%d=%d] ->", s->firstEUN, s->lastEUN, s->nb_blocks);
|
||||||
for (i = 0; i <= s->lastEUN; i++) {
|
for (i = 0; i <= s->lastEUN; i++) {
|
||||||
if ((i % 8) == 0)
|
if ((i % 8) == 0)
|
||||||
printk("\n%04x: ", i);
|
pr_debug("\n%04x: ", i);
|
||||||
printk("%04x ", s->PUtable[i]);
|
pr_debug("%04x ", s->PUtable[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
printk("\n-------------------------------------------"
|
pr_debug("\n-------------------------------------------"
|
||||||
"----------------------------------\n");
|
"----------------------------------\n");
|
||||||
|
|
||||||
printk("INFTL ->\n"
|
pr_debug("INFTL ->\n"
|
||||||
" EraseSize = %d\n"
|
" EraseSize = %d\n"
|
||||||
" h/s/c = %d/%d/%d\n"
|
" h/s/c = %d/%d/%d\n"
|
||||||
" numvunits = %d\n"
|
" numvunits = %d\n"
|
||||||
@@ -512,7 +504,7 @@ void INFTL_dumptables(struct INFTLrecord *s)
|
|||||||
s->numvunits, s->firstEUN, s->lastEUN, s->numfreeEUNs,
|
s->numvunits, s->firstEUN, s->lastEUN, s->numfreeEUNs,
|
||||||
s->LastFreeEUN, s->nb_blocks, s->nb_boot_blocks);
|
s->LastFreeEUN, s->nb_blocks, s->nb_boot_blocks);
|
||||||
|
|
||||||
printk("\n-------------------------------------------"
|
pr_debug("\n-------------------------------------------"
|
||||||
"----------------------------------\n");
|
"----------------------------------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,25 +512,25 @@ void INFTL_dumpVUchains(struct INFTLrecord *s)
|
|||||||
{
|
{
|
||||||
int logical, block, i;
|
int logical, block, i;
|
||||||
|
|
||||||
printk("-------------------------------------------"
|
pr_debug("-------------------------------------------"
|
||||||
"----------------------------------\n");
|
"----------------------------------\n");
|
||||||
|
|
||||||
printk("INFTL Virtual Unit Chains:\n");
|
pr_debug("INFTL Virtual Unit Chains:\n");
|
||||||
for (logical = 0; logical < s->nb_blocks; logical++) {
|
for (logical = 0; logical < s->nb_blocks; logical++) {
|
||||||
block = s->VUtable[logical];
|
block = s->VUtable[logical];
|
||||||
if (block > s->nb_blocks)
|
if (block > s->nb_blocks)
|
||||||
continue;
|
continue;
|
||||||
printk(" LOGICAL %d --> %d ", logical, block);
|
pr_debug(" LOGICAL %d --> %d ", logical, block);
|
||||||
for (i = 0; i < s->nb_blocks; i++) {
|
for (i = 0; i < s->nb_blocks; i++) {
|
||||||
if (s->PUtable[block] == BLOCK_NIL)
|
if (s->PUtable[block] == BLOCK_NIL)
|
||||||
break;
|
break;
|
||||||
block = s->PUtable[block];
|
block = s->PUtable[block];
|
||||||
printk("%d ", block);
|
pr_debug("%d ", block);
|
||||||
}
|
}
|
||||||
printk("\n");
|
pr_debug("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
printk("-------------------------------------------"
|
pr_debug("-------------------------------------------"
|
||||||
"----------------------------------\n");
|
"----------------------------------\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,10 +708,7 @@ int INFTL_mount(struct INFTLrecord *s)
|
|||||||
logical_block = BLOCK_NIL;
|
logical_block = BLOCK_NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_DEBUG_VERBOSE
|
INFTL_dumptables(s);
|
||||||
if (CONFIG_MTD_DEBUG_VERBOSE >= 2)
|
|
||||||
INFTL_dumptables(s);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Second pass, check for infinite loops in chains. These are
|
* Second pass, check for infinite loops in chains. These are
|
||||||
@@ -771,12 +760,8 @@ int INFTL_mount(struct INFTLrecord *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_DEBUG_VERBOSE
|
INFTL_dumptables(s);
|
||||||
if (CONFIG_MTD_DEBUG_VERBOSE >= 2)
|
INFTL_dumpVUchains(s);
|
||||||
INFTL_dumptables(s);
|
|
||||||
if (CONFIG_MTD_DEBUG_VERBOSE >= 2)
|
|
||||||
INFTL_dumpVUchains(s);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Third pass, format unreferenced blocks and init free block count.
|
* Third pass, format unreferenced blocks and init free block count.
|
||||||
|
@@ -321,7 +321,6 @@ static void pcmciamtd_release(struct pcmcia_device *link)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_DEBUG
|
|
||||||
static int pcmciamtd_cistpl_format(struct pcmcia_device *p_dev,
|
static int pcmciamtd_cistpl_format(struct pcmcia_device *p_dev,
|
||||||
tuple_t *tuple,
|
tuple_t *tuple,
|
||||||
void *priv_data)
|
void *priv_data)
|
||||||
@@ -352,7 +351,6 @@ static int pcmciamtd_cistpl_jedec(struct pcmcia_device *p_dev,
|
|||||||
}
|
}
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int pcmciamtd_cistpl_device(struct pcmcia_device *p_dev,
|
static int pcmciamtd_cistpl_device(struct pcmcia_device *p_dev,
|
||||||
tuple_t *tuple,
|
tuple_t *tuple,
|
||||||
@@ -419,10 +417,8 @@ static void card_settings(struct pcmciamtd_dev *dev, struct pcmcia_device *p_dev
|
|||||||
pr_debug("Found name: %s\n", dev->mtd_name);
|
pr_debug("Found name: %s\n", dev->mtd_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_DEBUG
|
|
||||||
pcmcia_loop_tuple(p_dev, CISTPL_FORMAT, pcmciamtd_cistpl_format, NULL);
|
pcmcia_loop_tuple(p_dev, CISTPL_FORMAT, pcmciamtd_cistpl_format, NULL);
|
||||||
pcmcia_loop_tuple(p_dev, CISTPL_JEDEC_C, pcmciamtd_cistpl_jedec, NULL);
|
pcmcia_loop_tuple(p_dev, CISTPL_JEDEC_C, pcmciamtd_cistpl_jedec, NULL);
|
||||||
#endif
|
|
||||||
pcmcia_loop_tuple(p_dev, CISTPL_DEVICE, pcmciamtd_cistpl_device, dev);
|
pcmcia_loop_tuple(p_dev, CISTPL_DEVICE, pcmciamtd_cistpl_device, dev);
|
||||||
pcmcia_loop_tuple(p_dev, CISTPL_DEVICE_GEO, pcmciamtd_cistpl_geo, dev);
|
pcmcia_loop_tuple(p_dev, CISTPL_DEVICE_GEO, pcmciamtd_cistpl_geo, dev);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user