All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension
@ 2017-03-31 14:31 Peter Maydell
  2017-03-31 15:59 ` Edgar E. Iglesias
  2017-04-02  6:31 ` no-reply
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2017-03-31 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches, Edgar E. Iglesias

Commit 001ebaca7b11 fixed some unintended sign extension issues
spotted by Coverity (CID 1005402, 1005403), but didn't catch
all of them. Fix the rest, so we behave consistently whether
'long' is 32 bit or 64 bit.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 disas/cris.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/disas/cris.c b/disas/cris.c
index 30217f1..2dd56de 100644
--- a/disas/cris.c
+++ b/disas/cris.c
@@ -2048,7 +2048,7 @@ print_with_operands (const struct cris_opcode *opcodep,
 	  {
 	    /* We're looking at [pc+], i.e. we need to output an immediate
 	       number, where the size can depend on different things.  */
-	    long number;
+	    int32_t number;
 	    int signedp
 	      = ((*cs == 'z' && (insn & 0x20))
 		 || opcodep->match == BDAP_QUICK_OPCODE);
@@ -2290,7 +2290,7 @@ print_with_operands (const struct cris_opcode *opcodep,
 
 		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)
 		      {
-			long number;
+			int32_t number;
 			unsigned int nbytes;
 
 			/* It's a value.  Get its size.  */
-- 
2.7.4

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

* Re: [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension
  2017-03-31 14:31 [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension Peter Maydell
@ 2017-03-31 15:59 ` Edgar E. Iglesias
  2017-04-03 13:39   ` Peter Maydell
  2017-04-02  6:31 ` no-reply
  1 sibling, 1 reply; 4+ messages in thread
From: Edgar E. Iglesias @ 2017-03-31 15:59 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On Fri, Mar 31, 2017 at 03:31:11PM +0100, Peter Maydell wrote:
> Commit 001ebaca7b11 fixed some unintended sign extension issues
> spotted by Coverity (CID 1005402, 1005403), but didn't catch
> all of them. Fix the rest, so we behave consistently whether
> 'long' is 32 bit or 64 bit.

Thanks!
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  disas/cris.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/disas/cris.c b/disas/cris.c
> index 30217f1..2dd56de 100644
> --- a/disas/cris.c
> +++ b/disas/cris.c
> @@ -2048,7 +2048,7 @@ print_with_operands (const struct cris_opcode *opcodep,
>  	  {
>  	    /* We're looking at [pc+], i.e. we need to output an immediate
>  	       number, where the size can depend on different things.  */
> -	    long number;
> +	    int32_t number;
>  	    int signedp
>  	      = ((*cs == 'z' && (insn & 0x20))
>  		 || opcodep->match == BDAP_QUICK_OPCODE);
> @@ -2290,7 +2290,7 @@ print_with_operands (const struct cris_opcode *opcodep,
>  
>  		    if ((prefix_insn & 0x400) && (prefix_insn & 15) == 15)
>  		      {
> -			long number;
> +			int32_t number;
>  			unsigned int nbytes;
>  
>  			/* It's a value.  Get its size.  */
> -- 
> 2.7.4
> 

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

* Re: [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension
  2017-03-31 14:31 [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension Peter Maydell
  2017-03-31 15:59 ` Edgar E. Iglesias
@ 2017-04-02  6:31 ` no-reply
  1 sibling, 0 replies; 4+ messages in thread
From: no-reply @ 2017-04-02  6:31 UTC (permalink / raw)
  To: peter.maydell; +Cc: famz, qemu-devel, edgar.iglesias, patches

Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 1490970671-20560-1-git-send-email-peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
1ab4529 disas/cris.c: Avoid unintentional sign extension

=== OUTPUT BEGIN ===
Checking PATCH 1/1: disas/cris.c: Avoid unintentional sign extension...
ERROR: code indent should never use tabs
#24: FILE: disas/cris.c:2051:
+^I    int32_t number;$

ERROR: code indent should never use tabs
#33: FILE: disas/cris.c:2293:
+^I^I^Iint32_t number;$

total: 2 errors, 0 warnings, 16 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

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

* Re: [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension
  2017-03-31 15:59 ` Edgar E. Iglesias
@ 2017-04-03 13:39   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-04-03 13:39 UTC (permalink / raw)
  To: Edgar E. Iglesias; +Cc: QEMU Developers, patches

On 31 March 2017 at 16:59, Edgar E. Iglesias <edgar.iglesias@gmail.com> wrote:
> On Fri, Mar 31, 2017 at 03:31:11PM +0100, Peter Maydell wrote:
>> Commit 001ebaca7b11 fixed some unintended sign extension issues
>> spotted by Coverity (CID 1005402, 1005403), but didn't catch
>> all of them. Fix the rest, so we behave consistently whether
>> 'long' is 32 bit or 64 bit.
>
> Thanks!
> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>

Applied to master; thanks.

-- PMM

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

end of thread, other threads:[~2017-04-03 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 14:31 [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension Peter Maydell
2017-03-31 15:59 ` Edgar E. Iglesias
2017-04-03 13:39   ` Peter Maydell
2017-04-02  6:31 ` no-reply

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.