diff mbox

[U-Boot,1/4] fs/fat: Remove two statements without effect

Message ID ebd7da8b37cd4c33be0426a3675f3dcf@rwthex-w2-b.rwth-ad.de
State Accepted
Commit ed76f912777066c788ae7e9cfb1d5e19e8c35274
Delegated to: Tom Rini
Headers show

Commit Message

Stefan Brüns Sept. 11, 2016, 8:51 p.m. UTC
fatlength is a local variable which is no more used after the assignment.
s_name is not used in the function, save the strncpy.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 fs/fat/fat_write.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Łukasz Majewski Sept. 12, 2016, 10:43 a.m. UTC | #1
Hi Stefan,

> fatlength is a local variable which is no more used after the
> assignment. s_name is not used in the function, save the strncpy.
> 
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> ---
>  fs/fat/fat_write.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
> index eb3a916..961ccd8 100644
> --- a/fs/fat/fat_write.c
> +++ b/fs/fat/fat_write.c
> @@ -183,7 +183,6 @@ static __u32 get_fatent_value(fsdata *mydata,
> __u32 entry) if (getsize > fatlength)
>  			getsize = fatlength;
>  
> -		fatlength *= mydata->sect_size;	/* We want it
> in bytes now */ startblock += mydata->fat_sect;	/* Offset from
> start of disk */ 
>  		/* Write back the fatbuf to the disk */
> @@ -326,10 +325,8 @@ fill_dir_slot(fsdata *mydata, dir_entry
> **dentptr, const char *l_name) dir_slot *slotptr = (dir_slot
> *)get_contents_vfatname_block; __u8 counter = 0, checksum;
>  	int idx = 0, ret;
> -	char s_name[16];
>  
> -	/* Get short file name and checksum value */
> -	strncpy(s_name, (*dentptr)->name, 16);
> +	/* Get short file name checksum value */
>  	checksum = mkcksum((*dentptr)->name, (*dentptr)->ext);
>  
>  	do {

Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Stephen Warren Sept. 12, 2016, 6:48 p.m. UTC | #2
On 09/11/2016 02:51 PM, Stefan Brüns wrote:
> fatlength is a local variable which is no more used after the assignment.
> s_name is not used in the function, save the strncpy.

The series,
Acked-by: Stephen Warren <swarren@nvidia.com>
Benoît Thébaudeau Sept. 12, 2016, 8:15 p.m. UTC | #3
Hi Stefan,

On Sun, Sep 11, 2016 at 10:51 PM, Stefan Brüns
<stefan.bruens@rwth-aachen.de> wrote:
> fatlength is a local variable which is no more used after the assignment.
> s_name is not used in the function, save the strncpy.
>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

[...]

For the series:
Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>

Best regards,
Benoît
Tom Rini Sept. 23, 2016, 7:55 p.m. UTC | #4
On Sun, Sep 11, 2016 at 10:51:39PM +0200, Stefan Brüns wrote:

> fatlength is a local variable which is no more used after the assignment.
> s_name is not used in the function, save the strncpy.
> 
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
> Acked-by: Stephen Warren <swarren@nvidia.com>
> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index eb3a916..961ccd8 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -183,7 +183,6 @@  static __u32 get_fatent_value(fsdata *mydata, __u32 entry)
 		if (getsize > fatlength)
 			getsize = fatlength;
 
-		fatlength *= mydata->sect_size;	/* We want it in bytes now */
 		startblock += mydata->fat_sect;	/* Offset from start of disk */
 
 		/* Write back the fatbuf to the disk */
@@ -326,10 +325,8 @@  fill_dir_slot(fsdata *mydata, dir_entry **dentptr, const char *l_name)
 	dir_slot *slotptr = (dir_slot *)get_contents_vfatname_block;
 	__u8 counter = 0, checksum;
 	int idx = 0, ret;
-	char s_name[16];
 
-	/* Get short file name and checksum value */
-	strncpy(s_name, (*dentptr)->name, 16);
+	/* Get short file name checksum value */
 	checksum = mkcksum((*dentptr)->name, (*dentptr)->ext);
 
 	do {