Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2779536ybz; Mon, 27 Apr 2020 04:28:45 -0700 (PDT) X-Google-Smtp-Source: APiQypKthQ8HdBZUwCMhMhUojd4xnAZwmBA4ZNJaSUfE0zu4Anoate4mpm6TtEqKPfLlI9cjtASH X-Received: by 2002:a17:906:1e47:: with SMTP id i7mr19425828ejj.61.1587986925030; Mon, 27 Apr 2020 04:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587986925; cv=none; d=google.com; s=arc-20160816; b=WpGNbMcKQlBAuvuD9S7kAxYE8saylCxmSvfljFYSBWY78ydhIY5llQYymaWomRwllg BLccuKQppuADVuHj2pP2C/Qv4Q4BnykROeOI3pba7uQXSjXnBKPvSFbwCPKI+TsQpup/ IU+LwH4XZ66p+4egs6tWn1Sj/yxFuqsR5INgorIH2qMOUkVfUEYQtXm0qYs6vD8HQP7z xzFJ1dobJuK2UbIlD7LDdZKZRmkZ0vTU+GB0ZMfOocs3p8CDuVG5xxIozFHdmEr3l5Bz +1gwyWl/AWfpGqIctmnr5gIa2TDVy0p8k3fZyc4vA2zmRUbeoxLgQ6CxpMwaYdKTZBu8 aa3Q== 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 :content-language:mime-version:user-agent:date:message-id:autocrypt :from:subject:cc:to:dkim-signature; bh=Q2snkEzLu+ZiuXmNbCxLESiHZucUK5BYWQ130dgIXG4=; b=duDBdsqviaIeY9/IfULdH30NFLJ5ymBcOmPum/1yECQIpuIkQs66Gx5VPUF4gVOpXy Bw+/rLEtrTS8nw9igpDZ+6pCttfK7EcshMgRwapEYihiFKnnoar3KdSd0ZdsVEVMlcLF leuRgeKX40Vui2X+RyFLR3GYOc2+BDloqXfHRWoMSV1CQURmEgM+pVYotL/4SWBA+nrs 0/xRNGWaSdvUGusbafcdP7Ci6oSrqIUQhlNQLr3vBe+5ws97KMyHyw5Jzu9qDUzSUS/B hguLOWP2Gq6X/RjwbfJe14MmXDzsePgtpQ5UmkzjfzI4BgVCYbNNnfE/qgFltLyWNT1l DMlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=W8rMPUR7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si7857924edq.88.2020.04.27.04.28.21; Mon, 27 Apr 2020 04:28:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=W8rMPUR7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbgD0L1G (ORCPT + 99 others); Mon, 27 Apr 2020 07:27:06 -0400 Received: from mout.web.de ([217.72.192.78]:43353 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726504AbgD0L1F (ORCPT ); Mon, 27 Apr 2020 07:27:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1587986811; bh=u35VrCt8medsivMDHaOutmpmvu9KIs/e9Ch87ZjO3vc=; h=X-UI-Sender-Class:To:Cc:Subject:From:Date; b=W8rMPUR7ZHcqDJKxjm66tJwBzxZYUTYGk/NH1cdSIRSS/z5CqFITv8P/peewO4B90 nuMdGpnOET0ElQaYE+9l8exuGtixJuIKMm4yFVgohwXxWm0U/Vbc1YokBCDSgVzOg1 vlYnA/Gwv4frDnqRM1MhZg/3fV3g1z/2zi7v24go= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([93.131.190.48]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lpezi-1iwT6r26y6-00fRdt; Mon, 27 Apr 2020 13:26:51 +0200 To: Aishwarya Ramakrishnan , netdev@vger.kernel.org, Coccinelle Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Madalin Bucur Subject: Re: [PATCH] dpaa_eth: Fix comparing pointer to 0 From: Markus Elfring Autocrypt: addr=Markus.Elfring@web.de; prefer-encrypt=mutual; keydata= mQINBFg2+xABEADBJW2hoUoFXVFWTeKbqqif8VjszdMkriilx90WB5c0ddWQX14h6w5bT/A8 +v43YoGpDNyhgA0w9CEhuwfZrE91GocMtjLO67TAc2i2nxMc/FJRDI0OemO4VJ9RwID6ltwt mpVJgXGKkNJ1ey+QOXouzlErVvE2fRh+KXXN1Q7fSmTJlAW9XJYHS3BDHb0uRpymRSX3O+E2 lA87C7R8qAigPDZi6Z7UmwIA83ZMKXQ5stA0lhPyYgQcM7fh7V4ZYhnR0I5/qkUoxKpqaYLp YHBczVP+Zx/zHOM0KQphOMbU7X3c1pmMruoe6ti9uZzqZSLsF+NKXFEPBS665tQr66HJvZvY GMDlntZFAZ6xQvCC1r3MGoxEC1tuEa24vPCC9RZ9wk2sY5Csbva0WwYv3WKRZZBv8eIhGMxs rcpeGShRFyZ/0BYO53wZAPV1pEhGLLxd8eLN/nEWjJE0ejakPC1H/mt5F+yQBJAzz9JzbToU 5jKLu0SugNI18MspJut8AiA1M44CIWrNHXvWsQ+nnBKHDHHYZu7MoXlOmB32ndsfPthR3GSv jN7YD4Ad724H8fhRijmC1+RpuSce7w2JLj5cYj4MlccmNb8YUxsE8brY2WkXQYS8Ivse39MX BE66MQN0r5DQ6oqgoJ4gHIVBUv/ZwgcmUNS5gQkNCFA0dWXznQARAQABtCZNYXJrdXMgRWxm cmluZyA8TWFya3VzLkVsZnJpbmdAd2ViLmRlPokC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JSAMB/N+yQjIad2ztTckZY pwT6oxng29LzZspTYUEzMz3wK2jQHw+U66qBFk8whA7B2uAU1QdGyPgahLYSOa4XAEGb6wbI FEE= Message-ID: <332befc4-efd1-9303-7c9d-f7f3809cd81e@web.de> Date: Mon, 27 Apr 2020 13:26:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:m1lzIOTWu5edMqRRyCQJq4KBZcNljlhFecvVYZCKRwFDVenNrCG yLvwR/DueaOQGjxOGsTnt1cz3VtG8jQ50xr8vUeCPIPLB0sDNEX5U7vSzG/tfU60KAG33eW 0TE7b7Kc8rVWeE/bZJMFfoFlvOlnWHNyDOLKt7LejYpIntR0caJnAHv2wUes4InCNqoHTpA D2IgUHOeoRPeEpVLMYTRA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:GnzX39we2Gk=:m04wqwdrjegXNR3MXXhVAW /XMWgDlSCRzYcFaiiXewVFjOA/wvi1c0hhkD8WXoRW+1Q+IvO6OM+WjzSLXyw3n4+reY80QAX lAlKxHrnd5cVQgH7D7lXEykPlRtTpBIrC136IrP4Aun30bBm4jTGc40OW+R7WFU5IgbW0EtGT j5js5O65Bg4F/Dut19gw7TIEdin/dsoquqDy3u8108acjGMF7XChfgpCYI8GZm9Q7EuZ8Jj0S E6zE4mfgD0RjlTgBt1gGOxqDBJWY80FpbLCcORunBcftc7y3104M4U2QQsxZYJiAtwCI3sLU+ dtN3n/miHytRNuyqpR/aoyNi/0Eq8nEJsnu9G8Pscdrrnp7LHgxn7d+pgFgg9fV7SDqPu6xt6 8Eo1nMqurpSFpu6z0k3PUj2h77Ol6UTrBWWFc8pPo+nFfJZLIF4EPjdYB4OkiNQUaVYEY0PNM FZoMZVh+PMocNqYnvr0NUNaFCF8n1LesIe3kHXyxnE/oEJjoOXGQc+tSVjDCH+sdzuxhwDgOI xWqFF0bhx7/AcgcJZev2gpu4s1qrR6ZHLAl59fZHSDBhzvIpqK3mCslcF1Too1BWx7CAKSDAK s8swH6QWop6DIQDDcxEEtVZ3ru+lz29Clvf/KX13jlFGMA02CcraLSfxY+Tq+lTTwbiq+W4ap /3hLNAq5Cywjfmj4qG5i98QitJQI8kBAwAqpjloJl0b2MOky4JTkcxMdE823QCUkA9/iV7S4b 6sc94rocoiWeBH20OXM+kpaR0VQQUELLOfxwUMThV+R7pVjMD+klOUVRf3hWya0ZL0sGtVqyf SoYYLE8YUgryu3eubEsB2oSVwgeUR51YfBmQqOS4Wu210S4rKgyLmZ75cWpddHdl0u8GBNtH7 MuEjf3pTkERZGlyoUnmDeRmih76J6fuYSEELmlRLLO1bChlFb0caWrBGVNbi3pCU8fMjYg7rF FMOoqyaPJCUgbNYuGMawrp6JazYJCkKKC+zQDzTmXzrjG5JM3oOwFQ1jXju02C2ypdRqbC+Rd s+BMdR3HN8wlifhwWc8JjOfgfO42bHdw37VFCHMTkaKqJ/oSU+PpZTXey8j56WcxDdAEJ+8kc 2V881kfFmMpxQUHMIL9EFYsc/6WbfnrPtoLx9DN7dPgU61PvhyHV93/+fLywuZ5k0qHrnYbLA ZHEXqdVaXWdakJJuZlV31s8NM/234x2MyZFRfFSfVI0lM+lHot5ZB3gbS6qhE9VKJ0CJbcUX6 5u9L0RffmvS1Dr7RN Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Fixes coccicheck warning: > ./drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2110:30-31: > WARNING comparing pointer to 0 Such information is actually provided by a known script for the semantic patch language. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/scr= ipts/coccinelle/null/badzero.cocci > Avoid pointer type value compared to 0. But I suggest to reconsider corresponding software development consequence= s also around mentioned implementation details. =E2=80=A6 > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c > @@ -2107,7 +2107,7 @@ static int dpaa_a050385_wa(struct net_device *net_= dev, struct sk_buff **s) =E2=80=A6 > start =3D PTR_ALIGN(new_skb->data, DPAA_A050385_ALIGN); > - if (start - new_skb->data !=3D 0) > + if (start - new_skb->data) > skb_reserve(new_skb, start - new_skb->data); =E2=80=A6 I interpret the source code in the way that a subtraction is performed with two pointers. I would expect that such a pointer difference has got an integral data type. Will this view trigger any further software evolution? Regards, Markus