linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify()
@ 2009-05-20  5:34 Jaswinder Singh Rajput
  2009-05-20  7:22 ` Evgeniy Polyakov
  0 siblings, 1 reply; 5+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-20  5:34 UTC (permalink / raw)
  To: Ingo Molnar, Evgeniy Polyakov, Andrew Morton, David Miller,
	x86 maintainers, LKML


Currently cn_test_want_notify() is not having any user.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 Documentation/connector/cn_test.c |   77 -------------------------------------
 1 files changed, 0 insertions(+), 77 deletions(-)

diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c
index 6977c17..e12d9d7 100644
--- a/Documentation/connector/cn_test.c
+++ b/Documentation/connector/cn_test.c
@@ -41,83 +41,6 @@ void cn_test_callback(void *data)
 	       msg->seq, msg->ack, msg->len, (char *)msg->data);
 }
 
-static int cn_test_want_notify(void)
-{
-	struct cn_ctl_msg *ctl;
-	struct cn_notify_req *req;
-	struct cn_msg *msg = NULL;
-	int size, size0;
-	struct sk_buff *skb;
-	struct nlmsghdr *nlh;
-	u32 group = 1;
-
-	size0 = sizeof(*msg) + sizeof(*ctl) + 3 * sizeof(*req);
-
-	size = NLMSG_SPACE(size0);
-
-	skb = alloc_skb(size, GFP_ATOMIC);
-	if (!skb) {
-		printk(KERN_ERR "Failed to allocate new skb with size=%u.\n",
-		       size);
-
-		return -ENOMEM;
-	}
-
-	nlh = NLMSG_PUT(skb, 0, 0x123, NLMSG_DONE, size - sizeof(*nlh));
-
-	msg = (struct cn_msg *)NLMSG_DATA(nlh);
-
-	memset(msg, 0, size0);
-
-	msg->id.idx = -1;
-	msg->id.val = -1;
-	msg->seq = 0x123;
-	msg->ack = 0x345;
-	msg->len = size0 - sizeof(*msg);
-
-	ctl = (struct cn_ctl_msg *)(msg + 1);
-
-	ctl->idx_notify_num = 1;
-	ctl->val_notify_num = 2;
-	ctl->group = group;
-	ctl->len = msg->len - sizeof(*ctl);
-
-	req = (struct cn_notify_req *)(ctl + 1);
-
-	/*
-	 * Idx.
-	 */
-	req->first = cn_test_id.idx;
-	req->range = 10;
-
-	/*
-	 * Val 0.
-	 */
-	req++;
-	req->first = cn_test_id.val;
-	req->range = 10;
-
-	/*
-	 * Val 1.
-	 */
-	req++;
-	req->first = cn_test_id.val + 20;
-	req->range = 10;
-
-	NETLINK_CB(skb).dst_group = ctl->group;
-	//netlink_broadcast(nls, skb, 0, ctl->group, GFP_ATOMIC);
-	netlink_unicast(nls, skb, 0, 0);
-
-	printk(KERN_INFO "Request was sent. Group=0x%x.\n", ctl->group);
-
-	return 0;
-
-nlmsg_failure:
-	printk(KERN_ERR "Failed to send %u.%u\n", msg->seq, msg->ack);
-	kfree_skb(skb);
-	return -EINVAL;
-}
-
 static u32 cn_test_timer_counter;
 static void cn_test_timer_func(unsigned long __data)
 {
-- 
1.6.1.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify()
  2009-05-20  5:34 [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify() Jaswinder Singh Rajput
@ 2009-05-20  7:22 ` Evgeniy Polyakov
  2009-05-20  7:42   ` Jaswinder Singh Rajput
  0 siblings, 1 reply; 5+ messages in thread
From: Evgeniy Polyakov @ 2009-05-20  7:22 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Ingo Molnar, Andrew Morton, David Miller, x86 maintainers, LKML

On Wed, May 20, 2009 at 11:04:53AM +0530, Jaswinder Singh Rajput (jaswinder@kernel.org) wrote:
> 
> Currently cn_test_want_notify() is not having any user.

Do not remove it, disable with ifdef if you want, it is an example
of how to get notifications about new connector user registration.

-- 
	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify()
  2009-05-20  7:22 ` Evgeniy Polyakov
@ 2009-05-20  7:42   ` Jaswinder Singh Rajput
  2009-05-20  9:27     ` Evgeniy Polyakov
  2009-05-27  8:37     ` Jaswinder Singh Rajput
  0 siblings, 2 replies; 5+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-20  7:42 UTC (permalink / raw)
  To: Evgeniy Polyakov
  Cc: Ingo Molnar, Andrew Morton, David Miller, x86 maintainers, LKML

On Wed, 2009-05-20 at 11:22 +0400, Evgeniy Polyakov wrote:
> On Wed, May 20, 2009 at 11:04:53AM +0530, Jaswinder Singh Rajput (jaswinder@kernel.org) wrote:
> > 
> > Currently cn_test_want_notify() is not having any user.
> 
> Do not remove it, disable with ifdef if you want, it is an example
> of how to get notifications about new connector user registration.
> 

[PATCH -tip] Documentation/connector/cn_test.c comment unused cn_test_want_notify()

Currently cn_test_want_notify() is not having any user.

So adding ifdef and comment which tells to not remove it.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 Documentation/connector/cn_test.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c
index 6977c17..f688eba 100644
--- a/Documentation/connector/cn_test.c
+++ b/Documentation/connector/cn_test.c
@@ -41,6 +41,12 @@ void cn_test_callback(void *data)
 	       msg->seq, msg->ack, msg->len, (char *)msg->data);
 }
 
+/*
+ * Do not remove this function even if no one is using it as
+ * this is an example of how to get notifications about new
+ * connector user registration
+ */
+#if 0
 static int cn_test_want_notify(void)
 {
 	struct cn_ctl_msg *ctl;
@@ -117,6 +123,7 @@ nlmsg_failure:
 	kfree_skb(skb);
 	return -EINVAL;
 }
+#endif
 
 static u32 cn_test_timer_counter;
 static void cn_test_timer_func(unsigned long __data)
-- 
1.6.0.6




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify()
  2009-05-20  7:42   ` Jaswinder Singh Rajput
@ 2009-05-20  9:27     ` Evgeniy Polyakov
  2009-05-27  8:37     ` Jaswinder Singh Rajput
  1 sibling, 0 replies; 5+ messages in thread
From: Evgeniy Polyakov @ 2009-05-20  9:27 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: Ingo Molnar, Andrew Morton, David Miller, x86 maintainers, LKML

On Wed, May 20, 2009 at 01:12:28PM +0530, Jaswinder Singh Rajput (jaswinder@kernel.org) wrote:
> [PATCH -tip] Documentation/connector/cn_test.c comment unused cn_test_want_notify()
> 
> Currently cn_test_want_notify() is not having any user.
> 
> So adding ifdef and comment which tells to not remove it.
> 
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>

Looks good, thank you Jaswinder.
Ack.

-- 
	Evgeniy Polyakov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify()
  2009-05-20  7:42   ` Jaswinder Singh Rajput
  2009-05-20  9:27     ` Evgeniy Polyakov
@ 2009-05-27  8:37     ` Jaswinder Singh Rajput
  1 sibling, 0 replies; 5+ messages in thread
From: Jaswinder Singh Rajput @ 2009-05-27  8:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Ingo Molnar, David Miller, x86 maintainers, LKML,
	Evgeniy Polyakov

Hello Andrew,

If you want, you can also apply this patch along with another
Documentation patch.

And also add ACK from Evgeniy Polyakov <zbr@ioremap.net>

Thanks,
--
JSR

On Wed, 2009-05-20 at 13:12 +0530, Jaswinder Singh Rajput wrote:
> On Wed, 2009-05-20 at 11:22 +0400, Evgeniy Polyakov wrote:
> > On Wed, May 20, 2009 at 11:04:53AM +0530, Jaswinder Singh Rajput (jaswinder@kernel.org) wrote:
> > > 
> > > Currently cn_test_want_notify() is not having any user.
> > 
> > Do not remove it, disable with ifdef if you want, it is an example
> > of how to get notifications about new connector user registration.
> > 
> 
> [PATCH -tip] Documentation/connector/cn_test.c comment unused cn_test_want_notify()
> 
> Currently cn_test_want_notify() is not having any user.
> 
> So adding ifdef and comment which tells to not remove it.
> 
> Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
> ---
>  Documentation/connector/cn_test.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c
> index 6977c17..f688eba 100644
> --- a/Documentation/connector/cn_test.c
> +++ b/Documentation/connector/cn_test.c
> @@ -41,6 +41,12 @@ void cn_test_callback(void *data)
>  	       msg->seq, msg->ack, msg->len, (char *)msg->data);
>  }
>  
> +/*
> + * Do not remove this function even if no one is using it as
> + * this is an example of how to get notifications about new
> + * connector user registration
> + */
> +#if 0
>  static int cn_test_want_notify(void)
>  {
>  	struct cn_ctl_msg *ctl;
> @@ -117,6 +123,7 @@ nlmsg_failure:
>  	kfree_skb(skb);
>  	return -EINVAL;
>  }
> +#endif
>  
>  static u32 cn_test_timer_counter;
>  static void cn_test_timer_func(unsigned long __data)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-27  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20  5:34 [PATCH -tip] Documentation/connector/cn_test.c remove unused cn_test_want_notify() Jaswinder Singh Rajput
2009-05-20  7:22 ` Evgeniy Polyakov
2009-05-20  7:42   ` Jaswinder Singh Rajput
2009-05-20  9:27     ` Evgeniy Polyakov
2009-05-27  8:37     ` Jaswinder Singh Rajput

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).