Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3067427imm; Sun, 1 Jul 2018 11:29:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9udjoSQKEjmadhdAtHhrFiTAxmV1BRkv9u3szOrrlCV7HgW9vTIYexhFiI2iQ5lLezDWq X-Received: by 2002:a62:4ad3:: with SMTP id c80-v6mr22533127pfj.23.1530469751553; Sun, 01 Jul 2018 11:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469751; cv=none; d=google.com; s=arc-20160816; b=hdakPEXpzhNSiWcYT90CVmHMiQmz8iaW4A6JI5olhqty6zchyY7gsKJYes5ILpzUQ4 0lgFQdDLHmclrOk20q9i8wdBWuJ+cRufxNX7BR9S/knVhVpR2IybxPmrsPzjvmjynPip 39nZVzM3dnqR4FxCyAGXAsZJxsNZaxYyjjns8SLca27PHdQ/ZRLob4Y/yeeLPp17cn2q CaSJiVH9utCTgt2XxVt0DLfD5iNDEJ6zjcUVl1sx3/ao9Tays/v33ohSBtY8CRo6+xvu k9oOUkDx1STRXmNsazkbTSuxH/fvvIsKl+F4r13VnB4EXUnjpS+68e10wxL2XjnwEMSz xF0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=uQVQfDucn4uWwOywU/XCNFiIK06Ygu8UveEdtHdSt/M=; b=XQsnamE3uAJQC0ukKmwSp5Fquszi4vHuFh70l/hCqEuvwzwaw0rYDDs07hwxJnBnKq KpBo73f4mjtnriq4cbVvH7ocGZTnIV6HBVZWz6JD0bBe4Ml8BSrFaDs6G6qoMgEEVueB EPr717nSzptAORVPGEupf0XJJdBaYwNchjrxmB6kzIuuSMznODqh+JD0e24Zj00lBK3g LVcHUjCRqqHOn4b5bHvY+R4uIDhNGD/ky/KglkgwKoq0jfM2NDTD4EMiUYA11A9+GsSg xtWX5XPfBMr83vbpfknkQeqLEivLxm0Vd9CJRBM7qKr7RvfNDo+FSec/RHct2qAviHT4 vI+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s126-v6si15012998pfc.222.2018.07.01.11.28.57; Sun, 01 Jul 2018 11:29:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965152AbeGAS0n (ORCPT + 99 others); Sun, 1 Jul 2018 14:26:43 -0400 Received: from smtprelay0062.hostedemail.com ([216.40.44.62]:37011 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753200AbeGAS0h (ORCPT ); Sun, 1 Jul 2018 14:26:37 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 8AA6D181D341D; Sun, 1 Jul 2018 18:26:35 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:960:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:1801:2393:2525:2559:2563:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3350:3622:3865:3867:3868:3870:3871:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6119:7903:8603:9025:10004:10049:10400:10848:11026:11232:11257:11658:11914:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21324:21451:21627:30054:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: bird78_56799f9de8425 X-Filterd-Recvd-Size: 1503 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Sun, 1 Jul 2018 18:26:34 +0000 (UTC) Message-ID: <653914f26dc8433a3f682b5e7eb850ab94bd431d.camel@perches.com> Subject: Re: [PATCH 0/3] cast sizeof to int for comparison From: Joe Perches To: Julia Lawall , linux-usb@vger.kernel.org, Chengguang Xu Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-media@vger.kernel.org Date: Sun, 01 Jul 2018 11:26:32 -0700 In-Reply-To: <1530466325-1678-1-git-send-email-Julia.Lawall@lip6.fr> References: <1530466325-1678-1-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2018-07-01 at 19:32 +0200, Julia Lawall wrote: > Comparing an int to a size, which is unsigned, causes the int to become > unsigned, giving the wrong result. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) Great, thanks. But what about the ones in net/smc like: > net/smc/smc_clc.c: > > len = kernel_sendmsg(smc->clcsock, &msg, &vec, 1, > sizeof(struct smc_clc_msg_decline)); > if (len < sizeof(struct smc_clc_msg_decline)) Are those detected by the semantic match and ignored?