From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbiEZL5O (ORCPT ); Thu, 26 May 2022 07:57:14 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3170AC8BEA for ; Thu, 26 May 2022 04:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=cf4ZicpALhMG0lullZ+71xwIlFAPTDEPsNLGwGbctl0=; b=CCy4qZ4hDEqMuZxlcnJMMovaJ4AFcVeUhKtlgnaqrz46Pndab+BaZ/b6mivXz8ckw+Re UBjhWIMob6GT3OSSwJvIqQG11MrBf6avDdaXFYIvJQ6F3eyzKAtWgS6OXT5aBqT36RzW rDTWDEVahajVlwU9w7BMXCwOg5FNgbiBl89va73PXJ2cXwdn6P/d68TloL8lHy2VPPPC Qcm+ZqNVL6g3yJOi8jFY7L5DslACvFPF/PpaXJqXGYfQpRbwy3ebvlIOGaVK+gNo5oHh TE/d6xCKHWjy1IgtrTRZ9s+qZEPzLwYmAnYmO7TBc/xRRkcI+CmYm8HlJT5nuOX6Pbx4 Gw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cf4ZicpALhMG0lullZ+71xwIlFAPTDEPsNLGwGbctl0=; b=reGcSFxPqD/zoEURFiCdrcrNEIRY+xMBgXpdNqY6zY2JWSXm2Z0mO8XtL4WOqDjEg8rsjlYLwdUqLiZzyyfb21xRnnwnEVZKWt2wBK0mbhgqbV15WRqa7e9xy3Ts7X4BfCiNwGXmSsb7HzuSW5foGd94kB5B+Qiv4hrsSo3Px6Y= Date: Thu, 26 May 2022 14:56:58 +0300 From: Dan Carpenter Subject: Re: [PATCH] check_all_func_returns: Fix a test against "vfprintf" Message-ID: <20220526115658.GG2146@kadam> References: <7f65bbf1d9bb030d3c40c0eb80068268ba46cd10.1653557599.git.christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f65bbf1d9bb030d3c40c0eb80068268ba46cd10.1653557599.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 List-ID: To: Christophe JAILLET , John Levon Cc: smatch@vger.kernel.org On Thu, May 26, 2022 at 11:33:30AM +0200, Christophe JAILLET wrote: > It is likely that a "== 0" is missing here, or the "if" will be always > true. In such a case, it would be easier to remove it altogether. > > Signed-off-by: Christophe JAILLET > --- > Speculative. Un-tested. Looks correct. Applied. This is for illumos, so I've added John to the CC list. regards, dan carpenter > --- > check_all_func_returns.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/check_all_func_returns.c b/check_all_func_returns.c > index 1ff50433d57b..bd87e1adbc7a 100644 > --- a/check_all_func_returns.c > +++ b/check_all_func_returns.c > @@ -55,7 +55,7 @@ static void check_func_return(struct expression *expr) > if (strcmp(func, "printf") == 0 || strcmp(func, "vprintf") == 0) > return; > > - if (strcmp(func, "fprintf") == 0 || strcmp(func, "vfprintf")) { > + if (strcmp(func, "fprintf") == 0 || strcmp(func, "vfprintf") == 0) { > const char *arg0 = expr_to_str(get_argument_from_call_expr(expr->args, 0)); > > if (arg0 != NULL && > -- > 2.34.1