Re: [PATCH 1/2] staging: ath6kl: Cast variable to size_t to avoid compile warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 28, 2011 at 10:25 AM, Greg KH <greg@xxxxxxxxx> wrote:
> On Sat, Feb 26, 2011 at 07:45:03PM +0100, Javier Martinez Canillas wrote:
>> The min() macro does strict type-checking so we have to cast
>> MAX_BDADDR_FORMAT_LENGTH - 1 to size_t to silence a compile warning
>>
>> Signed-off-by: Javier Martinez Canillas <martinez.javier@xxxxxxxxx>
>> ---
>> Â.../staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c  |  Â2 +-
>> Â1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
>> index 67e6d5e..778e4fd 100644
>> --- a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
>> +++ b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
>> @@ -360,7 +360,7 @@ int PSSendOps(void *arg)
>> Â Â Â Â Â Â Â status = 1;
>> Â Â Â Â Â Â Â goto complete;
>> Â Â Â }
>> - Â Â len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1);
>> + Â Â len = min(firmware->size, (size_t)MAX_BDADDR_FORMAT_LENGTH - 1);
>
> Shouldn't you use min_t() instead of casting here?

I'll fix this and resend this as part of my series.

  Luis
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux