[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1305291537120.30576@pobox.suse.cz>
Date: Wed, 29 May 2013 15:37:35 +0200 (CEST)
From: Jiri Kosina <jkosina@...e.cz>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [patch] pktcdvd: silence static checker warning
On Thu, 16 May 2013, Dan Carpenter wrote:
> Static checkers complain about widening the binary "not" operations here
> because sectors are u64 and "(pd)->settings.size" is unsigned int.
> It unintentionally clears the high 32 bits of the sector. This means
> that the driver won't work for devices with over 2TB of space. Since
> this is a DVD drive, we're unlikely to reach that limit, but we may as
> well silence the warning.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>
> diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
> index 898fa74..09142c4 100644
> --- a/drivers/block/pktcdvd.c
> +++ b/drivers/block/pktcdvd.c
> @@ -83,7 +83,8 @@
>
> #define MAX_SPEED 0xffff
>
> -#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1))
> +#define ZONE(sector, pd) (((sector) + (pd)->offset) & \
> + ~(sector_t)((pd)->settings.size - 1))
>
> static DEFINE_MUTEX(pktcdvd_mutex);
> static struct pktcdvd_device *pkt_devs[MAX_WRITERS];
Makes sense. Applied, thanks Dan.
--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists