Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422754AbcK3SvX (ORCPT ); Wed, 30 Nov 2016 13:51:23 -0500 Received: from aserp1050.oracle.com ([141.146.126.70]:31790 "EHLO aserp1050.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932503AbcK3SvG (ORCPT ); Wed, 30 Nov 2016 13:51:06 -0500 Date: Wed, 30 Nov 2016 21:48:22 +0300 From: Dan Carpenter To: eranian@google.com Cc: Alexander Shishkin , linux-kernel@vger.kernel.org Subject: [bug report] perf jit: add source line info support Message-ID: <20161130184822.GA15376@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: aserp1040.oracle.com [141.146.126.69] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1195 Lines: 33 Hello Stephane Eranian, The patch 598b7c6919c7: "perf jit: add source line info support" from Nov 30, 2015, leads to the following static checker warning: ./tools/perf/util/genelf_debug.c:211 emit_signed_LEB128() warn: potential left shift more than type allows '57' ./tools/perf/util/genelf_debug.c 202 static void emit_signed_LEB128(struct buffer_ext *be, long data) 203 { 204 int more = 1; 205 int negative = data < 0; 206 int size = sizeof(long) * CHAR_BIT; 207 while (more) { 208 ubyte cur = data & 0x7F; 209 data >>= 7; 210 if (negative) 211 data |= - (1 << (size - 7)); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is a no-op on 64 bit systems. I suspect it's not intentional? 212 if ((data == 0 && !(cur & 0x40)) || 213 (data == -1l && (cur & 0x40))) 214 more = 0; 215 else 216 cur |= 0x80; 217 buffer_ext_add(be, &cur, 1); 218 } 219 } regards, dan carpenter