Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752841AbcDVG6M (ORCPT ); Fri, 22 Apr 2016 02:58:12 -0400 Received: from canardo.mork.no ([148.122.252.1]:56008 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbcDVG6K convert rfc822-to-8bit (ORCPT ); Fri, 22 Apr 2016 02:58:10 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Vaishali Thakkar Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: core: Do not use sizeof on pointer type Organization: m References: <1461304310-4808-1-git-send-email-vaishali.thakkar@oracle.com> Date: Fri, 22 Apr 2016 08:57:52 +0200 In-Reply-To: <1461304310-4808-1-git-send-email-vaishali.thakkar@oracle.com> (Vaishali Thakkar's message of "Fri, 22 Apr 2016 11:21:50 +0530") Message-ID: <877ffq2kr3.fsf@nemi.mork.no> User-Agent: Gnus/5.130015 (Ma Gnus v0.15) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 391 Lines: 14 Vaishali Thakkar writes: > When sizeof is applied to a pointer typed expression, it gives > the size of the pointer. So, do not use sizeof on pointer type. What if the intended result was the size of the pointer? > Problem found using Coccinelle. Yes, sure. But you cannot just blindly apply the result without reading and understanding the code. Bjørn