mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	lustre-devel@lists.lustre.org,
	James Simmons <jsimmons@infradead.org>
Subject: [PATCH v2 06/13] staging: lustre: convert kernelcomm group to unsigned int
Date: Wed, 23 Dec 2015 16:24:45 -0500	[thread overview]
Message-ID: <1450905892-31089-7-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1450905892-31089-1-git-send-email-jsimmons@infradead.org>

The group variable was converted to an unsigned int in
libcfs_kkuc_group_add() to avoid a potential overflow.
The variable group is used in other kernelcomm functions
so it makes sense to convert the rest of the group
variables to unsigned int.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../lustre/lustre/include/lustre_kernelcomm.h      |    6 +++---
 .../staging/lustre/lustre/obdclass/kernelcomm.c    |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
index 2312efc..31c2d35 100644
--- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
@@ -45,11 +45,11 @@ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg);
 
 /* Kernel methods */
 int libcfs_kkuc_msg_put(struct file *fp, void *payload);
-int libcfs_kkuc_group_put(int group, void *payload);
+int libcfs_kkuc_group_put(unsigned int group, void *payload);
 int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group,
 			  void *data, size_t data_len);
-int libcfs_kkuc_group_rem(int uid, int group);
-int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
+int libcfs_kkuc_group_rem(int uid, unsigned int group);
+int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func,
 			      void *cb_arg);
 
 #endif /* __LUSTRE_KERNELCOMM_H__ */
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index e290246..1081253 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -145,7 +145,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group,
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_add);
 
-int libcfs_kkuc_group_rem(int uid, int group)
+int libcfs_kkuc_group_rem(int uid, unsigned int group)
 {
 	struct kkuc_reg *reg, *next;
 
@@ -180,7 +180,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_rem);
 
-int libcfs_kkuc_group_put(int group, void *payload)
+int libcfs_kkuc_group_put(unsigned int group, void *payload)
 {
 	struct kkuc_reg	*reg;
 	int		 rc = 0;
@@ -215,7 +215,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_put);
  * @param cb_func the function to be called.
  * @param cb_arg extra argument to be passed to the callback function.
  */
-int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
+int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func,
 			      void *cb_arg)
 {
 	struct kkuc_reg *reg;
-- 
1.7.1


  parent reply	other threads:[~2015-12-23 21:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 21:24 [PATCH v2 00/13] staging:lustre: split kernel comm between user and kernel James Simmons
2015-12-23 21:24 ` [PATCH v2 01/13] staging: lustre: kg_sem semaphore handling is incorrectly James Simmons
2015-12-23 21:24 ` [PATCH v2 02/13] staging: lustre: Prevent duplicate CT registrations James Simmons
2015-12-23 21:24 ` [PATCH v2 03/13] staging: lustre: move kernel_user_comm.c from libcfs to lustre James Simmons
2015-12-23 21:24 ` [PATCH v2 04/13] staging: lustre: split kernel comm between user and kernel James Simmons
2015-12-23 21:24 ` [PATCH v2 05/13] staging: lustre: embed kr_data into kkuc_reg James Simmons
2015-12-23 21:24 ` James Simmons [this message]
2015-12-23 21:24 ` [PATCH v2 07/13] staging: lustre: remove unnecessary NULL checks in kernel_comm.c James Simmons
2015-12-23 21:24 ` [PATCH v2 08/13] staging: lustre: cleanup block comment style in kernel_comm code James Simmons
2015-12-23 21:24 ` [PATCH 09/13] staging: lustre: add space around '+' " James Simmons
2015-12-23 21:24 ` [PATCH 10/13] staging: lustre: use proper braces in libcfs_kkuc_group_put James Simmons
2015-12-23 21:24 ` [PATCH 11/13] staging: lustre: return proper error code for libcfs_kkuc_msg_put James Simmons
2015-12-23 21:24 ` [PATCH 12/13] staging: lustre: fix all conditional comparison to zero for kernelcomm.c James Simmons
2015-12-23 21:24 ` [PATCH 13/13] staging: lustre: cleanup white space in kernel comm code James Simmons
2016-02-03 22:19 ` [PATCH v2 00/13] staging:lustre: split kernel comm between user and kernel Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450905892-31089-7-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®