Re: [PATCH 1/1] Drivers: net-next: hyperv: Increase the size of the sendbuf region

2014-08-02 Thread David Miller

Don't explain things to me in this thread.

Instead, tell the whole world and everyone who would ever see this
commit, in the commit log message.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


劳动法与员工关系管理实战

2014-08-02 Thread 徐镇钢
51h

新《劳动合同法》、《社会保险法》、《工伤保险条例》实操应对策略

ARVFKVTE

防范用工风险和化解劳动争议的技能.txt
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8723au: Fix static symbol sparse warning

2014-08-02 Thread Jes Sorensen
Larry Finger larry.fin...@lwfinger.net writes:
 On 08/01/2014 08:06 AM, Miguel Oliveira wrote:
 Fix sparse warning:
 drivers/staging/rtl8723au/core/rtw_efuse.c:579:5: warning: symbol
 efuse_GetCurrentSize23a' was not declared. Should it be static?
 
 Signed-off-by: Miguel Oliveira cmro...@gmail.com
 ---
  drivers/staging/rtl8723au/include/rtw_efuse.h |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/staging/rtl8723au/include/rtw_efuse.h
 b/drivers/staging/rtl8723au/include/rtw_efuse.h
 index 07bdc34..304cc71 100644
 --- a/drivers/staging/rtl8723au/include/rtw_efuse.h
 +++ b/drivers/staging/rtl8723au/include/rtw_efuse.h
 @@ -82,6 +82,7 @@ struct pg_pkt_struct {
  /*Export global
 variable*/
  
  u16 efuse_GetMaxSize23a(struct rtw_adapter *padapter);
 +int efuse_GetCurrentSize23a(struct rtw_adapter *padapter, u16 *size);
  int rtw_efuse_access23a(struct rtw_adapter *padapter, u8 bRead, u16
 start_addr, u16 cnts, u8 *data);
  int rtw_efuse_map_read23a(struct rtw_adapter *padapter, u16 addr,
 u16 cnts, u8 *data);
  u8 rtw_efuse_map_write(struct rtw_adapter *padapter, u16 addr, u16
 cnts, u8 *data);

 NACK. Whenever Sparse issues this warning, you should first check to see if it
 can be made static. Adding it to a header to make the Sparse warning go away 
 is
 not correct unless some other routine needs it to be globally known. In this
 case, no other routine needs it.

 Of course, making it static will lead to the compilation warning that the
 routine is not used. The correct patch is to delete the entire routine as it 
 is
 never called.

Yep, fix it correctly, or don't bother!

Cheers,
Jes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: remove some unused code

2014-08-02 Thread Seunghun Lee
Remove some unused code.

CC: Lidza Louina lidza.lou...@gmail.com
CC: Mark Hounschell ma...@compro.net
Signed-off-by: Seunghun Lee way...@gmail.com
---
 drivers/staging/dgnc/dgnc_cls.c|   72 +-
 drivers/staging/dgnc/dgnc_driver.c |   39 +-
 drivers/staging/dgnc/dgnc_driver.h |   70 +-
 drivers/staging/dgnc/dgnc_mgmt.c   |   23 ---
 drivers/staging/dgnc/dgnc_neo.c|  117 ++--
 drivers/staging/dgnc/dgnc_tty.c|  271 
 6 files changed, 48 insertions(+), 544 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index cfa8384..85dcfb9 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -99,8 +99,6 @@ static inline void cls_set_cts_flow_control(struct channel_t 
*ch)
uchar ier = readb(ch-ch_cls_uart-ier);
uchar isr_fcr = 0;
 
-   DPR_PARAM((Setting CTSFLOW\n));
-
/*
 * The Enhanced Register Set may only be accessed when
 * the Line Control Register is set to 0xBFh.
@@ -144,8 +142,6 @@ static inline void cls_set_ixon_flow_control(struct 
channel_t *ch)
uchar ier = readb(ch-ch_cls_uart-ier);
uchar isr_fcr = 0;
 
-   DPR_PARAM((Setting IXON FLOW\n));
-
/*
 * The Enhanced Register Set may only be accessed when
 * the Line Control Register is set to 0xBFh.
@@ -193,8 +189,6 @@ static inline void cls_set_no_output_flow_control(struct 
channel_t *ch)
uchar ier = readb(ch-ch_cls_uart-ier);
uchar isr_fcr = 0;
 
-   DPR_PARAM((Unsetting Output FLOW\n));
-
/*
 * The Enhanced Register Set may only be accessed when
 * the Line Control Register is set to 0xBFh.
@@ -240,8 +234,6 @@ static inline void cls_set_rts_flow_control(struct 
channel_t *ch)
uchar ier = readb(ch-ch_cls_uart-ier);
uchar isr_fcr = 0;
 
-   DPR_PARAM((Setting RTSFLOW\n));
-
/*
 * The Enhanced Register Set may only be accessed when
 * the Line Control Register is set to 0xBFh.
@@ -283,8 +275,6 @@ static inline void cls_set_ixoff_flow_control(struct 
channel_t *ch)
uchar ier = readb(ch-ch_cls_uart-ier);
uchar isr_fcr = 0;
 
-   DPR_PARAM((Setting IXOFF FLOW\n));
-
/*
 * The Enhanced Register Set may only be accessed when
 * the Line Control Register is set to 0xBFh.
@@ -328,8 +318,6 @@ static inline void cls_set_no_input_flow_control(struct 
channel_t *ch)
uchar ier = readb(ch-ch_cls_uart-ier);
uchar isr_fcr = 0;
 
-   DPR_PARAM((Unsetting Input FLOW\n));
-
/*
 * The Enhanced Register Set may only be accessed when
 * the Line Control Register is set to 0xBFh.
@@ -393,8 +381,6 @@ static inline void cls_clear_break(struct channel_t *ch, 
int force)
writeb((temp  ~UART_LCR_SBC), ch-ch_cls_uart-lcr);
ch-ch_flags = ~(CH_BREAK_SENDING);
ch-ch_stop_sending_break = 0;
-   DPR_IOCTL((Finishing UART_LCR_SBC! finished: %lx\n,
-   jiffies));
}
}
DGNC_UNLOCK(ch-ch_lock, lock_flags);
@@ -429,8 +415,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, 
uint port)
if (isr  UART_IIR_NO_INT)
break;
 
-   DPR_INTR((%s:%d port: %x isr: %x\n, __FILE__, __LINE__,
-port, isr));
 
/* Receive Interrupt pending */
if (isr  (UART_IIR_RDI | UART_IIR_RDI_TIMEOUT)) {
@@ -463,7 +447,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, 
uint port)
}
 
/* Parse any modem signal changes */
-   DPR_INTR((MOD_STAT: sending to parse_modem_sigs\n));
cls_parse_modem(ch, readb(ch-ch_cls_uart-msr));
}
 }
@@ -500,10 +483,6 @@ static void cls_param(struct tty_struct *tty)
if (!bd || bd-magic != DGNC_BOARD_MAGIC)
return;
 
-   DPR_PARAM((param start: tdev: %x cflags: %x oflags: %x iflags: %x\n,
-   ch-ch_tun.un_dev, ch-ch_c_cflag, ch-ch_c_oflag,
-ch-ch_c_iflag));
-
/*
 * If baud rate is zero, flush queues, and set mval to drop DTR.
 */
@@ -587,8 +566,6 @@ static void cls_param(struct tty_struct *tty)
(jindex  16)) {
baud = bauds[iindex][jindex];
} else {
-   DPR_IOCTL((baud indices were out of range (%d)(%d),
-   iindex, jindex));
baud = 0;
}
 
@@ -737,10 +714,8 @@ static void cls_tasklet(unsigned long data)
int state = 0;
int ports = 0;
 
-   if (!bd || 

RE: [PATCH 1/1] Drivers: net-next: hyperv: Increase the size of the sendbuf region

2014-08-02 Thread KY Srinivasan


 -Original Message-
 From: David Miller [mailto:da...@davemloft.net]
 Sent: Friday, August 1, 2014 11:14 PM
 To: KY Srinivasan
 Cc: net...@vger.kernel.org; linux-ker...@vger.kernel.org;
 de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
 jasow...@redhat.com
 Subject: Re: [PATCH 1/1] Drivers: net-next: hyperv: Increase the size of the
 sendbuf region
 
 
 Don't explain things to me in this thread.
 
 Instead, tell the whole world and everyone who would ever see this commit,
 in the commit log message.
Will do. Before I re-sent the patch with the explanation, I wanted to make sure 
I fully
understood your concerns.

Regards,

K. Y
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1 V2] Drivers: net-next: hyperv: Increase the size of the sendbuf region

2014-08-02 Thread K. Y. Srinivasan
Intel did some benchmarking on our network throughput when Linux on Hyper-V
is as used as a gateway. This fix gave us almost a 1 Gbps additional throughput
on about 5Gbps base throughput we hadi, prior to increasing the sendbuf size.
The sendbuf mechanism is a copy based transport that we have which is clearly
more optimal than the copy-free page flipping mechanism (for small packets).
In the forwarding scenario, we deal only with MTU sized packets,
and increasing the size of the senbuf area gave us the additional performance.
For what it is worth, Windows guests on Hyper-V, I am told use similar sendbuf
size as well.

The exact value of sendbuf I think is less important than the fact that it needs
to be larger than what Linux can allocate as physically contiguous memory.
Thus the change over to allocating via vmalloc().

We currently allocate 16MB receive buffer and we use vmalloc there for 
allocation.
Also the low level channel code has already been modified to deal with 
physically
dis-contiguous memory in the ringbuffer setup.

Based on experimentation Intel did, they say there was some improvement in 
throughput
as the sendbuf size was increased up to 16MB and there was no effect on 
throughput
beyond 16MB. Thus I have chosen 16MB here.

Increasing the sendbuf value makes a material difference in small packet 
handling

In this version of the patch, based on David's feedback, I have added
additional details in the commit log.


Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/net/hyperv/hyperv_net.h |2 +-
 drivers/net/hyperv/netvsc.c |7 ++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index 6cc37c1..40ba1ef 100644
--- a/drivers/net/hyperv/hyperv_net.h
+++ b/drivers/net/hyperv/hyperv_net.h
@@ -584,7 +584,7 @@ struct nvsp_message {
 
 #define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024*16)  /* 16MB */
 #define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY  (1024*1024*15)  /* 15MB */
-#define NETVSC_SEND_BUFFER_SIZE(1024 * 1024)   /* 1MB 
*/
+#define NETVSC_SEND_BUFFER_SIZE(1024 * 1024 * 16)   /* 
16MB */
 #define NETVSC_INVALID_INDEX   -1
 
 
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index c041f63..c76178e 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -193,8 +193,7 @@ static int netvsc_destroy_buf(struct netvsc_device 
*net_device)
}
if (net_device-send_buf) {
/* Free up the receive buffer */
-   free_pages((unsigned long)net_device-send_buf,
-  get_order(net_device-send_buf_size));
+   vfree(net_device-send_buf);
net_device-send_buf = NULL;
}
kfree(net_device-send_section_map);
@@ -303,9 +302,7 @@ static int netvsc_init_buf(struct hv_device *device)
 
/* Now setup the send buffer.
 */
-   net_device-send_buf =
-   (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
-get_order(net_device-send_buf_size));
+   net_device-send_buf = vzalloc(net_device-send_buf_size);
if (!net_device-send_buf) {
netdev_err(ndev, unable to allocate send 
   buffer of size %d\n, net_device-send_buf_size);
-- 
1.7.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/1] cris: fix %d confusingly prefixed with 0x in format string

2014-08-02 Thread Joe Perches
On Sat, 2014-08-02 at 15:20 -0700, Hans Wennborg wrote:
 Signed-off-by: Hans Wennborg h...@hanshq.net
 ---
  arch/cris/arch-v32/drivers/cryptocop.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/arch/cris/arch-v32/drivers/cryptocop.c 
 b/arch/cris/arch-v32/drivers/cryptocop.c
[]
 @@ -3155,7 +3155,7 @@ static void print_dma_descriptors(struct 
 cryptocop_int_operation *iop)
   printk(print_dma_descriptors start\n);
  
   printk(iop:\n);
 - printk(\tsid: 0x%lld\n, iop-sid);
 + printk(\tsid: 0x%llx\n, iop-sid);
  
   printk(\tcdesc_out: 0x%p\n, iop-cdesc_out);
   printk(\tcdesc_in: 0x%p\n, iop-cdesc_in);

Thanks.

This is a surprisingly common error:

$ /usr/bin/git grep -P 
'0x\%(?!ull\b|ul\b|u\b|lu\b|llu\b|llux\b|lux\b|lx\b|lluX\b|luX\b|lX\b)[ul]*[ud]'
arch/arm/mach-omap2/id.c:   pr_warn(%s: unknown idcode=0x%08x 
(hawkeye=0x%08x,rev=0x%d)\n,
arch/cris/arch-v32/drivers/cryptocop.c: printk(\tsid: 0x%lld\n, iop-sid);
drivers/atm/eni.c:  return sprintf(page,tx[%d]:
0x%ld-0x%ld 
drivers/atm/eni.c:  length += 
sprintf(page+length,0x%ld-0x%ld 
drivers/block/DAC960.c: DAC960_Error(IO port 0x%d busy for Controller 
at\n,
drivers/block/DAC960.c: DAC960_Error(IO port 0x%d busy for Controller 
at\n,
drivers/block/cciss.c:  dev_dbg(h-pdev-dev,Max outstanding commands = 
0x%d\n,
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:mfc_debug(2, stream 
buf addr: 0x%08lx, size: 0x%d\n,
drivers/mfd/htc-i2cpld.c:   snprintf(client-name, I2C_NAME_SIZE, 
Chip_0x%d, client-addr);
drivers/mfd/omap-usb-host.c: USB HOST Rev:0x%d not 
recognized, assuming %d ports\n,
drivers/misc/sgi-gru/grumain.c: gru_dbg(grudev, gid %d, gts %p, gms %p, ctxnum 
0x%d, asidmap 0x%lx\n,
drivers/net/ethernet/smsc/smc911x.c:DBG(SMC_DEBUG_MISC, dev, phy_id1=0x%x, 
phy_id2=0x%x phyaddr=0x%d\n,
drivers/net/wireless/ath/ath6kl/init.c:found 
reserved ram size ie 0x%d\n,
drivers/net/wireless/ath/ath6kl/main.c: ath6kl_err(failed to write 
0x%x during diagnose window to 0x%d\n,
drivers/net/wireless/iwlegacy/4965-mac.c:   IL_ERR(failed 
setting tx power (0x%d).\n, ret);
drivers/net/wireless/rtlwifi/pci.c:  more desc 
left, wake skb_queue@%d, ring-idx = %d, skb_queue_len = 0x%d\n,
drivers/net/wireless/rtlwifi/pci.c:  No more TX 
desc@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
drivers/net/wireless/rtlwifi/pci.c:  less desc left, stop 
skb_queue@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
drivers/net/wireless/rtlwifi/rtl8192de/phy.c:
MCSTxPowerLevelOriginalOffset[%d][%d] = 0x%ulx\n,
drivers/net/wireless/rtlwifi/rtl8192de/phy.c:   ver 1 set 
RF-A, 5G,0x28 = 0x%ulx !!\n, u4tmp);
drivers/net/wireless/rtlwifi/rtl8192de/phy.c:   ver 3 set 
RF-B, 2G, 0x28 = 0x%ulx !!\n, u4tmp);
drivers/net/wireless/rtlwifi/rtl8192de/phy.c:   ver 3 set 
RF-B, 2G, 0x28 = 0x%ulx !!\n,
drivers/parisc/dino.c:  printk(KERN_ERR DINO: Hey! Someone took my 
MMIO space (0x%ld)!\n,
drivers/scsi/hpsa.c:dev_info(dev,Max outstanding commands = 0x%d\n,
drivers/staging/nokia_h4p/nokia_core.c: dev_err(info-dev, Cannot get 
GPIO line 0x%d,
drivers/staging/rtl8192ee/pci.c: (more desc 
left, wake skb_queue@%d,ring-idx = %d, skb_queue_len = 0x%d\n,
drivers/staging/rtl8192ee/pci.c: (No more TX 
desc@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
drivers/staging/rtl8192ee/pci.c: (less desc left, stop 
skb_queue@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
drivers/staging/rtl8821ae/pci.c: 
skb_queue_len = 0x%d\n,
drivers/staging/rtl8821ae/pci.c:  idx = %d, 
skb_queue_len = 0x%d\n,
drivers/staging/rtl8821ae/pci.c:  idx = %d, 
skb_queue_len = 0x%d\n,
fs/cifs/cifs_debug.c:   \n\tPathComponentMax: 
%d Status: 0x%d,
fs/cifs/misc.c: cifs_dbg(FYI, notify err 0x%d\n,
fs/cifs/misc.c: cifs_dbg(FYI, oplock type 0x%d level 0x%d\n,
fs/cifs/smb2misc.c: cifs_dbg(FYI, lease key match, lease break 
0x%d\n,
fs/cifs/smb2misc.c: cifs_dbg(FYI, lease key match, lease break 
0x%d\n,
fs/cifs/smb2misc.c: cifs_dbg(FYI, oplock level 0x%d\n, rsp-OplockLevel);
sound/firewire/fireworks/fireworks_proc.c:  phys in 
grp[0x%d]: type 0x%d, count 0x%d\n,
sound/firewire/fireworks/fireworks_proc.c:  phys out 
grps[0x%d]: type 0x%d, count 0x%d\n,
sound/pci/riptide/riptide.c:snd_printdd(sent mixer %d: 0x%d 0x%d\n, num, 
rval, lval);
sound/pci/riptide/riptide.c:snd_printdd(got mixer %d: 0x%d 0x%d\n, num, 
*rval, *lval);



[PATCH 4/7] staging: unisys: remove GUEST_PHYSICAL_ADDRESS from commontypes.h

2014-08-02 Thread Benjamin Romer
The typedef for GUEST_PHYSICAL address is only used in two files, so remove it
from commontypes.h and add it to visorchipset/file.c and controlvmchannel.h.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h | 3 +++
 drivers/staging/unisys/include/commontypes.h   | 2 --
 drivers/staging/unisys/visorchipset/file.c | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index 153f57ce..7cdce23 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -20,6 +20,9 @@
 #include commontypes.h
 #include channel.h
 #include controlframework.h
+
+typedef u64 GUEST_PHYSICAL_ADDRESS;
+
 enum { INVALID_GUEST_FIRMWARE, SAMPLE_GUEST_FIRMWARE,
TIANO32_GUEST_FIRMWARE, TIANO64_GUEST_FIRMWARE
 };
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 2301984..fab0c58 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -25,8 +25,6 @@
 #include linux/io.h
 #include linux/uuid.h
 
-typedef u64 GUEST_PHYSICAL_ADDRESS;
-
 #define OFFSETOF offsetof
 
 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
diff --git a/drivers/staging/unisys/visorchipset/file.c 
b/drivers/staging/unisys/visorchipset/file.c
index bf2e546..2f26de2 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -28,6 +28,8 @@
 
 #define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c
 
+typedef u64 GUEST_PHYSICAL_ADDRESS;
+
 static struct cdev Cdev;
 static VISORCHANNEL **PControlVm_channel;
 static dev_t MajorDev = -1; /** indicates major num for device */
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 7/7] staging: unisys: remove commontypes.h

2014-08-02 Thread Benjamin Romer
Delete commontypes.h, and replace all of the places that #included it with
correct #includes for the types used in that file.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 .../unisys/common-spar/include/channels/channel.h  |  4 +--
 .../include/channels/controlframework.h|  2 +-
 .../include/channels/controlvmchannel.h|  1 -
 .../common-spar/include/channels/diagchannel.h |  2 +-
 .../common-spar/include/channels/iochannel.h   |  1 -
 .../common-spar/include/channels/vbuschannel.h |  1 -
 .../unisys/common-spar/include/vbusdeviceinfo.h|  2 +-
 drivers/staging/unisys/include/commontypes.h   | 29 --
 drivers/staging/unisys/uislib/uislib.c |  3 ++-
 drivers/staging/unisys/uislib/uisutils.c   |  3 ++-
 drivers/staging/unisys/virtpci/virtpci.c   |  4 ++-
 drivers/staging/unisys/visorchannel/visorchannel.h |  1 -
 12 files changed, 12 insertions(+), 41 deletions(-)
 delete mode 100644 drivers/staging/unisys/include/commontypes.h

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index d861a3f..2004cfe 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -16,6 +16,8 @@
 #ifndef __CHANNEL_H__
 #define __CHANNEL_H__
 
+#include linux/types.h
+#include linux/io.h
 #include linux/uuid.h
 
 /*
@@ -30,8 +32,6 @@
  */
 #define __SUPERVISOR_CHANNEL_H__
 
-#include commontypes.h
-
 #define SIGNATURE_16(A, B) ((A) | (B8))
 #define SIGNATURE_32(A, B, C, D) \
(SIGNATURE_16(A, B) | (SIGNATURE_16(C, D)  16))
diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlframework.h 
b/drivers/staging/unisys/common-spar/include/channels/controlframework.h
index b0a49e0..fd4726e 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlframework.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlframework.h
@@ -25,7 +25,7 @@
 #ifndef _CONTROL_FRAMEWORK_H_
 #define _CONTROL_FRAMEWORK_H_
 
-#include commontypes.h
+#include linux/types.h
 #include channel.h
 
 #define ULTRA_MEMORY_COUNT_Ki 1024
diff --git 
a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index 7cdce23..d08c198 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -17,7 +17,6 @@
 #define __CONTROLVMCHANNEL_H__
 
 #include linux/uuid.h
-#include commontypes.h
 #include channel.h
 #include controlframework.h
 
diff --git a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h 
b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
index c01649a..9912e51 100644
--- a/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/diagchannel.h
@@ -33,7 +33,7 @@
 #ifndef _DIAG_CHANNEL_H_
 #define _DIAG_CHANNEL_H_
 
-#include commontypes.h
+#include linux/uuid.h
 #include channel.h
 
 /* {EEA7A573-DB82-447c-8716-EFBEAAAE4858} */
diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index 1ab8028..ed66c27 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -31,7 +31,6 @@
 
 #include linux/uuid.h
 
-#include commontypes.h
 #include vmcallinterface.h
 
 #define _ULTRA_CONTROLVM_CHANNEL_INLINE_
diff --git a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h 
b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
index 8facb51..1231c45 100644
--- a/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/vbuschannel.h
@@ -24,7 +24,6 @@
  *  the client devices and client drivers for the server end to see.
  */
 #include linux/uuid.h
-#include commontypes.h
 #include vbusdeviceinfo.h
 #include channel.h
 
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 5e0d98c..54593c1 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -16,7 +16,7 @@
 #ifndef __VBUSDEVICEINFO_H__
 #define __VBUSDEVICEINFO_H__
 
-#include commontypes.h
+#include linux/types.h
 
 #pragma pack(push, 1)  /* both GCC and VC now allow this pragma */
 
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
deleted file mode 100644
index eafd83b..000
--- a/drivers/staging/unisys/include/commontypes.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2010 - 2013 UNISYS 

[PATCH 1/7] staging: unisys: remove MEMCPY functions from commontypes.h

2014-08-02 Thread Benjamin Romer
This patch removes MEMCPY, MEMCPY_FROMIO, and MEMCPY_TOIO from commontypes.h,
and switches all use of these macros to the appropriate built in definition.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/channels/channel.c   | 6 +++---
 drivers/staging/unisys/common-spar/include/channels/iochannel.h | 4 ++--
 drivers/staging/unisys/include/commontypes.h| 3 ---
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/channels/channel.c 
b/drivers/staging/unisys/channels/channel.c
index b9bf8e8..ade2fe0 100644
--- a/drivers/staging/unisys/channels/channel.c
+++ b/drivers/staging/unisys/channels/channel.c
@@ -73,7 +73,7 @@ visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, u32 
Queue, void *pSignal)
 */
psignal = (char __iomem *)pqhdr + readq(pqhdr-oSignalBase) +
(head * readl(pqhdr-SignalSize));
-   MEMCPY_TOIO(psignal, pSignal, readl(pqhdr-SignalSize));
+   memcpy_toio(psignal, pSignal, readl(pqhdr-SignalSize));
 
VolatileBarrier();
writel(head, pqhdr-Head);
@@ -126,7 +126,7 @@ visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, u32 
Queue, void *pSignal)
/* copy signal from tail location to the area pointed to by pSignal */
psource = (char __iomem *) pqhdr + readq(pqhdr-oSignalBase) +
(tail * readl(pqhdr-SignalSize));
-   MEMCPY_FROMIO(pSignal, psource, readl(pqhdr-SignalSize));
+   memcpy_fromio(pSignal, psource, readl(pqhdr-SignalSize));
 
VolatileBarrier();
writel(tail, pqhdr-Tail);
@@ -183,7 +183,7 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, u32 Queue, void 
*pSignal)
psource =
(char *) pqhdr + pqhdr-oSignalBase +
(tail * pqhdr-SignalSize);
-   MEMCPY((char *) pSignal + (pqhdr-SignalSize * signalCount),
+   memcpy((char *) pSignal + (pqhdr-SignalSize * signalCount),
   psource, pqhdr-SignalSize);
 
VolatileBarrier();
diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index 24e1185..8e81bc9 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -775,7 +775,7 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
if (clientStr) {\
chan-ChannelHeader.oClientString = \
OFFSETOF(type, clientString);   \
-   MEMCPY(chan-clientString, clientStr,   \
+   memcpy(chan-clientString, clientStr,   \
   MINNUM(clientStrLen, \
  (u32) (MAX_CLIENTSTRING_LEN - 1))); \
chan-clientString[MINNUM(clientStrLen, \
@@ -846,7 +846,7 @@ static inline int 
ULTRA_VNIC_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
x-ChannelHeader.Size = COVER(bytes, 4096);
x-ChannelHeader.Type = UltraVnicChannelProtocolGuid;
x-ChannelHeader.ZoneGuid = NULL_UUID_LE;
-   MEMCPY(x-vnic.macaddr, macaddr, MAX_MACADDR_LEN);
+   memcpy(x-vnic.macaddr, macaddr, MAX_MACADDR_LEN);
x-vnic.num_rcv_bufs = num_rcv_bufs;
x-vnic.mtu = mtu;
x-vnic.zoneGuid = zoneGuid;
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 4311e9f..53ac770 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -31,9 +31,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
 #define OFFSETOF offsetof
 
 #define MEMORYBARRIER mb()
-#define MEMCPY(dest, src, len) memcpy(dest, src, len)
-#define MEMCPY_TOIO(dest, src, len) memcpy_toio(dest, src, len)
-#define MEMCPY_FROMIO(dest, src, len) memcpy_fromio(dest, src, len)
 
 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
  lin, logCtx)  \
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/7] staging: unisys: remove INLINE define from commontypes

2014-08-02 Thread Benjamin Romer
There was a macro for INLINE. Delete it and fix the one occurrance of it to
just use 'inline' instead, though that function looks awfully big for an
inline...

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/common-spar/include/channels/iochannel.h | 2 +-
 drivers/staging/unisys/include/commontypes.h| 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index 8e81bc9..06f466a 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -882,7 +882,7 @@ static inline int 
ULTRA_VNIC_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
 /* returns next non-zero index on success or zero on failure (i.e. out of
  * room)
  */
-static INLINE  u16
+static inline  u16
 add_physinfo_entries(u32 inp_pfn,  /* input - specifies the pfn to be used
 * to add entries */
 u16 inp_off,   /* input - specifies the off to be used
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 34b31ad..2301984 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -27,7 +27,6 @@
 
 typedef u64 GUEST_PHYSICAL_ADDRESS;
 
-#define INLINE inline
 #define OFFSETOF offsetof
 
 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/7] staging: unisys: move remaining macros from commontypes.h to channel.h

2014-08-02 Thread Benjamin Romer
All of the remaining macros in commontypes.h - the CHANNEL_*_MISMATCH macros
and UltraLogEvent() - are used only in channel.h. Move the entire set of them
to their new home.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 .../unisys/common-spar/include/channels/channel.h  | 31 ++
 drivers/staging/unisys/include/commontypes.h   | 31 --
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index bc92333..d861a3f 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -50,6 +50,37 @@
 
 #define ULTRA_CHANNEL_PROTOCOL_SIGNATURE  SIGNATURE_32('E', 'C', 'N', 'L')
 
+#define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
+ lin, logCtx)  \
+   do {\
+   pr_err(Channel mismatch on channel=%s(%pUL) field=%s 
expected=%pUL actual=%pUL @%s:%d\n, \
+  chName, chType, field,  \
+  expected, actual, \
+  fil, lin);   \
+   } while (0)
+#define CHANNEL_U32_MISMATCH(chType, chName, field, expected, actual, fil, \
+lin, logCtx)   \
+   do {\
+   pr_err(Channel mismatch on channel=%s(%pUL) field=%s 
expected=0x%-8.8lx actual=0x%-8.8lx @%s:%d\n, \
+  chName, chType, field,  \
+  (unsigned long)expected, (unsigned long)actual,  \
+  fil, lin);   \
+   } while (0)
+
+#define CHANNEL_U64_MISMATCH(chType, chName, field, expected, actual, fil, \
+lin, logCtx)   \
+   do {\
+   pr_err(Channel mismatch on channel=%s(%pUL) field=%s 
expected=0x%-8.8Lx actual=0x%-8.8Lx @%s:%d\n, \
+  chName, chType, field,  \
+  (unsigned long long)expected,\
+  (unsigned long long)actual,  \
+  fil, lin);   \
+   } while (0)
+
+#define UltraLogEvent(logCtx, EventId, Severity, SubsystemMask, pFunctionName, 
\
+ LineNumber, Str, args...) \
+   pr_info(Str, ## args)
+
 typedef enum {
CHANNELSRV_UNINITIALIZED = 0,   /* channel is in an undefined state */
CHANNELSRV_READY = 1/* channel has been initialized by server */
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 0ed7f50..eafd83b 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -25,36 +25,5 @@
 #include linux/io.h
 #include linux/uuid.h
 
-#define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
- lin, logCtx)  \
-   do {\
-   pr_err(Channel mismatch on channel=%s(%pUL) field=%s 
expected=%pUL actual=%pUL @%s:%d\n, \
-  chName, chType, field,  \
-  expected, actual, \
-  fil, lin);   \
-   } while (0)
-#define CHANNEL_U32_MISMATCH(chType, chName, field, expected, actual, fil, \
-lin, logCtx)   \
-   do {\
-   pr_err(Channel mismatch on channel=%s(%pUL) field=%s 
expected=0x%-8.8lx actual=0x%-8.8lx @%s:%d\n, \
-  chName, chType, field,  \
-  (unsigned long)expected, (unsigned long)actual,  \
-  fil, lin);   \
-   } while (0)
-
-#define CHANNEL_U64_MISMATCH(chType, chName, field, expected, actual, fil, \
-lin, logCtx)   \
-   do {\
-   pr_err(Channel mismatch on channel=%s(%pUL) field=%s 
expected=0x%-8.8Lx actual=0x%-8.8Lx @%s:%d\n, \
-  chName, chType, field,  \
-  (unsigned long long)expected,\
-  (unsigned long long)actual,  \
-  fil, lin);   \
-   } while (0)
-
-#define UltraLogEvent(logCtx, EventId, 

[PATCH 2/7] staging: unisys: remove MEMORYBARRIER AND VolatileBarrier from commontypes

2014-08-02 Thread Benjamin Romer
Remove the MEMORYBARRIER and VolatileBarrier() defines from commontypes.h and
convert the spots that used this to mb(). Add comments to each use to indicate
that the barrier is used to ensure channel synchronization between guests.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/channels/channel.c | 6 +++---
 drivers/staging/unisys/common-spar/include/channels/channel.h | 8 
 drivers/staging/unisys/include/commontypes.h  | 4 
 drivers/staging/unisys/visorchannel/visorchannel_funcs.c  | 4 ++--
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/unisys/channels/channel.c 
b/drivers/staging/unisys/channels/channel.c
index ade2fe0..b4bdee4 100644
--- a/drivers/staging/unisys/channels/channel.c
+++ b/drivers/staging/unisys/channels/channel.c
@@ -75,7 +75,7 @@ visor_signal_insert(CHANNEL_HEADER __iomem *pChannel, u32 
Queue, void *pSignal)
(head * readl(pqhdr-SignalSize));
memcpy_toio(psignal, pSignal, readl(pqhdr-SignalSize));
 
-   VolatileBarrier();
+   mb(); /* channel synch */
writel(head, pqhdr-Head);
 
writeq(readq(pqhdr-NumSignalsSent) + 1, pqhdr-NumSignalsSent);
@@ -128,7 +128,7 @@ visor_signal_remove(CHANNEL_HEADER __iomem *pChannel, u32 
Queue, void *pSignal)
(tail * readl(pqhdr-SignalSize));
memcpy_fromio(pSignal, psource, readl(pqhdr-SignalSize));
 
-   VolatileBarrier();
+   mb(); /* channel synch */
writel(tail, pqhdr-Tail);
 
writeq(readq(pqhdr-NumSignalsReceived) + 1,
@@ -186,7 +186,7 @@ SignalRemoveAll(pCHANNEL_HEADER pChannel, u32 Queue, void 
*pSignal)
memcpy((char *) pSignal + (pqhdr-SignalSize * signalCount),
   psource, pqhdr-SignalSize);
 
-   VolatileBarrier();
+   mb(); /* channel synch */
pqhdr-Tail = tail;
 
signalCount++;
diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 15a8d6b..bc92333 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -157,7 +157,7 @@ ULTRA_CHANNELCLI_STRING(u32 v)
  PathName_Last_N_Nodes(__FILE__, 4), __LINE__); \
writel(newstate, ((CHANNEL_HEADER __iomem *) \
   (pChan))-CliStateOS);   \
-   MEMORYBARRIER;  \
+   mb(); /* required for channel synch */  \
} while (0)
 
 #define ULTRA_CHANNEL_CLIENT_ACQUIRE_OS(pChan, chanId, logCtx) \
@@ -458,7 +458,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 
*chanId,
  CHANNELCLI_OWNED,
  PathName_Last_N_Nodes((u8 *) file, 4), line);
writel(CHANNELCLI_OWNED, pChan-CliStateOS);
-   MEMORYBARRIER;
+   mb(); /* required for channel synch */
}
if (readl(pChan-CliStateOS) == CHANNELCLI_OWNED) {
if (readb(pChan-CliErrorOS) != 0) {
@@ -502,7 +502,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 
*chanId,
return 0;
}
writel(CHANNELCLI_BUSY, pChan-CliStateOS);
-   MEMORYBARRIER;
+   mb(); /* required for channel synch */
if (readl(pChan-CliStateBoot) == CHANNELCLI_BUSY) {
if ((readb(pChan-CliErrorOS)
  ULTRA_CLIERROROS_THROTTLEMSG_BUSY) == 0) {
@@ -521,7 +521,7 @@ ULTRA_channel_client_acquire_os(void __iomem *pChannel, u8 
*chanId,
}
/* reset busy */
writel(CHANNELCLI_ATTACHED, pChan-CliStateOS);
-   MEMORYBARRIER;
+   mb(); /* required for channel synch */
return 0;
}
if (readb(pChan-CliErrorOS) != 0) {
diff --git a/drivers/staging/unisys/include/commontypes.h 
b/drivers/staging/unisys/include/commontypes.h
index 53ac770..34b31ad 100644
--- a/drivers/staging/unisys/include/commontypes.h
+++ b/drivers/staging/unisys/include/commontypes.h
@@ -30,8 +30,6 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
 #define INLINE inline
 #define OFFSETOF offsetof
 
-#define MEMORYBARRIER mb()
-
 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
  lin, logCtx)  \
do {\
@@ -63,7 +61,5 @@ typedef u64 GUEST_PHYSICAL_ADDRESS;
  LineNumber, Str, args...) \
pr_info(Str, ## args)
 
-#define VolatileBarrier() MEMORYBARRIER
-
 #endif
 
diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c 
b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c

[PATCH 5/7] staging: unisys: remove OFFSETOF from commontypes

2014-08-02 Thread Benjamin Romer
The only place OFFSETOF was being used was in iochannel.h. Remove the macro
from commontypes.h and replace all uses of it in iochannel.h with offsetof()
instead.

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 .../common-spar/include/channels/iochannel.h   | 36 +++---
 drivers/staging/unisys/include/commontypes.h   |  2 --
 2 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h 
b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index 06f466a..1ab8028 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -711,24 +711,24 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
 /* / END PRAGMA PACK PUSH 1 /// */
 
 /* define offsets to members of struct uiscmdrsp */
-#define OFFSET_CMDTYPE OFFSETOF(struct uiscmdrsp, cmdtype)
-#define OFFSET_SCSI OFFSETOF(struct uiscmdrsp, scsi)
-#define OFFSET_NET OFFSETOF(struct uiscmdrsp, net)
-#define OFFSET_SCSITASKMGMT OFFSETOF(struct uiscmdrsp, scsitaskmgmt)
-#define OFFSET_NEXT OFFSETOF(struct uiscmdrsp, next)
+#define OFFSET_CMDTYPE offsetof(struct uiscmdrsp, cmdtype)
+#define OFFSET_SCSI offsetof(struct uiscmdrsp, scsi)
+#define OFFSET_NET offsetof(struct uiscmdrsp, net)
+#define OFFSET_SCSITASKMGMT offsetof(struct uiscmdrsp, scsitaskmgmt)
+#define OFFSET_NEXT offsetof(struct uiscmdrsp, next)
 
 /* define offsets to members of struct uiscmdrsp_net */
-#define OFFSET_TYPE OFFSETOF(struct uiscmdrsp_net, type)
-#define OFFSET_BUF OFFSETOF(struct uiscmdrsp_net, buf)
-#define OFFSET_XMT OFFSETOF(struct uiscmdrsp_net, xmt)
-#define OFFSET_XMT_DONE_RESULT OFFSETOF(struct uiscmdrsp_net, xmtdone)
-#define OFFSET_RCVPOST OFFSETOF(struct uiscmdrsp_net, rcvpost)
-#define OFFSET_RCV_DONE_LEN OFFSETOF(struct uiscmdrsp_net, rcv)
-#define OFFSET_ENBDIS OFFSETOF(struct uiscmdrsp_net, enbdis)
+#define OFFSET_TYPE offsetof(struct uiscmdrsp_net, type)
+#define OFFSET_BUF offsetof(struct uiscmdrsp_net, buf)
+#define OFFSET_XMT offsetof(struct uiscmdrsp_net, xmt)
+#define OFFSET_XMT_DONE_RESULT offsetof(struct uiscmdrsp_net, xmtdone)
+#define OFFSET_RCVPOST offsetof(struct uiscmdrsp_net, rcvpost)
+#define OFFSET_RCV_DONE_LEN offsetof(struct uiscmdrsp_net, rcv)
+#define OFFSET_ENBDIS offsetof(struct uiscmdrsp_net, enbdis)
 
 /* define offsets to members of struct net_pkt_rcvpost */
-#define OFFSET_TOTALLEN OFFSETOF(struct net_pkt_rcvpost, totallen)
-#defineOFFSET_FRAG OFFSETOF(struct net_pkt_rcvpost, frag)
+#define OFFSET_TOTALLEN offsetof(struct net_pkt_rcvpost, totallen)
+#defineOFFSET_FRAG offsetof(struct net_pkt_rcvpost, frag)
 
 /*
 * INLINE functions for initializing and accessing I/O data channels
@@ -753,7 +753,7 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
do {\
x-cmdQ.Size = QSIZEFROMBYTES(x-ChannelHeader.Size);   \
x-cmdQ.oSignalBase = SIZEOF_PROTOCOL - \
-   OFFSETOF(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ);  \
+   offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ);  \
x-cmdQ.SignalSize = SIZEOF_CMDRSP; \
x-cmdQ.MaxSignalSlots =\
QSLOTSFROMBYTES(x-ChannelHeader.Size); \
@@ -761,20 +761,20 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
x-rspQ.Size = QSIZEFROMBYTES(x-ChannelHeader.Size);   \
x-rspQ.oSignalBase =   \
(SIZEOF_PROTOCOL + x-cmdQ.Size) -  \
-   OFFSETOF(ULTRA_IO_CHANNEL_PROTOCOL, rspQ);  \
+   offsetof(ULTRA_IO_CHANNEL_PROTOCOL, rspQ);  \
x-rspQ.SignalSize = SIZEOF_CMDRSP; \
x-rspQ.MaxSignalSlots =\
QSLOTSFROMBYTES(x-ChannelHeader.Size); \
x-rspQ.MaxSignals = x-rspQ.MaxSignalSlots - 1;\
x-ChannelHeader.oChannelSpace =\
-   OFFSETOF(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ);  \
+   offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ);  \
} while (0)
 
 #define INIT_CLIENTSTRING(chan, type, clientStr, clientStrLen) \
do {\
if (clientStr) {\
chan-ChannelHeader.oClientString = \
-   OFFSETOF(type, clientString);   \
+   offsetof(type, clientString);   \
memcpy(chan-clientString, clientStr,   \
   

Re: [PATCH 1/1] cris: fix %d confusingly prefixed with 0x in format string

2014-08-02 Thread Steve French
Thanks for pointing this out.  I fixed the instances of this that you
spotted in the cifs.ko driver (pushed to cifs-2.6.git for-next) and
noted that you pointed it out in the commit message.

http://git.samba.org/?p=sfrench/cifs-2.6.git;a=commit;h=59b04c5df75bd715002bb535930ae1982a739269



On Sat, Aug 2, 2014 at 7:46 PM, Joe Perches j...@perches.com wrote:
 On Sat, 2014-08-02 at 15:20 -0700, Hans Wennborg wrote:
 Signed-off-by: Hans Wennborg h...@hanshq.net
 ---
  arch/cris/arch-v32/drivers/cryptocop.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/arch/cris/arch-v32/drivers/cryptocop.c 
 b/arch/cris/arch-v32/drivers/cryptocop.c
 []
 @@ -3155,7 +3155,7 @@ static void print_dma_descriptors(struct 
 cryptocop_int_operation *iop)
   printk(print_dma_descriptors start\n);

   printk(iop:\n);
 - printk(\tsid: 0x%lld\n, iop-sid);
 + printk(\tsid: 0x%llx\n, iop-sid);

   printk(\tcdesc_out: 0x%p\n, iop-cdesc_out);
   printk(\tcdesc_in: 0x%p\n, iop-cdesc_in);

 Thanks.

 This is a surprisingly common error:

 $ /usr/bin/git grep -P 
 '0x\%(?!ull\b|ul\b|u\b|lu\b|llu\b|llux\b|lux\b|lx\b|lluX\b|luX\b|lX\b)[ul]*[ud]'
 arch/arm/mach-omap2/id.c:   pr_warn(%s: unknown idcode=0x%08x 
 (hawkeye=0x%08x,rev=0x%d)\n,
 arch/cris/arch-v32/drivers/cryptocop.c: printk(\tsid: 0x%lld\n, iop-sid);
 drivers/atm/eni.c:  return sprintf(page,tx[%d]:
 0x%ld-0x%ld 
 drivers/atm/eni.c:  length += 
 sprintf(page+length,0x%ld-0x%ld 
 drivers/block/DAC960.c: DAC960_Error(IO port 0x%d busy for 
 Controller at\n,
 drivers/block/DAC960.c: DAC960_Error(IO port 0x%d busy for 
 Controller at\n,
 drivers/block/cciss.c:  dev_dbg(h-pdev-dev,Max outstanding commands = 
 0x%d\n,
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:mfc_debug(2, stream 
 buf addr: 0x%08lx, size: 0x%d\n,
 drivers/mfd/htc-i2cpld.c:   snprintf(client-name, I2C_NAME_SIZE, 
 Chip_0x%d, client-addr);
 drivers/mfd/omap-usb-host.c: USB HOST Rev:0x%d not 
 recognized, assuming %d ports\n,
 drivers/misc/sgi-gru/grumain.c: gru_dbg(grudev, gid %d, gts %p, gms %p, 
 ctxnum 0x%d, asidmap 0x%lx\n,
 drivers/net/ethernet/smsc/smc911x.c:DBG(SMC_DEBUG_MISC, dev, 
 phy_id1=0x%x, phy_id2=0x%x phyaddr=0x%d\n,
 drivers/net/wireless/ath/ath6kl/init.c:found 
 reserved ram size ie 0x%d\n,
 drivers/net/wireless/ath/ath6kl/main.c: ath6kl_err(failed to write 
 0x%x during diagnose window to 0x%d\n,
 drivers/net/wireless/iwlegacy/4965-mac.c:   
 IL_ERR(failed setting tx power (0x%d).\n, ret);
 drivers/net/wireless/rtlwifi/pci.c:  more desc 
 left, wake skb_queue@%d, ring-idx = %d, skb_queue_len = 0x%d\n,
 drivers/net/wireless/rtlwifi/pci.c:  No more TX 
 desc@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
 drivers/net/wireless/rtlwifi/pci.c:  less desc left, 
 stop skb_queue@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c:
 MCSTxPowerLevelOriginalOffset[%d][%d] = 0x%ulx\n,
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c:   ver 1 set 
 RF-A, 5G,0x28 = 0x%ulx !!\n, u4tmp);
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c:   ver 3 set 
 RF-B, 2G, 0x28 = 0x%ulx !!\n, u4tmp);
 drivers/net/wireless/rtlwifi/rtl8192de/phy.c:   ver 3 set 
 RF-B, 2G, 0x28 = 0x%ulx !!\n,
 drivers/parisc/dino.c:  printk(KERN_ERR DINO: Hey! Someone took my 
 MMIO space (0x%ld)!\n,
 drivers/scsi/hpsa.c:dev_info(dev,Max outstanding commands = 0x%d\n,
 drivers/staging/nokia_h4p/nokia_core.c: dev_err(info-dev, Cannot 
 get GPIO line 0x%d,
 drivers/staging/rtl8192ee/pci.c: (more desc 
 left, wake skb_queue@%d,ring-idx = %d, skb_queue_len = 0x%d\n,
 drivers/staging/rtl8192ee/pci.c: (No more TX 
 desc@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
 drivers/staging/rtl8192ee/pci.c: (less desc left, 
 stop skb_queue@%d, ring-idx = %d, idx = %d, skb_queue_len = 0x%d\n,
 drivers/staging/rtl8821ae/pci.c: 
 skb_queue_len = 0x%d\n,
 drivers/staging/rtl8821ae/pci.c:  idx = %d, 
 skb_queue_len = 0x%d\n,
 drivers/staging/rtl8821ae/pci.c:  idx = %d, 
 skb_queue_len = 0x%d\n,
 fs/cifs/cifs_debug.c:   
 \n\tPathComponentMax: %d Status: 0x%d,
 fs/cifs/misc.c: cifs_dbg(FYI, notify err 0x%d\n,
 fs/cifs/misc.c: cifs_dbg(FYI, oplock type 0x%d level 0x%d\n,
 fs/cifs/smb2misc.c: cifs_dbg(FYI, lease key match, lease break 
 0x%d\n,
 fs/cifs/smb2misc.c: cifs_dbg(FYI, lease key match, lease break 
 0x%d\n,
 fs/cifs/smb2misc.c: cifs_dbg(FYI, oplock level 0x%d\n,