[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] linux-2.6.18: adjust module parameter types


  • To: "xen-devel" <xen-devel@xxxxxxxxxxxxx>
  • From: "Jan Beulich" <JBeulich@xxxxxxxx>
  • Date: Tue, 18 Dec 2012 10:16:59 +0000
  • Delivery-date: Tue, 18 Dec 2012 10:17:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

In particular use "unsigned" and "bool" where the parameter has
respective meaning, and make the respective variables static where
possible and not already done.

Also drop the use of the bogus USBIF_BACK_MAX_PENDING_REQS definition
and do some minimal cleanup.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/drivers/xen/blkback/blkback.c
+++ b/drivers/xen/blkback/blkback.c
@@ -55,15 +55,15 @@
  * This will increase the chances of being able to write whole tracks.
  * 64 should be enough to keep us competitive with Linux.
  */
-static int blkif_reqs = 64;
-module_param_named(reqs, blkif_reqs, int, 0);
+static unsigned int blkif_reqs = 64;
+module_param_named(reqs, blkif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate");
 
 /* Run-time switchable: /sys/module/blkback/parameters/ */
-static unsigned int log_stats = 0;
-static unsigned int debug_lvl = 0;
-module_param(log_stats, int, 0644);
-module_param(debug_lvl, int, 0644);
+static int log_stats;
+static unsigned int debug_lvl;
+module_param(log_stats, bool, 0644);
+module_param(debug_lvl, uint, 0644);
 
 /*
  * Each outstanding request that we've passed to the lower device layers has a 
--- a/drivers/xen/blktap/blktap.c
+++ b/drivers/xen/blktap/blktap.c
@@ -127,10 +127,10 @@ static struct tap_blkif *tapfds[MAX_TAP_
 static int blktap_next_minor;
 
 /* Run-time switchable: /sys/module/blktap/parameters/ */
-static unsigned int log_stats = 0;
-static unsigned int debug_lvl = 0;
-module_param(log_stats, int, 0644);
-module_param(debug_lvl, int, 0644);
+static int log_stats;
+static unsigned int debug_lvl;
+module_param(log_stats, bool, 0644);
+module_param(debug_lvl, uint, 0644);
 
 /*
  * Each outstanding request that we've passed to the lower device layers has a 
--- a/drivers/xen/fbfront/xenfb.c
+++ b/drivers/xen/fbfront/xenfb.c
@@ -138,8 +138,8 @@ struct xenfb_info
 #define XENFB_DEFAULT_FB_LEN (XENFB_WIDTH * XENFB_HEIGHT * XENFB_DEPTH / 8)
 
 enum {KPARAM_MEM, KPARAM_WIDTH, KPARAM_HEIGHT, KPARAM_CNT};
-static int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT};
-module_param_array(video, int, NULL, 0);
+static unsigned int video[KPARAM_CNT] = {2, XENFB_WIDTH, XENFB_HEIGHT};
+module_param_array(video, uint, NULL, 0);
 MODULE_PARM_DESC(video,
                "Size of video memory in MB and width,height in pixels, default 
= (2,800,600)");
 
--- a/drivers/xen/pciback/pciback_ops.c
+++ b/drivers/xen/pciback/pciback_ops.c
@@ -10,7 +10,7 @@
 #include "pciback.h"
 
 int verbose_request = 0;
-module_param(verbose_request, int, 0644);
+module_param(verbose_request, bool, 0644);
 
 /* Ensure a device is "turned off" and ready to be exported.
  * (Also see pciback_config_reset to ensure virtual configuration space is
--- a/drivers/xen/pcifront/pci_op.c
+++ b/drivers/xen/pcifront/pci_op.c
@@ -12,8 +12,8 @@
 #include <xen/evtchn.h>
 #include "pcifront.h"
 
-static int verbose_request = 0;
-module_param(verbose_request, int, 0644);
+static int verbose_request;
+module_param(verbose_request, bool, 0644);
 
 static void pcifront_init_sd(struct pcifront_sd *sd,
                             unsigned int domain, unsigned int bus,
--- a/drivers/xen/scsiback/scsiback.c
+++ b/drivers/xen/scsiback/scsiback.c
@@ -56,8 +56,8 @@ int vscsiif_reqs = VSCSIIF_BACK_MAX_PEND
 module_param_named(reqs, vscsiif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of scsiback requests to allocate");
 
-static unsigned int log_print_stat = 0;
-module_param(log_print_stat, int, 0644);
+static int log_print_stat;
+module_param(log_print_stat, bool, 0644);
 
 #define SCSIBACK_INVALID_HANDLE (~0)
 
@@ -219,10 +219,8 @@ static void scsiback_cmd_done(struct req
        resid        = req->data_len;
        errors       = req->errors;
 
-       if (errors != 0) {
-               if (log_print_stat)
-                       scsiback_print_status(sense_buffer, errors, 
pending_req);
-       }
+       if (errors && log_print_stat)
+               scsiback_print_status(sense_buffer, errors, pending_req);
 
        /* The Host mode is through as for Emulation. */
        if (pending_req->info->feature != VSCSI_TYPE_HOST)
--- a/drivers/xen/usbback/usbback.c
+++ b/drivers/xen/usbback/usbback.c
@@ -53,8 +53,8 @@
 #include "../../usb/core/hub.h"
 #endif
 
-int usbif_reqs = USBIF_BACK_MAX_PENDING_REQS;
-module_param_named(reqs, usbif_reqs, int, 0);
+static unsigned int usbif_reqs = 128;
+module_param_named(reqs, usbif_reqs, uint, 0);
 MODULE_PARM_DESC(reqs, "Number of usbback requests to allocate");
 
 struct pending_req_segment {


Attachment: xen-module-param-types.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.