* Patch Issues
@ 2015-01-16 2:18 nick
2015-01-16 3:03 ` hujianyang
0 siblings, 1 reply; 4+ messages in thread
From: nick @ 2015-01-16 2:18 UTC (permalink / raw)
To: dwmw2; +Cc: computersforpeace, linux-mtd, linux-kernel
Greetings Maintainers,
Today I build the below patch and am getting some rather odd build errors.
I looked through the man pages and there were no clear answers about how to
fix them.I will paste them below with the patch. Any option would be greatly
appertained if someone has some time.
Thanks,
Nick
Build Warnings:
drivers/mtd/inftlmount.c: In function ‘INFTL_formatblock’:
drivers/mtd/inftlmount.c:428:13: error: invalid storage class for function ‘format_chain’
static void format_chain(struct INFTLrecord *inftl, unsigned int first_block)
^
drivers/mtd/inftlmount.c:428:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
static void format_chain(struct INFTLrecord *inftl, unsigned int first_block)
^
drivers/mtd/inftlmount.c:781:1: error: expected declaration or statement at end of input
}
^
drivers/mtd/inftlmount.c: At top level:
drivers/mtd/inftlmount.c:336:12: warning: ‘check_free_sectors’ defined but not used [-Wunused-function]
static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
^
drivers/mtd/inftlmount.c: In function ‘INFTL_formatblock’:
drivers/mtd/inftlmount.c:781:1: warning: control reaches end of non-void function [-Wreturn-type]
}
Patch:
>From 6b481c8f5030da2e9616bd038193d68340c0b5d0 Mon Sep 17 00:00:00 2001
2 From: Nicholas Krause <xerofoify@gmail.com>
3 Date: Thu, 15 Jan 2015 20:10:37 -0500
4 Subject: [PATCH] mtd: Remove unneeded call to check_free_sectors in the
5 function,INFTL_formatblock
6
7 Removes unneeded call to check_free_sectors internally in the function,INFTL_formatblock.
8 This call is no longer needed due to us checking to see if erasing the block against the
9 structure pointer passed to the function,inftl internal variable state is equal to the
10 macro,MTD_ERASE_FAILED to see if the block has failed in being erased successfully.Due
11 to this we can remove the no longer needed check to check_free_sectors and comments
12 related to questioning the reason for it's use with the check against MTD_ERASE_FAILED
13 for inftl's state variable already checking for successfully erasing of the mtd block.
14
15 Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
16 ---
17 drivers/mtd/inftlmount.c | 10 ----------
18 1 file changed, 10 deletions(-)
19
20 diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
21 index 1388c8d..def5cea 100644
22 --- a/drivers/mtd/inftlmount.c
23 +++ b/drivers/mtd/inftlmount.c
24 @@ -367,7 +367,6 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
25 *
26 * Return: 0 when succeed, -1 on error.
27 *
28 - * ToDo: 1. Is it necessary to check_free_sector after erasing ??
29 */
30 int INFTL_formatblock(struct INFTLrecord *inftl, int block)
31 {
32 @@ -401,15 +400,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
33 goto fail;
34 }
35
36 - /*
37 - * Check the "freeness" of Erase Unit before updating metadata.
38 - * FixMe: is this check really necessary? Since we have check
39 - * the return code after the erase operation.
40 - */
41 - if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0)
42 - goto fail;
43 - }
44 -
45 uci.EraseMark = cpu_to_le16(ERASE_MARK);
46 uci.EraseMark1 = cpu_to_le16(ERASE_MARK);
47 uci.Reserved[0] = 0;
48 --
49 2.1.0
50
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch Issues
2015-01-16 2:18 Patch Issues nick
@ 2015-01-16 3:03 ` hujianyang
2015-01-16 3:36 ` nick
0 siblings, 1 reply; 4+ messages in thread
From: hujianyang @ 2015-01-16 3:03 UTC (permalink / raw)
To: nick; +Cc: linux-mtd, computersforpeace, dwmw2, linux-kernel
Hi Nick,
I'm not quite sure about if it is a correct modification. But,
On 2015/1/16 10:18, nick wrote:
> drivers/mtd/inftlmount.c:336:12: warning: ‘check_free_sectors’ defined but not used [-Wunused-function]
check if this function is still called by other functions, if it
is not, just remove it in your patch.
> static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
> ^
> drivers/mtd/inftlmount.c: In function ‘INFTL_formatblock’:
> drivers/mtd/inftlmount.c:781:1: warning: control reaches end of non-void function [-Wreturn-type]
> }
> Patch:
> From 6b481c8f5030da2e9616bd038193d68340c0b5d0 Mon Sep 17 00:00:00 2001
> 2 From: Nicholas Krause <xerofoify@gmail.com>
> 3 Date: Thu, 15 Jan 2015 20:10:37 -0500
> 4 Subject: [PATCH] mtd: Remove unneeded call to check_free_sectors in the
> 5 function,INFTL_formatblock
> 6
> 7 Removes unneeded call to check_free_sectors internally in the function,INFTL_formatblock.
> 8 This call is no longer needed due to us checking to see if erasing the block against the
> 9 structure pointer passed to the function,inftl internal variable state is equal to the
> 10 macro,MTD_ERASE_FAILED to see if the block has failed in being erased successfully.Due
> 11 to this we can remove the no longer needed check to check_free_sectors and comments
> 12 related to questioning the reason for it's use with the check against MTD_ERASE_FAILED
> 13 for inftl's state variable already checking for successfully erasing of the mtd block.
> 14
> 15 Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> 16 ---
> 17 drivers/mtd/inftlmount.c | 10 ----------
> 18 1 file changed, 10 deletions(-)
> 19
> 20 diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
> 21 index 1388c8d..def5cea 100644
> 22 --- a/drivers/mtd/inftlmount.c
> 23 +++ b/drivers/mtd/inftlmount.c
> 24 @@ -367,7 +367,6 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
> 25 *
> 26 * Return: 0 when succeed, -1 on error.
> 27 *
> 28 - * ToDo: 1. Is it necessary to check_free_sector after erasing ??
> 29 */
> 30 int INFTL_formatblock(struct INFTLrecord *inftl, int block)
> 31 {
> 32 @@ -401,15 +400,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
> 33 goto fail;
> 34 }
> 35
> 36 - /*
> 37 - * Check the "freeness" of Erase Unit before updating metadata.
> 38 - * FixMe: is this check really necessary? Since we have check
> 39 - * the return code after the erase operation.
> 40 - */
> 41 - if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0)
> 42 - goto fail;
> 43 - }
You should keep this '}'.
> 44 -
> 45 uci.EraseMark = cpu_to_le16(ERASE_MARK);
> 46 uci.EraseMark1 = cpu_to_le16(ERASE_MARK);
> 47 uci.Reserved[0] = 0;
> 48 --
> 49 2.1.0
> 50
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch Issues
2015-01-16 3:03 ` hujianyang
@ 2015-01-16 3:36 ` nick
2015-01-16 4:01 ` nick
0 siblings, 1 reply; 4+ messages in thread
From: nick @ 2015-01-16 3:36 UTC (permalink / raw)
To: hujianyang; +Cc: linux-mtd, computersforpeace, dwmw2, linux-kernel
Hujuianyang,
Thanks for the reply. I will get around to this tomorrow.
Nick
On 2015-01-15 10:03 PM, hujianyang wrote:
> Hi Nick,
>
> I'm not quite sure about if it is a correct modification. But,
>
> On 2015/1/16 10:18, nick wrote:
>> drivers/mtd/inftlmount.c:336:12: warning: ‘check_free_sectors’ defined but not used [-Wunused-function]
>
> check if this function is still called by other functions, if it
> is not, just remove it in your patch.
>
>> static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
>> ^
>> drivers/mtd/inftlmount.c: In function ‘INFTL_formatblock’:
>> drivers/mtd/inftlmount.c:781:1: warning: control reaches end of non-void function [-Wreturn-type]
>> }
>> Patch:
>> From 6b481c8f5030da2e9616bd038193d68340c0b5d0 Mon Sep 17 00:00:00 2001
>> 2 From: Nicholas Krause <xerofoify@gmail.com>
>> 3 Date: Thu, 15 Jan 2015 20:10:37 -0500
>> 4 Subject: [PATCH] mtd: Remove unneeded call to check_free_sectors in the
>> 5 function,INFTL_formatblock
>> 6
>> 7 Removes unneeded call to check_free_sectors internally in the function,INFTL_formatblock.
>> 8 This call is no longer needed due to us checking to see if erasing the block against the
>> 9 structure pointer passed to the function,inftl internal variable state is equal to the
>> 10 macro,MTD_ERASE_FAILED to see if the block has failed in being erased successfully.Due
>> 11 to this we can remove the no longer needed check to check_free_sectors and comments
>> 12 related to questioning the reason for it's use with the check against MTD_ERASE_FAILED
>> 13 for inftl's state variable already checking for successfully erasing of the mtd block.
>> 14
>> 15 Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> 16 ---
>> 17 drivers/mtd/inftlmount.c | 10 ----------
>> 18 1 file changed, 10 deletions(-)
>> 19
>> 20 diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
>> 21 index 1388c8d..def5cea 100644
>> 22 --- a/drivers/mtd/inftlmount.c
>> 23 +++ b/drivers/mtd/inftlmount.c
>> 24 @@ -367,7 +367,6 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
>> 25 *
>> 26 * Return: 0 when succeed, -1 on error.
>> 27 *
>> 28 - * ToDo: 1. Is it necessary to check_free_sector after erasing ??
>> 29 */
>> 30 int INFTL_formatblock(struct INFTLrecord *inftl, int block)
>> 31 {
>> 32 @@ -401,15 +400,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
>> 33 goto fail;
>> 34 }
>> 35
>> 36 - /*
>> 37 - * Check the "freeness" of Erase Unit before updating metadata.
>> 38 - * FixMe: is this check really necessary? Since we have check
>> 39 - * the return code after the erase operation.
>> 40 - */
>> 41 - if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0)
>> 42 - goto fail;
>> 43 - }
>
> You should keep this '}'.
>
>> 44 -
>> 45 uci.EraseMark = cpu_to_le16(ERASE_MARK);
>> 46 uci.EraseMark1 = cpu_to_le16(ERASE_MARK);
>> 47 uci.Reserved[0] = 0;
>> 48 --
>> 49 2.1.0
>> 50
>>
>> ______________________________________________________
>> Linux MTD discussion mailing list
>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch Issues
2015-01-16 3:36 ` nick
@ 2015-01-16 4:01 ` nick
0 siblings, 0 replies; 4+ messages in thread
From: nick @ 2015-01-16 4:01 UTC (permalink / raw)
To: hujianyang; +Cc: linux-mtd, computersforpeace, dwmw2, linux-kernel
Hujuianyang,
Also if I remove the function,check_free_sectors it gives me even more errors.
I tried in a second patch as part of a series.
Nick
On 2015-01-15 10:36 PM, nick wrote:
> Hujuianyang,
> Thanks for the reply. I will get around to this tomorrow.
> Nick
>
> On 2015-01-15 10:03 PM, hujianyang wrote:
>> Hi Nick,
>>
>> I'm not quite sure about if it is a correct modification. But,
>>
>> On 2015/1/16 10:18, nick wrote:
>>> drivers/mtd/inftlmount.c:336:12: warning: ‘check_free_sectors’ defined but not used [-Wunused-function]
>>
>> check if this function is still called by other functions, if it
>> is not, just remove it in your patch.
>>
>>> static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
>>> ^
>>> drivers/mtd/inftlmount.c: In function ‘INFTL_formatblock’:
>>> drivers/mtd/inftlmount.c:781:1: warning: control reaches end of non-void function [-Wreturn-type]
>>> }
>>> Patch:
>>> From 6b481c8f5030da2e9616bd038193d68340c0b5d0 Mon Sep 17 00:00:00 2001
>>> 2 From: Nicholas Krause <xerofoify@gmail.com>
>>> 3 Date: Thu, 15 Jan 2015 20:10:37 -0500
>>> 4 Subject: [PATCH] mtd: Remove unneeded call to check_free_sectors in the
>>> 5 function,INFTL_formatblock
>>> 6
>>> 7 Removes unneeded call to check_free_sectors internally in the function,INFTL_formatblock.
>>> 8 This call is no longer needed due to us checking to see if erasing the block against the
>>> 9 structure pointer passed to the function,inftl internal variable state is equal to the
>>> 10 macro,MTD_ERASE_FAILED to see if the block has failed in being erased successfully.Due
>>> 11 to this we can remove the no longer needed check to check_free_sectors and comments
>>> 12 related to questioning the reason for it's use with the check against MTD_ERASE_FAILED
>>> 13 for inftl's state variable already checking for successfully erasing of the mtd block.
>>> 14
>>> 15 Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>>> 16 ---
>>> 17 drivers/mtd/inftlmount.c | 10 ----------
>>> 18 1 file changed, 10 deletions(-)
>>> 19
>>> 20 diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
>>> 21 index 1388c8d..def5cea 100644
>>> 22 --- a/drivers/mtd/inftlmount.c
>>> 23 +++ b/drivers/mtd/inftlmount.c
>>> 24 @@ -367,7 +367,6 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
>>> 25 *
>>> 26 * Return: 0 when succeed, -1 on error.
>>> 27 *
>>> 28 - * ToDo: 1. Is it necessary to check_free_sector after erasing ??
>>> 29 */
>>> 30 int INFTL_formatblock(struct INFTLrecord *inftl, int block)
>>> 31 {
>>> 32 @@ -401,15 +400,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
>>> 33 goto fail;
>>> 34 }
>>> 35
>>> 36 - /*
>>> 37 - * Check the "freeness" of Erase Unit before updating metadata.
>>> 38 - * FixMe: is this check really necessary? Since we have check
>>> 39 - * the return code after the erase operation.
>>> 40 - */
>>> 41 - if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0)
>>> 42 - goto fail;
>>> 43 - }
>>
>> You should keep this '}'.
>>
>>> 44 -
>>> 45 uci.EraseMark = cpu_to_le16(ERASE_MARK);
>>> 46 uci.EraseMark1 = cpu_to_le16(ERASE_MARK);
>>> 47 uci.Reserved[0] = 0;
>>> 48 --
>>> 49 2.1.0
>>> 50
>>>
>>> ______________________________________________________
>>> Linux MTD discussion mailing list
>>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>>>
>>
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-16 4:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-16 2:18 Patch Issues nick
2015-01-16 3:03 ` hujianyang
2015-01-16 3:36 ` nick
2015-01-16 4:01 ` nick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).