lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5d5443650909140335h6a81c684h2846c5365e144425@mail.gmail.com>
Date:	Mon, 14 Sep 2009 16:05:52 +0530
From:	Trilok Soni <soni.trilok@...il.com>
To:	Joonyoung Shim <jy0922.shim@...sung.com>
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	kmpark@...radead.org, dg77.kim@...sung.com
Subject: Re: [PATCH] HAPTIC: add HAPTIC class

Hi Kyungmin Park,

> +
> +static ssize_t haptic_value_store(struct device *dev,
> +               struct device_attribute *attr, const char *buf, size_t size)
> +{
> +       struct haptic_classdev *haptic_cdev = dev_get_drvdata(dev);
> +       ssize_t ret = -EINVAL;
> +       char *after;
> +       unsigned long state = simple_strtoul(buf, &after, 10);

s/simple_strtoul/strict_strtoul. code looks clean, but let's scan it
through scripts/checkpatch.pl.

> diff --git a/drivers/haptic/haptic.h b/drivers/haptic/haptic.h
> new file mode 100644
> index 0000000..888aaa3
> --- /dev/null
> +++ b/drivers/haptic/haptic.h
> @@ -0,0 +1,35 @@
> +/*
> + *  Haptic Core
> + *
> + *  Copyright (C) 2008 Samsung Electronics
> + *  Kyungmin Park <kyungmin.park@...sung.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#ifndef __HAPTIC_H_INCLUDED
> +#define __HAPTIC_H_INCLUDED
> +
> +#include <linux/device.h>
> +#include <linux/rwsem.h>
> +#include <linux/haptic.h>
> +
> +static inline void haptic_set_value(struct haptic_classdev *haptic_cdev,
> +                                       enum haptic_value value)
> +{
> +       if (value > HAPTIC_FULL)
> +               value = HAPTIC_FULL;
> +       haptic_cdev->value = value;
> +       if (!(haptic_cdev->flags & HAPTIC_SUSPENDED))
> +               haptic_cdev->set(haptic_cdev, value);
> +}
> +
> +static inline int haptic_get_value(struct haptic_classdev *haptic_cdev)
> +{
> +       return haptic_cdev->value;
> +}

You had mentioned in Kconfig help text that haptics set/get APIs can
be accessed from kernel drivers too, I am not able to understand that
from this code.


-- 
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ