diff mbox

[1/3] UBI: Fastmap: Simplify expression

Message ID 1435912576-27878-1-git-send-email-richard@nod.at
State Accepted
Headers show

Commit Message

Richard Weinberger July 3, 2015, 8:36 a.m. UTC
There is no need to compute pnum again.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/mtd/ubi/fastmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brian Norris Sept. 29, 2015, 1:35 a.m. UTC | #1
On Fri, Jul 03, 2015 at 10:36:14AM +0200, Richard Weinberger wrote:
> There is no need to compute pnum again.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>

Acked-by: Brian Norris <computersforpeace@gmail.com>

> ---
>  drivers/mtd/ubi/fastmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
> index 24f2cf6..22db594 100644
> --- a/drivers/mtd/ubi/fastmap.c
> +++ b/drivers/mtd/ubi/fastmap.c
> @@ -775,7 +775,7 @@ static int ubi_attach_fastmap(struct ubi_device *ubi,
>  		for (j = 0; j < be32_to_cpu(fm_eba->reserved_pebs); j++) {
>  			int pnum = be32_to_cpu(fm_eba->pnum[j]);
>  
> -			if ((int)be32_to_cpu(fm_eba->pnum[j]) < 0)
> +			if (pnum < 0)
>  				continue;
>  
>  			aeb = NULL;
> -- 
> 1.8.4.5
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
Richard Weinberger Oct. 3, 2015, 6:09 p.m. UTC | #2
On Tue, Sep 29, 2015 at 3:35 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
> On Fri, Jul 03, 2015 at 10:36:14AM +0200, Richard Weinberger wrote:
>> There is no need to compute pnum again.
>>
>> Signed-off-by: Richard Weinberger <richard@nod.at>
>
> Acked-by: Brian Norris <computersforpeace@gmail.com>

Applied!
diff mbox

Patch

diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c
index 24f2cf6..22db594 100644
--- a/drivers/mtd/ubi/fastmap.c
+++ b/drivers/mtd/ubi/fastmap.c
@@ -775,7 +775,7 @@  static int ubi_attach_fastmap(struct ubi_device *ubi,
 		for (j = 0; j < be32_to_cpu(fm_eba->reserved_pebs); j++) {
 			int pnum = be32_to_cpu(fm_eba->pnum[j]);
 
-			if ((int)be32_to_cpu(fm_eba->pnum[j]) < 0)
+			if (pnum < 0)
 				continue;
 
 			aeb = NULL;