@@ -673,8 +673,6 @@ static void sh_cmt_register_clockevent(struct sh_cmt_channel *ch,
{
struct clock_event_device *ced = &ch->ced;
- memset(ced, 0, sizeof(*ced));
-
ced->name = name;
ced->features = CLOCK_EVT_FEAT_PERIODIC;
ced->features |= CLOCK_EVT_FEAT_ONESHOT;
@@ -710,7 +708,6 @@ static int sh_cmt_setup_channel(struct sh_cmt_channel *ch, unsigned int index,
int irq;
int ret;
- memset(ch, 0, sizeof(*ch));
ch->cmt = cmt;
ch->base = cmt->mapbase_ch;
ch->index = index;
@@ -760,7 +757,6 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
int ret;
ret = -ENXIO;
- memset(cmt, 0, sizeof(*cmt));
cmt->pdev = pdev;
if (!cfg) {
@@ -863,7 +859,7 @@ static int sh_cmt_probe(struct platform_device *pdev)
goto out;
}
- cmt = kmalloc(sizeof(*cmt), GFP_KERNEL);
+ cmt = kzalloc(sizeof(*cmt), GFP_KERNEL);
if (cmt == NULL) {
dev_err(&pdev->dev, "failed to allocate driver data\n");
return -ENOMEM;
One kzalloc a day keeps the bugs away. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- drivers/clocksource/sh_cmt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)