All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] candump: resolve signedness warnings
@ 2012-04-19  7:44 yegorslists
  2012-04-19  8:54 ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: yegorslists @ 2012-04-19  7:44 UTC (permalink / raw)
  To: linux-can; +Cc: Yegor Yefremov

From: Yegor Yefremov <yegorslists@googlemail.com>

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 candump.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/candump.c b/candump.c
index 5ba9431..ac51192 100644
--- a/candump.c
+++ b/candump.c
@@ -611,7 +611,7 @@ int main(int argc, char **argv)
 					return 1;
 				}
 
-				if (nbytes < sizeof(struct can_frame)) {
+				if ((size_t)nbytes < sizeof(struct can_frame)) {
 					fprintf(stderr, "read: incomplete CAN frame\n");
 					return 1;
 				}
@@ -627,7 +627,7 @@ int main(int argc, char **argv)
 					if (nbytes < 0) {
 						perror("bridge write");
 						return 1;
-					} else if (nbytes < sizeof(struct can_frame)) {
+					} else if ((size_t)nbytes < sizeof(struct can_frame)) {
 						fprintf(stderr,"bridge write: incomplete CAN frame\n");
 						return 1;
 					}
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] candump: resolve signedness warnings
  2012-04-19  7:44 [PATCH] candump: resolve signedness warnings yegorslists
@ 2012-04-19  8:54 ` Marc Kleine-Budde
  2012-04-19 15:46   ` Oliver Hartkopp
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-04-19  8:54 UTC (permalink / raw)
  To: yegorslists; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

On 04/19/2012 09:44 AM, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

nbytes has been tested before if it's < 0, so it's safe to cast it to an
unsigned value.

Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>

Oliver do you want to take the patch?

Marc

> ---
>  candump.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/candump.c b/candump.c
> index 5ba9431..ac51192 100644
> --- a/candump.c
> +++ b/candump.c
> @@ -611,7 +611,7 @@ int main(int argc, char **argv)
>  					return 1;
>  				}
>  
> -				if (nbytes < sizeof(struct can_frame)) {
> +				if ((size_t)nbytes < sizeof(struct can_frame)) {
>  					fprintf(stderr, "read: incomplete CAN frame\n");
>  					return 1;
>  				}
> @@ -627,7 +627,7 @@ int main(int argc, char **argv)
>  					if (nbytes < 0) {
>  						perror("bridge write");
>  						return 1;
> -					} else if (nbytes < sizeof(struct can_frame)) {
> +					} else if ((size_t)nbytes < sizeof(struct can_frame)) {
>  						fprintf(stderr,"bridge write: incomplete CAN frame\n");
>  						return 1;
>  					}


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] candump: resolve signedness warnings
  2012-04-19  8:54 ` Marc Kleine-Budde
@ 2012-04-19 15:46   ` Oliver Hartkopp
  2012-04-19 15:57     ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Hartkopp @ 2012-04-19 15:46 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: yegorslists, linux-can

On 19.04.2012 10:54, Marc Kleine-Budde wrote:

> On 04/19/2012 09:44 AM, yegorslists@googlemail.com wrote:
>> From: Yegor Yefremov <yegorslists@googlemail.com>
>>
>> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> 
> nbytes has been tested before if it's < 0, so it's safe to cast it to an
> unsigned value.
> 
> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> Oliver do you want to take the patch?


Yes. I applied it to the git repo.

I did it with

git am --signoff < candump.patch

using the original mail from Yegor.

Unfortunately that missed your Acked-by: ...

What would be the right way to apply it with your Acked-by too?

I assume applying your answered mail won't have made it, right?

Regards,
Oliver

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] candump: resolve signedness warnings
  2012-04-19 15:46   ` Oliver Hartkopp
@ 2012-04-19 15:57     ` Marc Kleine-Budde
  2012-04-19 16:01       ` Wolfram Sang
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-04-19 15:57 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: yegorslists, linux-can

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]

On 04/19/2012 05:46 PM, Oliver Hartkopp wrote:
>> Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
>>
>> Oliver do you want to take the patch?

> Yes. I applied it to the git repo.
> 
> I did it with
> 
> git am --signoff < candump.patch

You can save some precious keystrokes:

git am -s candump.patch

> using the original mail from Yegor.
> 
> Unfortunately that missed your Acked-by: ...

No problem.

> What would be the right way to apply it with your Acked-by too?

I usually do a $(git commit --amend) after the $(git am -s) and paste
the Acked-by. Maybe there are some more elaborative ways to do so :)

> I assume applying your answered mail won't have made it, right?

Hehe :)

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] candump: resolve signedness warnings
  2012-04-19 15:57     ` Marc Kleine-Budde
@ 2012-04-19 16:01       ` Wolfram Sang
  2012-04-19 16:03         ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2012-04-19 16:01 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Oliver Hartkopp, yegorslists, linux-can

[-- Attachment #1: Type: text/plain, Size: 405 bytes --]

> > What would be the right way to apply it with your Acked-by too?
> 
> I usually do a $(git commit --amend) after the $(git am -s) and paste
> the Acked-by. Maybe there are some more elaborative ways to do so :)

That's usually handwork.

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] candump: resolve signedness warnings
  2012-04-19 16:01       ` Wolfram Sang
@ 2012-04-19 16:03         ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2012-04-19 16:03 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Oliver Hartkopp, yegorslists, linux-can

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

On 04/19/2012 06:01 PM, Wolfram Sang wrote:
>>> What would be the right way to apply it with your Acked-by too?
>>
>> I usually do a $(git commit --amend) after the $(git am -s) and paste
>> the Acked-by. Maybe there are some more elaborative ways to do so :)
> 
> That's usually handwork.

If you have to add you S-o-b to a huge branch you can use things like
git filte-branch

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-19 16:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19  7:44 [PATCH] candump: resolve signedness warnings yegorslists
2012-04-19  8:54 ` Marc Kleine-Budde
2012-04-19 15:46   ` Oliver Hartkopp
2012-04-19 15:57     ` Marc Kleine-Budde
2012-04-19 16:01       ` Wolfram Sang
2012-04-19 16:03         ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.