From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27543 invoked by alias); 11 Dec 2013 18:45:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27528 invoked by uid 89); 11 Dec 2013 18:45:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Dec 2013 18:45:10 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBBIj8UH007149 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Dec 2013 13:45:08 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rBBIj7b6027396; Wed, 11 Dec 2013 13:45:08 -0500 Message-ID: <52A8B2B3.2060901@redhat.com> Date: Wed, 11 Dec 2013 18:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andrew Burgess CC: gdb-patches@sourceware.org Subject: Re: [PATCH [2/2] Convert the unavailable vector to be bit, not byte, based. References: <529F489F.7070805@broadcom.com> <529F498F.7060909@broadcom.com> <52A8929E.20608@broadcom.com> In-Reply-To: <52A8929E.20608@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00443.txt.bz2 On 12/11/2013 04:28 PM, Andrew Burgess wrote: > + > + It is assumed that memory can be accessed from: > + PTR + (OFFSET_BITS / TARGET_CHAR_BIT) > + to: > + PTR + ((OFFSET_BITS + TARGET_CHAR_BIT - 1)/ TARGET_CHAR_BIT) */ The "to:" part doesn't look right -- LENGTH_BITS seems to be missing somewhere? Also, missing space before second "/". > + bits = TARGET_CHAR_BIT - (offset1_bits % TARGET_CHAR_BIT); Unnecessary parens. > + b1 = *((bfd_byte *) ((uintptr_t) ptr1 + (o1 / TARGET_CHAR_BIT))); > + b2 = *((bfd_byte *) ((uintptr_t) ptr2 + (o2 / TARGET_CHAR_BIT))); No need for uintptr_t, nor the rightmost set of parens: b1 = *((bfd_byte *) ptr1 + o1 / TARGET_CHAR_BIT); b2 = *((bfd_byte *) ptr2 + o2 / TARGET_CHAR_BIT); There may be other instances of unneeded parens. I won't point them all out. > + return memcmp ((void*) ((uintptr_t) ptr1 > + + (offset1_bits / TARGET_CHAR_BIT)), > + (void*) ((uintptr_t) ptr2 > + + (offset2_bits / TARGET_CHAR_BIT)), > + length_bits / TARGET_CHAR_BIT); Space before *. Parens. Otherwise looks OK. Thanks a lot for doing this! -- Pedro Alves