From patchwork Tue May 17 17:28:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: anish X-Patchwork-Id: 791952 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4HHSQKF030742 for ; Tue, 17 May 2011 17:28:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755856Ab1EQR20 (ORCPT ); Tue, 17 May 2011 13:28:26 -0400 Received: from mail-px0-f173.google.com ([209.85.212.173]:32974 "EHLO mail-px0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755700Ab1EQR2Z (ORCPT ); Tue, 17 May 2011 13:28:25 -0400 Received: by pxi16 with SMTP id 16so489238pxi.4 for ; Tue, 17 May 2011 10:28:24 -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=agHBzcIBhRYgtjT+HVfIX2ZOKUfjtrZMNV1UNfn2OEo=; b=KZ8Oc7gxvqT4Yrqp5BmXwp3iPbruCT3Sexc4BYjGEQ5gZOv2ylxGn5f2eM7IjcssGf BfjlKzKwtKKgNNOjh90+OabBSFOKjkqTLzlFnNx9mjsC/u3O9g81MVGIJV2VtshDAuRj a1TXZckUhMMaatZqknfX1ygCP7omQB9jjhdsA= 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=pUQ0fmHF6Khkfy2nts0j5QUoIbnvSIztJNM44CKzfWVsG2s5kP/9qA05sV2oEZwqAf SlIiGmwkaWRBon5VLkphTnfSdXneO6kNoU1Nhz2I72h1WiSjZx5wjr1o0xBCcer5Ur7S YDviaTGVdp2cIOzDiLCHOJDAT8L5yIlVNfmqQ= Received: by 10.68.4.129 with SMTP id k1mr1391287pbk.72.1305653294565; Tue, 17 May 2011 10:28:14 -0700 (PDT) Received: from [192.168.0.196] ([123.236.219.232]) by mx.google.com with ESMTPS id 3sm485711pbd.100.2011.05.17.10.28.10 (version=SSLv3 cipher=OTHER); Tue, 17 May 2011 10:28:13 -0700 (PDT) Subject: [patch 1/2] trivial: preferred form for passing a size of struct From: anish To: linux@arm.linux.org.uk, lethal@linux-sh.org Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 17 May 2011 22:58:06 +0530 Message-ID: <1305653286.2182.14.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 (demeter1.kernel.org [140.211.167.41]); Tue, 17 May 2011 17:28:27 +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;