From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933271Ab1ESP3C (ORCPT ); Thu, 19 May 2011 11:29:02 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:58081 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754538Ab1ESP3A (ORCPT ); Thu, 19 May 2011 11:29:00 -0400 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=vFfhT32xNubXa5vrVv2Xb3f/AK5AZCq48NnoaqnAivd4o9QvOgqddg9nogDJ36Vm1l IpL4a0Tp+j4Nwbv8W1mu9OqIvlMIcLYQbPs0NEsmOmJ+K5ObvfAIJE/TQCumOrK8y9TU 4/BGpjx39SBLbP3CLC7D61y3X+CFN9nYg/PWA= Subject: [patch 2/3] Staging: sm7xx: preferred form for passing a size to memory allocation routines From: anish To: greg@kroah.com, teddy.wang@siliconmotion.com.cn Cc: linux-kernel@vger.kernel.org, harryxiyou@gmail.com Content-Type: text/plain; charset="UTF-8" Date: Thu, 19 May 2011 20:58:51 +0530 Message-ID: <1305818931.2336.39.camel@anish-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: anish kumar 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 Acked-by: Harry Wei --- drivers/staging/sm7xx/smtcfb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/sm7xx/smtcfb.c b/drivers/staging/sm7xx/smtcfb.c index 1aca0cb..c41d2f7 100644 --- a/drivers/staging/sm7xx/smtcfb.c +++ b/drivers/staging/sm7xx/smtcfb.c @@ -714,7 +714,7 @@ static struct smtcfb_info *smtc_alloc_fb_info(struct pci_dev *dev, { struct smtcfb_info *sfb; - sfb = kzalloc(sizeof(struct smtcfb_info), GFP_KERNEL); + sfb = kzalloc(sizeof(*sfb), GFP_KERNEL); if (!sfb) return NULL; -- 1.7.0.4