From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31767 invoked by alias); 19 Dec 2016 15:51:23 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 31692 invoked by uid 89); 19 Dec 2016 15:51:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=qiyaoltc@gmail.com, qiyaoltcgmailcom, U*qiyaoltc, sk:qiyaolt X-HELO: mail-qt0-f194.google.com Received: from mail-qt0-f194.google.com (HELO mail-qt0-f194.google.com) (209.85.216.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Dec 2016 15:51:12 +0000 Received: by mail-qt0-f194.google.com with SMTP id l20so19530418qta.1 for ; Mon, 19 Dec 2016 07:51:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=43IE8qYKRgFjg7r4cJmsKDxCagkCsHTU9qJeY8E1odg=; b=jgFHJfVZcp04cymrhIZP75gcdnEKxL1d70COAGBNCnDl0jds3y1VID0caZSOKYm2g5 Msno/IO6Jny2c8ju+pWLWw/IviAUmFXOgipXfiuPn+UnHG762I86c6qUdn1V2PWLv45N m73eFDk1oOZIJ3gsssdeQ3Fg9iuJ/ezCyOTeW8kHKVzMNgkIJHwbjwVnP5LO6sPJdGCo uKsSb1ABYgSh2L0XL+RZkaJisW+jvs91uapzM4TKSzxsu76SPAlTQlwBTduRWMPYUCT0 O96lTp9chBSIljou2a9H7Xrhob60Nq7bbjRQ0ySwtSe6lKzF1fDTchwyhecrptsf5JRB RlMw== X-Gm-Message-State: AIkVDXItqHmMCdUzfkDqi5oLA87xjN4HqcMDsUwyIGz8K/EY5k8SDUsHIev8y3EKWi4vcej0hD5v5nEeyImBEA== X-Received: by 10.200.36.246 with SMTP id t51mr15839729qtt.125.1482162670885; Mon, 19 Dec 2016 07:51:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.144.11 with HTTP; Mon, 19 Dec 2016 07:51:10 -0800 (PST) In-Reply-To: <1481536229-26099-1-git-send-email-yao.qi@linaro.org> References: <1481536229-26099-1-git-send-email-yao.qi@linaro.org> From: Yao Qi Date: Mon, 19 Dec 2016 15:51:00 -0000 Message-ID: Subject: Re: [PATCH] Return 'int' rather than 'unsigned short' in avrdis_opcode To: Binutils Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00326.txt.bz2 On Mon, Dec 12, 2016 at 9:50 AM, Yao Qi wrote: > avrdis_opcode return type is unsigned short, but -1 at the end of > this function is returned. Additionally, print_insn_avr doesn't > handle when -1 (in case of memory error) is returned from > avrdis_opcode. > > This patch changes avrdis_opcode returning int indicating the error, > and adds a new argument for instruction we got on success. The > opcode is 16-bit, so I change local variables type to uint16_t, > and include "bfd_stdint.h" as a result. On memory error, > print_insn_avr returns -1, which is a common convention among most > of print_insn_$ARCH functions. > > Regression tested with all targets enabled. Is it OK? > > opcodes: > > 2016-12-12 Yao Qi > > * avr-dis.c: Include "bfd_stdint.h" > (avrdis_opcode): Change return type to int, add argument > insn. Set *INSN on success. > (print_insn_avr): Check return value of avrdis_opcode, and > return -1 on error. Ping. --=20 Yao (=E9=BD=90=E5=B0=A7)