From patchwork Wed May 18 18:07:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: anish X-Patchwork-Id: 794312 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4II7DcL007574 for ; Wed, 18 May 2011 18:07:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933337Ab1ERSHM (ORCPT ); Wed, 18 May 2011 14:07:12 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:62608 "EHLO mail-px0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757115Ab1ERSHL (ORCPT ); Wed, 18 May 2011 14:07:11 -0400 Received: by pxi16 with SMTP id 16so1233148pxi.4 for ; Wed, 18 May 2011 11:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:cc:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=0WS4LgV2Tc8Y25VXlvKgjTCjBUHnGEGN+NwZH8FmOYI=; b=xTfoHGiD+hpUWij6fGeKAVJb5WZ8+v6WvcSoyoC0aie0aCuUkTNUsDnAGNKO3zhA46 O2Csaa+2wQ3WDH4OSKUKy3h7qGVmEBz37bVV5SNyhBu7NPYE6/1SahzI00+u3XaWafG3 u4HRoglG1uJVcyzawlulq2bjc+5rMIVDqU1yM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=U/bEaczepXxte8HLnPf9IyHdVIEkNg62BSE7sMukOXn5n52IOoYztYqoBr7Zf3mOgc PLDyYsS1s+udfFZ0ozr88sHXtfwWbXDxkN5ivySnpmg9REp2DgzVVSCuPtFW7azqUAmo GZIB2c6HR3x9Z8e/kOhklbHeXOEU9UEE2Jaew= Received: by 10.68.67.212 with SMTP id p20mr3238210pbt.399.1305742030782; Wed, 18 May 2011 11:07:10 -0700 (PDT) Received: from [192.168.0.196] ([123.238.81.37]) by mx.google.com with ESMTPS id k8sm1193932pbk.66.2011.05.18.11.07.06 (version=SSLv3 cipher=OTHER); Wed, 18 May 2011 11:07:09 -0700 (PDT) Subject: [patch 1/2] trivial: amba-clcd.c preferred form of passing size of structure From: anish To: linux@arm.linux.org.uk, lethal@linux-sh.org Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 18 May 2011 23:37:06 +0530 Message-ID: <1305742026.8771.26.camel@anish-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 18 May 2011 18:07:13 +0000 (UTC) The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...); Please refer Documentation/Codingstyle chapter 14 Signed-off-by: anish kumar --- drivers/video/amba-clcd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 5fc983c..cb7ec86 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -549,7 +549,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id) goto out; } - fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL); + fb = kzalloc(sizeof(*fb), GFP_KERNEL); if (!fb) { printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n"); ret = -ENOMEM;