Received: by 10.223.176.5 with SMTP id f5csp660435wra; Tue, 6 Feb 2018 05:24:58 -0800 (PST) X-Google-Smtp-Source: AH8x227lLDgtkX/5WXD6pGXudp0uaxZUFX6Pn/zXvovtozprX5EO+rIYY0BBl9J7UKcvrRutNaeZ X-Received: by 2002:a17:902:8f94:: with SMTP id z20-v6mr2436904plo.72.1517923498480; Tue, 06 Feb 2018 05:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517923498; cv=none; d=google.com; s=arc-20160816; b=hhjuRRQtZzxUL+bs7e6LF3eqXpbX0m249yNFyVHBrQbNeorX2vHSL96ejjIoMkg+8g UeFhZdbspJQwR+3wQ+h008NQHcU0gn4LoebdGgwcy4ziiDOoz5U2JUaWwjt/HqxOMPZT 1xSaGsSQ8v1V+Cl+YCVmQLzSgpgnZF3RDqiQyBHSRFN//EpAnBxzXltRWoP4cQRwe9ey tLAlV+1deEQZpyD1hHUuDQy0lCrcGKjYpdTny/KMiTh9wY40T28zrpyjN8zWEoaJPF4c VdV9D1vAu6ZWifUQ0DsadiNpYI2jO7dUiDHyJjdG44WMKNWOlzY/kXevTj9AWbo0oMdI UR2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=2yluxyymdQMRCRitJ3+xqqshIQtzIOnuwxLN5AEJzb4=; b=02i8o2UPsJRdJIRhpORaLAJJcmuhES22nOAHJCIO3XT9pw2V+ydXletBhvxBS3eRL/ brWg/9j0Ikea9EfeUnoRaKYnByUeWcTUFt6mDh5RYYDjPGmfKUzDaizWFNi/hSTkl0jM p/gy7TlZJzpZq6NRdMF/BM1LwWRyrn+ptYGuC6XW1c0yqcVXaZF+7a2hMcZ81yHqt5mQ 809EXihtXbxc5WR6dqV8qtQXnPqP045xe0UdJtraYyXePw4Up/6Wk+R0NsANoCn6PkPP bZjFJADatrvMCVaI8n11KIh9NhzL3Urhy1KSptnRXSk3SlCfS/GDQ9JYjxVhb9D15AdJ 8IAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Q5+VHaj+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j63si6875827pgc.591.2018.02.06.05.24.44; Tue, 06 Feb 2018 05:24:58 -0800 (PST) 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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Q5+VHaj+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752053AbeBFNYU (ORCPT + 99 others); Tue, 6 Feb 2018 08:24:20 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:45552 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbeBFNYM (ORCPT ); Tue, 6 Feb 2018 08:24:12 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w16DMELn055740; Tue, 6 Feb 2018 13:23:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=2yluxyymdQMRCRitJ3+xqqshIQtzIOnuwxLN5AEJzb4=; b=Q5+VHaj+weivwF7fTociL27MOVcBRPJdncPEHLtOBFBUfgugOBB/8DCmTHoxKZbbuE/u BtZKI7CvgCy2JP0Jg8GIYlAmcgx4BQu2AC8XUzJWe+NZ+d3QwPbDcwLqS9XSMfIpRSYO /kNlR0XZwpe5EtvzCP0bn2mHmxaghJmH6gRT/vyeRhnWOvXkeMpmn+RglKAB/TJS5R05 IZPbRQ2ZAfDJuVo8F2w2lNCppbap8w7V3tLuuyLawE9CtJcJIUcqzT2LHtW6+PLjRaqt Fyk0p6+6PJj5vDKKaqgUz7kzbBnvCbjXkVqNGyd0KQNaRc4AkzcmDxa8HPBvFimU2cmU 8g== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2fycqd04c1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Feb 2018 13:23:49 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w16DNmk4030877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Feb 2018 13:23:48 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w16DNltC007218; Tue, 6 Feb 2018 13:23:48 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Feb 2018 05:23:47 -0800 Date: Tue, 6 Feb 2018 16:23:35 +0300 From: Dan Carpenter To: Julia Lawall Cc: Wolfram Sang , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask Message-ID: <20180206132335.luut6em3kut7f7ej@mwanda> References: <20180205201002.23621-1-wsa+renesas@sang-engineering.com> <20180206131044.oso33fvv553trrd7@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8796 signatures=668662 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=523 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802060169 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 06, 2018 at 02:15:51PM +0100, Julia Lawall wrote: > > > On Tue, 6 Feb 2018, Dan Carpenter wrote: > > > On Mon, Feb 05, 2018 at 09:09:57PM +0100, Wolfram Sang wrote: > > > In one Renesas driver, I found a typo which turned an intended bit shift ('<<') > > > into a comparison ('<'). Because this is a subtle issue, I looked tree wide for > > > similar patterns. This small patch series is the outcome. > > > > > > Buildbot and checkpatch are happy. Only compile-tested. To be applied > > > individually per sub-system, I think. I'd think only the net: amd: patch needs > > > to be conisdered for stable, but I leave this to people who actually know this > > > driver. > > > > > > CCing Dan. Maybe he has an idea how to add a test to smatch? In my setup, only > > > cppcheck reported a 'coding style' issue with a low prio. > > > > > > > Most of these are inside macros so it makes it complicated for Smatch > > to warn about them. It might be easier in Coccinelle. Julia the bugs > > look like this: > > > > - reissue_mask |= 0xffff < 4; > > + reissue_mask |= 0xffff << 4; > > Thanks. I'll take a look. Do you have an example of the macro issue > handy? > It's the same: #define EXYNOS_CIIMGEFF_PAT_CBCR_MASK ((0xff < 13) | (0xff < 0)) Smatch only sees the outside of the macro (where it is used in the code) and the pre-processed code. regards, dan carpenter