The u32 would never be less than zero so the error handling would
break. I changed it to int.
Signed-off-by: Dan Carpenter <[email protected]>
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 0ea390f..1361d8d 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -281,7 +281,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
/* get & parse master ports */
for (i = 0; i < ports[0]; i++) {
- u32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr);
+ int mst_port_d = bcma_erom_get_mst_port(bus, eromptr);
if (mst_port_d < 0)
return -EILSEQ;
}
W dniu 18 sierpnia 2011 15:38 użytkownik Dan Carpenter
<[email protected]> napisał:
> The u32 would never be less than zero so the error handling would
> break. I changed it to int.
In declaration we use s32:
static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr);
Doesn't it sound better to use s32 instead of int?
--
Rafał
W dniu 20 sierpnia 2011 14:59 użytkownik walter harms <[email protected]> napisał:
>
>
> Am 20.08.2011 14:23, schrieb Rafał Miłecki:
>> W dniu 18 sierpnia 2011 15:38 użytkownik Dan Carpenter
>> <[email protected]> napisał:
>>> The u32 would never be less than zero so the error handling would
>>> break. I changed it to int.
>>
>> In declaration we use s32:
>> static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr);
>>
>> Doesn't it sound better to use s32 instead of int?
>>
>
> aktualy int sounds better that s32 for me.
Will you care to replace function return type as well?
--
Rafał
W dniu 23 sierpnia 2011 21:13 użytkownik Dan Carpenter
<[email protected]> napisał:
> On Sat, Aug 20, 2011 at 02:23:56PM +0200, Rafał Miłecki wrote:
>> W dniu 18 sierpnia 2011 15:38 użytkownik Dan Carpenter
>> <[email protected]> napisał:
>> > The u32 would never be less than zero so the error handling would
>> > break. I changed it to int.
>>
>> In declaration we use s32:
>> static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr);
>>
>> Doesn't it sound better to use s32 instead of int?
>>
>
> I don't know. I think I'm going to trust the original author on this
> one. I'll send you a v2 that uses s32.
Dan, I asked you to use int in both: call and function declaration.
I'm the author of that code, and I don't have anything against
modifying that :)
I think int is used much more often that s32 for errors.
--
Rafał
On Wed, Aug 24, 2011 at 12:01:11PM +0200, Rafał Miłecki wrote:
> Dan, I asked you to use int in both: call and function declaration.
> I'm the author of that code, and I don't have anything against
> modifying that :)
>
> I think int is used much more often that s32 for errors.
>
No problem. Should I make bcma_erom_get_mst_port() return 0 on
success while I'm at it?
regards,
dan carpenter
The u32 would never be less than zero so the error handling would
break. I changed it to s32 to match how bcma_erom_get_mst_port() is
declared.
Signed-off-by: Dan Carpenter <[email protected]>
---
v2: the first version used "int" instead of "s32".
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 0ea390f..cad9948 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -281,7 +281,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
/* get & parse master ports */
for (i = 0; i < ports[0]; i++) {
- u32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr);
+ s32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr);
if (mst_port_d < 0)
return -EILSEQ;
}
Am 20.08.2011 14:23, schrieb Rafał Miłecki:
> W dniu 18 sierpnia 2011 15:38 użytkownik Dan Carpenter
> <[email protected]> napisał:
>> The u32 would never be less than zero so the error handling would
>> break. I changed it to int.
>
> In declaration we use s32:
> static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr);
>
> Doesn't it sound better to use s32 instead of int?
>
aktualy int sounds better that s32 for me.
re,
wh
On Sat, Aug 20, 2011 at 02:23:56PM +0200, Rafał Miłecki wrote:
> W dniu 18 sierpnia 2011 15:38 użytkownik Dan Carpenter
> <[email protected]> napisał:
> > The u32 would never be less than zero so the error handling would
> > break. I changed it to int.
>
> In declaration we use s32:
> static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr);
>
> Doesn't it sound better to use s32 instead of int?
>
I don't know. I think I'm going to trust the original author on this
one. I'll send you a v2 that uses s32.
regards,
dan carpenter