From patchwork Thu May 16 20:55:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Wang X-Patchwork-Id: 2580071 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D62FCE0143 for ; Thu, 16 May 2013 20:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824Ab3EPU5U (ORCPT ); Thu, 16 May 2013 16:57:20 -0400 Received: from mail-gh0-f181.google.com ([209.85.160.181]:54230 "EHLO mail-gh0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752332Ab3EPU5T (ORCPT ); Thu, 16 May 2013 16:57:19 -0400 Received: by mail-gh0-f181.google.com with SMTP id z12so725662ghb.26 for ; Thu, 16 May 2013 13:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=Jwnry4tbR1AKHiqjrCAl42R82RABHOLWxXZ5OiIEHJo=; b=aaej40W60APmtqMLinWRiArEnXqIboFuzvKLDnULY+r6SK+qHfiyMlJw8WRrn5gqJ8 ziqbdsa20bGT5A0NiWfgcXJcKm2kjPx30MXJRE5fUZkDMFALDxO0zFY2KA7D96xnCTQ9 zrvhRBmlbsjwjsJAj5O/SYIUcKNGPSpX7M3LAfyxMDvnEBkxhvpAbJernz9gRz2oQVMR TrQdhmrULS4DDQEx1FVgi8tKaj3L0yJlHW+46pir9I5DoGd+fC4hQ+lYKZ97RIacdyAP OIpgZEc9qr3fV6y8bDQ6Ug9lAvvpYgX0r873Ga3aOqjwrxCnz+6n8uXs4Eau5B8JI5+p t1dw== X-Received: by 10.236.127.12 with SMTP id c12mr24011027yhi.88.1368737838710; Thu, 16 May 2013 13:57:18 -0700 (PDT) Received: from hchen.csail.mit.edu (hchen.csail.mit.edu. [18.26.5.5]) by mx.google.com with ESMTPSA id d51sm11882411yho.14.2013.05.16.13.57.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 13:57:18 -0700 (PDT) From: Xi Wang To: linux-sparse@vger.kernel.org Cc: sparse@chrisli.org, Xi Wang Subject: [PATCH] fix pointer casts in evaluate_compare() Date: Thu, 16 May 2013 16:55:33 -0400 Message-Id: <1368737733-6475-1-git-send-email-xi.wang@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org The results of cast_to() seem unused. Assign them to expr->left and expr->right. Signed-off-by: Xi Wang --- evaluate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/evaluate.c b/evaluate.c index 0dfa519..d9c767f 100644 --- a/evaluate.c +++ b/evaluate.c @@ -1024,11 +1024,11 @@ static struct symbol *evaluate_compare(struct expression *expr) goto OK; } if (is_null1 && (rclass & TYPE_PTR)) { - left = cast_to(left, rtype); + expr->left = cast_to(left, rtype); goto OK; } if (is_null2 && (lclass & TYPE_PTR)) { - right = cast_to(right, ltype); + expr->right = cast_to(right, ltype); goto OK; } } @@ -1044,11 +1044,11 @@ static struct symbol *evaluate_compare(struct expression *expr) if (expr->op == SPECIAL_EQUAL || expr->op == SPECIAL_NOTEQUAL) { if (ltype->ctype.as == rtype->ctype.as) { if (lbase == &void_ctype) { - right = cast_to(right, ltype); + expr->right = cast_to(right, ltype); goto OK; } if (rbase == &void_ctype) { - left = cast_to(left, rtype); + expr->left = cast_to(left, rtype); goto OK; } }