Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1aebe18787ca2e915eb8204d365ba2484d53223b
Commit:     1aebe18787ca2e915eb8204d365ba2484d53223b
Parent:     9b99628f8e9e0b5f5ecacce558defe529a6e00c1
Author:     Mariusz Kozlowski <[EMAIL PROTECTED]>
AuthorDate: Sat Aug 11 22:34:29 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Sat Aug 11 22:34:48 2007 +0200

    drivers/block/cciss.c: kmalloc + memset conversion to kzalloc
    
     drivers/block/cciss.c | 104285 -> 104168 (-117 bytes)
     drivers/block/cciss.o | 277400 -> 277124 (-276 bytes)
    
    Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>
    Acked-by: Mike Miller <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 drivers/block/cciss.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index a11b2bd..084358a 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, 
sector_t *total_size,
 {
        ReadCapdata_struct *buf;
        int return_code;
-       buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
-       if (buf == NULL) {
+
+       buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
+       if (!buf) {
                printk(KERN_WARNING "cciss: out of memory\n");
                return;
        }
-       memset(buf, 0, sizeof(ReadCapdata_struct));
+
        if (withirq)
                return_code = sendcmd_withirq(CCISS_READ_CAPACITY,
                                ctlr, buf, sizeof(ReadCapdata_struct),
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, 
sector_t *total_size,
                printk(KERN_INFO "      blocks= %llu block_size= %d\n",
                (unsigned long long)*total_size+1, *block_size);
        kfree(buf);
-       return;
 }
 
 static void
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int 
withirq, sector_t *total_size,
 {
        ReadCapdata_struct_16 *buf;
        int return_code;
-       buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
-       if (buf == NULL) {
+
+       buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
+       if (!buf) {
                printk(KERN_WARNING "cciss: out of memory\n");
                return;
        }
-       memset(buf, 0, sizeof(ReadCapdata_struct_16));
+
        if (withirq) {
                return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16,
                        ctlr, buf, sizeof(ReadCapdata_struct_16),
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, 
sector_t *total_size,
        printk(KERN_INFO "      blocks= %llu block_size= %d\n",
               (unsigned long long)*total_size+1, *block_size);
        kfree(buf);
-       return;
 }
 
 static int cciss_revalidate(struct gendisk *disk)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to