diff for duplicates of <20080326220544.GE31138@sgi.com> diff --git a/a/1.txt b/N1/1.txt index 1b18648..1866da0 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -20,7 +20,8 @@ I've sent mail to the maintainers of checkpatch.pl. 8 files changed, 322 insertions(+), 461 deletions(-) Index: linux-2.6/drivers/misc/xp/xpnet.c -=================================--- linux-2.6.orig/drivers/misc/xp/xpnet.c 2008-03-26 14:40:29.337394170 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xpnet.c 2008-03-26 14:40:29.337394170 -0500 +++ linux-2.6/drivers/misc/xp/xpnet.c 2008-03-26 15:58:25.102979549 -0500 @@ -31,7 +31,6 @@ #include <linux/mii.h> @@ -56,8 +57,8 @@ Index: linux-2.6/drivers/misc/xp/xpnet.c */ xpnet_device = alloc_netdev(sizeof(struct xpnet_dev_private), XPNET_DEVICE_NAME, ether_setup); -- if (xpnet_device = NULL) { -+ if (xpnet_device = NULL) +- if (xpnet_device == NULL) { ++ if (xpnet_device == NULL) return -ENOMEM; - } @@ -84,19 +85,20 @@ Index: linux-2.6/drivers/misc/xp/xpnet.c return result; } Index: linux-2.6/drivers/misc/xp/xpc_partition.c -=================================--- linux-2.6.orig/drivers/misc/xp/xpc_partition.c 2008-03-26 14:40:29.317391686 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xpc_partition.c 2008-03-26 14:40:29.317391686 -0500 +++ linux-2.6/drivers/misc/xp/xpc_partition.c 2008-03-26 14:40:37.210371731 -0500 @@ -64,19 +64,19 @@ xpc_kmalloc_cacheline_aligned(size_t siz { /* see if kmalloc will give us cachline aligned memory by default */ *base = kmalloc(size, flags); -- if (*base = NULL) { -+ if (*base = NULL) +- if (*base == NULL) { ++ if (*base == NULL) return NULL; - } -- if ((u64)*base = L1_CACHE_ALIGN((u64)*base)) { +- if ((u64)*base == L1_CACHE_ALIGN((u64)*base)) { + -+ if ((u64)*base = L1_CACHE_ALIGN((u64)*base)) ++ if ((u64)*base == L1_CACHE_ALIGN((u64)*base)) return *base; - } + @@ -104,8 +106,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c /* nope, we'll have to do it ourselves */ *base = kmalloc(size + L1_CACHE_BYTES, flags); -- if (*base = NULL) { -+ if (*base = NULL) +- if (*base == NULL) { ++ if (*base == NULL) return NULL; - } + @@ -139,12 +141,12 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c * that saved copy on subsequent loads of XPC. This AMO page is never * freed, and its memory protections are never restricted. */ -- if ((amos_page = xpc_vars->amos_page) = NULL) { +- if ((amos_page = xpc_vars->amos_page) == NULL) { + amos_page = xpc_vars->amos_page; -+ if (amos_page = NULL) { ++ if (amos_page == NULL) { n_amos = xpc_number_of_amos(XP_NPARTITIONS); amos_page = xp_alloc_amos(n_amos); - if (amos_page = NULL) { + if (amos_page == NULL) { @@ -236,9 +236,8 @@ xpc_rsvd_page_init(void) /* initialize the activate IRQ related AMO variables */ @@ -165,8 +167,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c break; - } -- if (partid = xp_partition_id) { -+ if (partid = xp_partition_id) +- if (partid == xp_partition_id) { ++ if (partid == xp_partition_id) continue; - } @@ -176,8 +178,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c /* get the reserved page's physical address */ *remote_rp_pa = xpc_get_rsvd_page_pa(nasid); -- if (*remote_rp_pa = 0) { -+ if (*remote_rp_pa = 0) +- if (*remote_rp_pa == 0) { ++ if (*remote_rp_pa == 0) return xpNoRsvdPageAddr; - } @@ -198,12 +200,13 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c - } } - if (XPC_VERSION_MAJOR(remote_rp->version) !@@ -373,16 +367,14 @@ xpc_get_remote_vars(u64 remote_vars_pa, + if (XPC_VERSION_MAJOR(remote_rp->version) != +@@ -373,16 +367,14 @@ xpc_get_remote_vars(u64 remote_vars_pa, { enum xp_retval ret; -- if (remote_vars_pa = 0) { -+ if (remote_vars_pa = 0) +- if (remote_vars_pa == 0) { ++ if (remote_vars_pa == 0) return xpVarsNotSet; - } @@ -215,7 +218,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c return ret; - } - if (XPC_VERSION_MAJOR(remote_vars->version) ! XPC_VERSION_MAJOR(XPC_V_VERSION)) { + if (XPC_VERSION_MAJOR(remote_vars->version) != + XPC_VERSION_MAJOR(XPC_V_VERSION)) { @@ -391,8 +383,9 @@ xpc_get_remote_vars(u64 remote_vars_pa, /* check that the partid is for another partition */ @@ -224,7 +228,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c + remote_vars->partid > XP_MAX_PARTID) { return xpInvalidPartid; + } - if (remote_vars->partid = xp_partition_id) + if (remote_vars->partid == xp_partition_id) return xpLocalPartid; @@ -494,9 +487,8 @@ xpc_identify_act_IRQ_req(int nasid) @@ -269,8 +273,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c remote_rp = xpc_kmalloc_cacheline_aligned(XPC_RP_HEADER_SIZE + xp_sizeof_nasid_mask, GFP_KERNEL, &remote_rp_base); -- if (remote_rp = NULL) { -+ if (remote_rp = NULL) +- if (remote_rp == NULL) { ++ if (remote_rp == NULL) return; - } + @@ -313,15 +317,16 @@ Index: linux-2.6/drivers/misc/xp/xpc_partition.c u64 part_nasid_pa; part = &xpc_partitions[partid]; -- if (part->remote_rp_pa = 0) { -+ if (part->remote_rp_pa = 0) +- if (part->remote_rp_pa == 0) { ++ if (part->remote_rp_pa == 0) return xpPartitionDown; - } memset(nasid_mask, 0, xp_sizeof_nasid_mask); Index: linux-2.6/drivers/misc/xp/xpc_channel.c -=================================--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c 2008-03-26 14:40:29.273386222 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c 2008-03-26 14:40:29.273386222 -0500 +++ linux-2.6/drivers/misc/xp/xpc_channel.c 2008-03-26 14:40:37.230374214 -0500 @@ -24,7 +24,7 @@ #include "xpc.h" @@ -336,13 +341,13 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c { /* see if kzalloc will give us cachline aligned memory by default */ *base = kzalloc(size, flags); -- if (*base = NULL) { -+ if (*base = NULL) +- if (*base == NULL) { ++ if (*base == NULL) return NULL; - } -- if ((u64)*base = L1_CACHE_ALIGN((u64)*base)) { +- if ((u64)*base == L1_CACHE_ALIGN((u64)*base)) { + -+ if ((u64)*base = L1_CACHE_ALIGN((u64)*base)) ++ if ((u64)*base == L1_CACHE_ALIGN((u64)*base)) return *base; - } + @@ -350,8 +355,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c /* nope, we'll have to do it ourselves */ *base = kzalloc(size + L1_CACHE_BYTES, flags); -- if (*base = NULL) { -+ if (*base = NULL) +- if (*base == NULL) { ++ if (*base == NULL) return NULL; - } + @@ -369,7 +374,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c @@ -127,11 +128,10 @@ xpc_setup_infrastructure(struct xpc_part GFP_KERNEL, &part->local_GPs_base); - if (part->local_GPs = NULL) { + if (part->local_GPs == NULL) { - kfree(part->channels); - part->channels = NULL; dev_err(xpc_chan, "can't get memory for local get/put " @@ -381,7 +386,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c part->remote_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE, @@ -141,11 +141,8 @@ xpc_setup_infrastructure(struct xpc_part - if (part->remote_GPs = NULL) { + if (part->remote_GPs == NULL) { dev_err(xpc_chan, "can't get memory for remote get/put " "values\n"); - kfree(part->local_GPs_base); @@ -396,7 +401,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c /* allocate all the required open and close args */ @@ -155,13 +152,8 @@ xpc_setup_infrastructure(struct xpc_part &part->local_openclose_args_base); - if (part->local_openclose_args = NULL) { + if (part->local_openclose_args == NULL) { dev_err(xpc_chan, "can't get memory for local connect args\n"); - kfree(part->remote_GPs_base); - part->remote_GPs = NULL; @@ -409,9 +414,10 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c + goto out_3; } - part->remote_openclose_args @@ -169,15 +161,8 @@ xpc_setup_infrastructure(struct xpc_part + part->remote_openclose_args = +@@ -169,15 +161,8 @@ xpc_setup_infrastructure(struct xpc_part &part->remote_openclose_args_base); - if (part->remote_openclose_args = NULL) { + if (part->remote_openclose_args == NULL) { dev_err(xpc_chan, "can't get memory for remote connect args\n"); - kfree(part->local_openclose_args_base); - part->local_openclose_args = NULL; @@ -477,8 +483,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c DBUG_ON((u64)dst != L1_CACHE_ALIGN((u64)dst)); DBUG_ON(cnt != L1_CACHE_ALIGN(cnt)); -- if (part->act_state = XPC_P_AS_DEACTIVATING) { -+ if (part->act_state = XPC_P_AS_DEACTIVATING) +- if (part->act_state == XPC_P_AS_DEACTIVATING) { ++ if (part->act_state == XPC_P_AS_DEACTIVATING) return part->reason; - } @@ -498,8 +504,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c xpc_vars_part[partid].magic = XPC_VP_MAGIC2; } -- if (pulled_entry->magic = XPC_VP_MAGIC1) { -+ if (pulled_entry->magic = XPC_VP_MAGIC1) +- if (pulled_entry->magic == XPC_VP_MAGIC1) { ++ if (pulled_entry->magic == XPC_VP_MAGIC1) return xpRetry; - } @@ -524,9 +530,9 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c GFP_KERNEL, - &ch-> - local_msgqueue_base); -- if (ch->local_msgqueue = NULL) { +- if (ch->local_msgqueue == NULL) { + &ch->local_msgqueue_base); -+ if (ch->local_msgqueue = NULL) ++ if (ch->local_msgqueue == NULL) continue; - } @@ -538,9 +544,9 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c GFP_KERNEL, - &ch-> - remote_msgqueue_base); -- if (ch->remote_msgqueue = NULL) { +- if (ch->remote_msgqueue == NULL) { + &ch->remote_msgqueue_base); -+ if (ch->remote_msgqueue = NULL) ++ if (ch->remote_msgqueue == NULL) continue; - } @@ -577,7 +583,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c - } DBUG_ON(!(ch->flags & XPC_C_SETUP)); - DBUG_ON(ch->local_msgqueue = NULL); + DBUG_ON(ch->local_msgqueue == NULL); @@ -590,9 +579,8 @@ xpc_process_connect(struct xpc_channel * xpc_IPI_send_openreply(ch, irq_flags); } @@ -587,7 +593,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c return; - } - DBUG_ON(ch->remote_msgqueue_pa = 0); + DBUG_ON(ch->remote_msgqueue_pa == 0); @@ -711,9 +699,8 @@ xpc_process_disconnect(struct xpc_channe @@ -602,7 +608,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c @@ -728,26 +715,23 @@ xpc_process_disconnect(struct xpc_channe - if (part->act_state = XPC_P_AS_DEACTIVATING) { + if (part->act_state == XPC_P_AS_DEACTIVATING) { /* can't proceed until the other side disengages from us */ - if (xpc_partition_engaged(ch->partid)) { + if (xpc_partition_engaged(ch->partid)) @@ -650,8 +656,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c - if (reason <= xpSuccess || reason > xpUnknownReason) { + if (reason <= xpSuccess || reason > xpUnknownReason) reason = xpUnknownReason; -- } else if (reason = xpUnregistering) { -+ else if (reason = xpUnregistering) +- } else if (reason == xpUnregistering) { ++ else if (reason == xpUnregistering) reason = xpOtherUnregistering; - } @@ -661,8 +667,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c unsigned long irq_flags; struct xpc_registration *registration = &xpc_registrations[ch->number]; -- if (mutex_trylock(®istration->mutex) = 0) { -+ if (mutex_trylock(®istration->mutex) = 0) +- if (mutex_trylock(®istration->mutex) == 0) { ++ if (mutex_trylock(®istration->mutex) == 0) return xpRetry; - } @@ -723,8 +729,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c continue; } -- if (part->act_state = XPC_P_AS_DEACTIVATING) { -+ if (part->act_state = XPC_P_AS_DEACTIVATING) +- if (part->act_state == XPC_P_AS_DEACTIVATING) { ++ if (part->act_state == XPC_P_AS_DEACTIVATING) continue; - } @@ -792,8 +798,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c * that will cause the IPI handler to fetch the latest * GP values as if an IPI was sent by the other side. */ -- if (ret = xpTimeout) { -+ if (ret = xpTimeout) +- if (ret == xpTimeout) { ++ if (ret == xpTimeout) xpc_IPI_send_local_msgrequest(ch); - } @@ -814,8 +820,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c while (1) { while (1) { -- if (put = (volatile s64)ch->w_local_GP.put) { -+ if (put = ch->w_local_GP.put) +- if (put == (volatile s64)ch->w_local_GP.put) { ++ if (put == ch->w_local_GP.put) break; - } @@ -831,7 +837,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c put++; } @@ -1810,7 +1782,7 @@ xpc_send_msgs(struct xpc_channel *ch, s6 - if (cmpxchg_rel(&ch->local_GP->put, initial_put, put) ! initial_put) { + if (cmpxchg_rel(&ch->local_GP->put, initial_put, put) != + initial_put) { /* someone else beat us to it */ - DBUG_ON((volatile s64)ch->local_GP->put < initial_put); + DBUG_ON(ch->local_GP->put < initial_put); @@ -853,8 +860,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c /* see if the message is next in line to be sent, if so send it */ put = ch->local_GP->put; -- if (put = msg_number) { -+ if (put = msg_number) +- if (put == msg_number) { ++ if (put == msg_number) xpc_send_msgs(ch, put); - } @@ -864,7 +871,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c msg_index = ch->next_msg_to_pull % ch->remote_nentries; -- DBUG_ON(ch->next_msg_to_pull >- (volatile s64)ch->w_remote_GP.put); +- DBUG_ON(ch->next_msg_to_pull >= +- (volatile s64)ch->w_remote_GP.put); - nmsgs = (volatile s64)ch->w_remote_GP.put - - ch->next_msg_to_pull; + DBUG_ON(ch->next_msg_to_pull >= ch->w_remote_GP.put); @@ -877,7 +885,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c msg_offset); - if ((ret = xpc_pull_remote_cachelines(part, msg, remote_msg, -- nmsgs * ch->msg_size)) !- xpSuccess) { +- nmsgs * ch->msg_size)) != +- xpSuccess) { - + ret = xpc_pull_remote_cachelines(part, msg, remote_msg, nmsgs * + ch->msg_size); @@ -904,10 +913,10 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c - } - get = (volatile s64)ch->w_local_GP.get; -- if (get = (volatile s64)ch->w_remote_GP.put) { +- if (get == (volatile s64)ch->w_remote_GP.put) { + get = ch->w_local_GP.get; + rmb(); /* guarantee that .get loads before .put */ -+ if (get = ch->w_remote_GP.put) ++ if (get == ch->w_remote_GP.put) break; - } @@ -927,8 +936,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c while (1) { while (1) { -- if (get = (volatile s64)ch->w_local_GP.get) { -+ if (get = ch->w_local_GP.get) +- if (get == (volatile s64)ch->w_local_GP.get) { ++ if (get == ch->w_local_GP.get) break; - } @@ -944,7 +953,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c msg_flags |= msg->flags; get++; @@ -2195,7 +2158,7 @@ xpc_acknowledge_msgs(struct xpc_channel - if (cmpxchg_rel(&ch->local_GP->get, initial_get, get) ! initial_get) { + if (cmpxchg_rel(&ch->local_GP->get, initial_get, get) != + initial_get) { /* someone else beat us to it */ - DBUG_ON((volatile s64)ch->local_GP->get <= initial_get); + DBUG_ON(ch->local_GP->get <= initial_get); @@ -966,15 +976,16 @@ Index: linux-2.6/drivers/misc/xp/xpc_channel.c * been delivered. */ get = ch->local_GP->get; -- if (get = msg_number) { -+ if (get = msg_number) +- if (get == msg_number) { ++ if (get == msg_number) xpc_acknowledge_msgs(ch, get, msg->flags); - } /* the call to xpc_msgqueue_ref() was done by xpc_deliver_msg() */ xpc_msgqueue_deref(ch); Index: linux-2.6/drivers/misc/xp/xpc.h -=================================--- linux-2.6.orig/drivers/misc/xp/xpc.h 2008-03-26 14:40:29.245382745 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xpc.h 2008-03-26 14:40:29.245382745 -0500 +++ linux-2.6/drivers/misc/xp/xpc.h 2008-03-26 14:40:37.246376201 -0500 @@ -109,16 +109,16 @@ struct xpc_rsvd_page { u8 SAL_partid; /* SAL: partition ID */ @@ -1000,9 +1011,9 @@ Index: linux-2.6/drivers/misc/xp/xpc.h { int ret; -- if ((ret = stamp1->tv_sec - stamp2->tv_sec) = 0) { +- if ((ret = stamp1->tv_sec - stamp2->tv_sec) == 0) { + ret = stamp1->tv_sec - stamp2->tv_sec; -+ if (ret = 0) ++ if (ret == 0) ret = stamp1->tv_nsec - stamp2->tv_nsec; - } + @@ -1074,7 +1085,7 @@ Index: linux-2.6/drivers/misc/xp/xpc.h - volatile u8 type; /* type of notification */ + u8 type; /* type of notification */ - /* the following two fields are only used if type = XPC_N_CALL */ + /* the following two fields are only used if type == XPC_N_CALL */ xpc_notify_func func; /* user's notify function */ @@ -466,10 +468,10 @@ struct xpc_channel { void *local_msgqueue_base; /* base address of kmalloc'd space */ @@ -1232,8 +1243,8 @@ Index: linux-2.6/drivers/misc/xp/xpc.h static inline void xpc_wakeup_channel_mgr(struct xpc_partition *part) { -- if (atomic_inc_return(&part->channel_mgr_requests) = 1) { -+ if (atomic_inc_return(&part->channel_mgr_requests) = 1) +- if (atomic_inc_return(&part->channel_mgr_requests) == 1) { ++ if (atomic_inc_return(&part->channel_mgr_requests) == 1) wake_up(&part->channel_mgr_wq); - } } @@ -1243,8 +1254,8 @@ Index: linux-2.6/drivers/misc/xp/xpc.h s32 refs = atomic_dec_return(&ch->references); DBUG_ON(refs < 0); -- if (refs = 0) { -+ if (refs = 0) +- if (refs == 0) { ++ if (refs == 0) xpc_wakeup_channel_mgr(&xpc_partitions[ch->partid]); - } } @@ -1254,8 +1265,8 @@ Index: linux-2.6/drivers/misc/xp/xpc.h s32 refs = atomic_dec_return(&part->references); DBUG_ON(refs < 0); -- if (refs = 0 && part->setup_state = XPC_P_SS_WTEARDOWN) { -+ if (refs = 0 && part->setup_state = XPC_P_SS_WTEARDOWN) +- if (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN) { ++ if (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN) wake_up(&part->teardown_wq); - } } @@ -1264,7 +1275,7 @@ Index: linux-2.6/drivers/misc/xp/xpc.h @@ -776,9 +775,9 @@ xpc_part_ref(struct xpc_partition *part) atomic_inc(&part->references); - setup = (part->setup_state = XPC_P_SS_SETUP); + setup = (part->setup_state == XPC_P_SS_SETUP); - if (!setup) { + if (!setup) xpc_part_deref(part); @@ -1286,15 +1297,16 @@ Index: linux-2.6/drivers/misc/xp/xpc.h ret = xp_get_amo(part->local_IPI_amo_va, XP_AMO_CLEAR, &IPI_amo); BUG_ON(ret != xpSuccess); /* should never happen */ -- if (IPI_amo = 0) { -+ if (IPI_amo = 0) +- if (IPI_amo == 0) { ++ if (IPI_amo == 0) return; - } spin_lock_irqsave(&part->IPI_lock, irq_flags); part->local_IPI_amo |= IPI_amo; Index: linux-2.6/drivers/misc/xp/xp_sn2.c -=================================--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c 2008-03-26 14:40:29.197376784 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c 2008-03-26 14:40:29.197376784 -0500 +++ linux-2.6/drivers/misc/xp/xp_sn2.c 2008-03-26 14:40:37.270379182 -0500 @@ -22,8 +22,6 @@ #include <asm/sn/sn_sal.h> @@ -1335,7 +1347,8 @@ Index: linux-2.6/drivers/misc/xp/xp_sn2.c @@ -323,10 +321,10 @@ xp_change_memprotect_shub_wars_1_1_sn2(i /* save current protection values */ - xpc_prot_vec[node] (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid, + xpc_prot_vec[node] = + (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid, - SH1_MD_DQLP_MMR_DIR_PRIVEC0)); + SH1_MD_DQLP_MMR_DIR_PRIVEC0)); /* open up everything */ @@ -1365,7 +1378,8 @@ Index: linux-2.6/drivers/misc/xp/xp_sn2.c /* SH_IPI_ACCESS shub register value on startup */ Index: linux-2.6/drivers/misc/xp/xp_main.c -=================================--- linux-2.6.orig/drivers/misc/xp/xp_main.c 2008-03-26 14:40:29.173373804 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xp_main.c 2008-03-26 14:40:29.173373804 -0500 +++ linux-2.6/drivers/misc/xp/xp_main.c 2008-03-26 14:40:37.294382162 -0500 @@ -38,38 +38,58 @@ struct device *xp = &xp_dbg_subname; u64 xp_nofault_PIOR_target; @@ -1545,7 +1559,8 @@ Index: linux-2.6/drivers/misc/xp/xp_main.c -EXPORT_SYMBOL(xpc_connect); -EXPORT_SYMBOL(xpc_disconnect); Index: linux-2.6/drivers/misc/xp/xp_uv.c -=================================--- linux-2.6.orig/drivers/misc/xp/xp_uv.c 2008-03-26 14:40:29.221379765 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xp_uv.c 2008-03-26 14:40:29.221379765 -0500 +++ linux-2.6/drivers/misc/xp/xp_uv.c 2008-03-26 14:40:37.318385142 -0500 @@ -18,8 +18,6 @@ #include <linux/device.h> @@ -1557,7 +1572,8 @@ Index: linux-2.6/drivers/misc/xp/xp_uv.c xp_register_nofault_code_uv(void) { Index: linux-2.6/drivers/misc/xp/xpc_main.c -=================================--- linux-2.6.orig/drivers/misc/xp/xpc_main.c 2008-03-26 14:40:29.000000000 -0500 +=================================================================== +--- linux-2.6.orig/drivers/misc/xp/xpc_main.c 2008-03-26 14:40:29.000000000 -0500 +++ linux-2.6/drivers/misc/xp/xpc_main.c 2008-03-26 15:51:27.739320504 -0500 @@ -46,14 +46,14 @@ #include <linux/kernel.h> @@ -1623,7 +1639,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_main.c "been received\n", @@ -293,7 +289,7 @@ xpc_hb_checker(void *ignore) atomic_read(&xpc_act_IRQ_rcvd) - || jiffies > xpc_hb_check_timeout + || jiffies >= + xpc_hb_check_timeout - || (volatile int)xpc_exiting)); + || xpc_exiting)); } @@ -1642,8 +1659,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_main.c /* wait a 1/4 of a second or so */ (void)msleep_interruptible(250); -- if (part->act_state = XPC_P_AS_DEACTIVATING) { -+ if (part->act_state = XPC_P_AS_DEACTIVATING) +- if (part->act_state == XPC_P_AS_DEACTIVATING) { ++ if (part->act_state == XPC_P_AS_DEACTIVATING) return part->reason; - } } @@ -1659,18 +1676,18 @@ Index: linux-2.6/drivers/misc/xp/xpc_main.c - || (volatile u64)part-> - local_IPI_amo != 0 - || ((volatile u8)part-> -- act_state = +- act_state == - XPC_P_AS_DEACTIVATING - && atomic_read(&part-> - nchannels_active) -- = 0 +- == 0 - && - xpc_partition_disengaged - (part)))); + (atomic_read(&part->channel_mgr_requests) > 0 + || part->local_IPI_amo != 0 -+ || (part->act_state = XPC_P_AS_DEACTIVATING -+ && atomic_read(&part->nchannels_active) = 0 ++ || (part->act_state == XPC_P_AS_DEACTIVATING ++ && atomic_read(&part->nchannels_active) == 0 + && xpc_partition_disengaged(part)))); atomic_set(&part->channel_mgr_requests, 1); } @@ -1690,8 +1707,8 @@ Index: linux-2.6/drivers/misc/xp/xpc_main.c (void)xpc_part_ref(part); /* this will always succeed */ -- if (xpc_make_first_contact(part) = xpSuccess) { -+ if (xpc_make_first_contact(part) = xpSuccess) +- if (xpc_make_first_contact(part) == xpSuccess) { ++ if (xpc_make_first_contact(part) == xpSuccess) xpc_channel_mgr(part); - } @@ -1978,7 +1995,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_main.c /* @@ -1269,50 +1220,30 @@ xpc_init(void) xpc_rsvd_page = xpc_rsvd_page_init(); - if (xpc_rsvd_page = NULL) { + if (xpc_rsvd_page == NULL) { dev_err(xpc_part, "could not setup our reserved page\n"); - - free_irq(SGI_XPC_ACTIVATE, NULL); @@ -2000,7 +2017,7 @@ Index: linux-2.6/drivers/misc/xp/xpc_main.c GFP_KERNEL, - &xpc_remote_copy_buffer_base); + &xpc_remote_copy_buffer_base); - if (xpc_remote_copy_buffer = NULL) { + if (xpc_remote_copy_buffer == NULL) { dev_err(xpc_part, "could not allocate remote copy buffer\n"); - - /* indicate to others that our reserved page is uninitialized */ diff --git a/a/content_digest b/N1/content_digest index 6da9d43..78e13a8 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,12 +1,13 @@ "ref\020080326215807.GF31340@sgi.com\0" "From\0Dean Nelson <dcn@sgi.com>\0" "Subject\0[Patch 5/5] run drivers/misc/xp through scripts/checkpatch.pl -v3\0" - "Date\0Wed, 26 Mar 2008 22:05:44 +0000\0" + "Date\0Wed, 26 Mar 2008 17:05:44 -0500\0" "To\0jes@sgi.com" tony.luck@intel.com linux-kernel@vger.kernel.org " linux-ia64@vger.kernel.org\0" "\00:1\0" + "fn\0checkpatch_pl\0" "b\0" "Addressed issues raised by scripts/checkpatch.pl. Removed unnecessary curly\n" "braces. Eliminated uses of volatiles and use of kernel_thread() and daemonize().\n" @@ -30,7 +31,8 @@ " 8 files changed, 322 insertions(+), 461 deletions(-)\n" "\n" "Index: linux-2.6/drivers/misc/xp/xpnet.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xpnet.c\t2008-03-26 14:40:29.337394170 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xpnet.c\t2008-03-26 14:40:29.337394170 -0500\n" "+++ linux-2.6/drivers/misc/xp/xpnet.c\t2008-03-26 15:58:25.102979549 -0500\n" "@@ -31,7 +31,6 @@\n" " #include <linux/mii.h>\n" @@ -66,8 +68,8 @@ " \t */\n" " \txpnet_device = alloc_netdev(sizeof(struct xpnet_dev_private),\n" " \t\t\t\t XPNET_DEVICE_NAME, ether_setup);\n" - "-\tif (xpnet_device = NULL) {\n" - "+\tif (xpnet_device = NULL)\n" + "-\tif (xpnet_device == NULL) {\n" + "+\tif (xpnet_device == NULL)\n" " \t\treturn -ENOMEM;\n" "-\t}\n" " \n" @@ -94,19 +96,20 @@ " \treturn result;\n" " }\n" "Index: linux-2.6/drivers/misc/xp/xpc_partition.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xpc_partition.c\t2008-03-26 14:40:29.317391686 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xpc_partition.c\t2008-03-26 14:40:29.317391686 -0500\n" "+++ linux-2.6/drivers/misc/xp/xpc_partition.c\t2008-03-26 14:40:37.210371731 -0500\n" "@@ -64,19 +64,19 @@ xpc_kmalloc_cacheline_aligned(size_t siz\n" " {\n" " \t/* see if kmalloc will give us cachline aligned memory by default */\n" " \t*base = kmalloc(size, flags);\n" - "-\tif (*base = NULL) {\n" - "+\tif (*base = NULL)\n" + "-\tif (*base == NULL) {\n" + "+\tif (*base == NULL)\n" " \t\treturn NULL;\n" "-\t}\n" - "-\tif ((u64)*base = L1_CACHE_ALIGN((u64)*base)) {\n" + "-\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {\n" "+\n" - "+\tif ((u64)*base = L1_CACHE_ALIGN((u64)*base))\n" + "+\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base))\n" " \t\treturn *base;\n" "-\t}\n" "+\n" @@ -114,8 +117,8 @@ " \n" " \t/* nope, we'll have to do it ourselves */\n" " \t*base = kmalloc(size + L1_CACHE_BYTES, flags);\n" - "-\tif (*base = NULL) {\n" - "+\tif (*base = NULL)\n" + "-\tif (*base == NULL) {\n" + "+\tif (*base == NULL)\n" " \t\treturn NULL;\n" "-\t}\n" "+\n" @@ -149,12 +152,12 @@ " \t * that saved copy on subsequent loads of XPC. This AMO page is never\n" " \t * freed, and its memory protections are never restricted.\n" " \t */\n" - "-\tif ((amos_page = xpc_vars->amos_page) = NULL) {\n" + "-\tif ((amos_page = xpc_vars->amos_page) == NULL) {\n" "+\tamos_page = xpc_vars->amos_page;\n" - "+\tif (amos_page = NULL) {\n" + "+\tif (amos_page == NULL) {\n" " \t\tn_amos = xpc_number_of_amos(XP_NPARTITIONS);\n" " \t\tamos_page = xp_alloc_amos(n_amos);\n" - " \t\tif (amos_page = NULL) {\n" + " \t\tif (amos_page == NULL) {\n" "@@ -236,9 +236,8 @@ xpc_rsvd_page_init(void)\n" " \n" " \t/* initialize the activate IRQ related AMO variables */\n" @@ -175,8 +178,8 @@ " \t\t\tbreak;\n" "-\t\t}\n" " \n" - "-\t\tif (partid = xp_partition_id) {\n" - "+\t\tif (partid = xp_partition_id)\n" + "-\t\tif (partid == xp_partition_id) {\n" + "+\t\tif (partid == xp_partition_id)\n" " \t\t\tcontinue;\n" "-\t\t}\n" " \n" @@ -186,8 +189,8 @@ " \t/* get the reserved page's physical address */\n" " \n" " \t*remote_rp_pa = xpc_get_rsvd_page_pa(nasid);\n" - "-\tif (*remote_rp_pa = 0) {\n" - "+\tif (*remote_rp_pa = 0)\n" + "-\tif (*remote_rp_pa == 0) {\n" + "+\tif (*remote_rp_pa == 0)\n" " \t\treturn xpNoRsvdPageAddr;\n" "-\t}\n" " \n" @@ -208,12 +211,13 @@ "-\t\t}\n" " \t}\n" " \n" - " \tif (XPC_VERSION_MAJOR(remote_rp->version) !@@ -373,16 +367,14 @@ xpc_get_remote_vars(u64 remote_vars_pa, \n" + " \tif (XPC_VERSION_MAJOR(remote_rp->version) !=\n" + "@@ -373,16 +367,14 @@ xpc_get_remote_vars(u64 remote_vars_pa, \n" " {\n" " \tenum xp_retval ret;\n" " \n" - "-\tif (remote_vars_pa = 0) {\n" - "+\tif (remote_vars_pa = 0)\n" + "-\tif (remote_vars_pa == 0) {\n" + "+\tif (remote_vars_pa == 0)\n" " \t\treturn xpVarsNotSet;\n" "-\t}\n" " \n" @@ -225,7 +229,8 @@ " \t\treturn ret;\n" "-\t}\n" " \n" - " \tif (XPC_VERSION_MAJOR(remote_vars->version) ! \t XPC_VERSION_MAJOR(XPC_V_VERSION)) {\n" + " \tif (XPC_VERSION_MAJOR(remote_vars->version) !=\n" + " \t XPC_VERSION_MAJOR(XPC_V_VERSION)) {\n" "@@ -391,8 +383,9 @@ xpc_get_remote_vars(u64 remote_vars_pa, \n" " \n" " \t/* check that the partid is for another partition */\n" @@ -234,7 +239,7 @@ "+\t remote_vars->partid > XP_MAX_PARTID) {\n" " \t\treturn xpInvalidPartid;\n" "+\t}\n" - " \tif (remote_vars->partid = xp_partition_id)\n" + " \tif (remote_vars->partid == xp_partition_id)\n" " \t\treturn xpLocalPartid;\n" " \n" "@@ -494,9 +487,8 @@ xpc_identify_act_IRQ_req(int nasid)\n" @@ -279,8 +284,8 @@ " \tremote_rp = xpc_kmalloc_cacheline_aligned(XPC_RP_HEADER_SIZE +\n" " \t\t\t\t\t\t xp_sizeof_nasid_mask,\n" " \t\t\t\t\t\t GFP_KERNEL, &remote_rp_base);\n" - "-\tif (remote_rp = NULL) {\n" - "+\tif (remote_rp = NULL)\n" + "-\tif (remote_rp == NULL) {\n" + "+\tif (remote_rp == NULL)\n" " \t\treturn;\n" "-\t}\n" "+\n" @@ -323,15 +328,16 @@ " \tu64 part_nasid_pa;\n" " \n" " \tpart = &xpc_partitions[partid];\n" - "-\tif (part->remote_rp_pa = 0) {\n" - "+\tif (part->remote_rp_pa = 0)\n" + "-\tif (part->remote_rp_pa == 0) {\n" + "+\tif (part->remote_rp_pa == 0)\n" " \t\treturn xpPartitionDown;\n" "-\t}\n" " \n" " \tmemset(nasid_mask, 0, xp_sizeof_nasid_mask);\n" " \n" "Index: linux-2.6/drivers/misc/xp/xpc_channel.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c\t2008-03-26 14:40:29.273386222 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xpc_channel.c\t2008-03-26 14:40:29.273386222 -0500\n" "+++ linux-2.6/drivers/misc/xp/xpc_channel.c\t2008-03-26 14:40:37.230374214 -0500\n" "@@ -24,7 +24,7 @@\n" " #include \"xpc.h\"\n" @@ -346,13 +352,13 @@ " {\n" " \t/* see if kzalloc will give us cachline aligned memory by default */\n" " \t*base = kzalloc(size, flags);\n" - "-\tif (*base = NULL) {\n" - "+\tif (*base = NULL)\n" + "-\tif (*base == NULL) {\n" + "+\tif (*base == NULL)\n" " \t\treturn NULL;\n" "-\t}\n" - "-\tif ((u64)*base = L1_CACHE_ALIGN((u64)*base)) {\n" + "-\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base)) {\n" "+\n" - "+\tif ((u64)*base = L1_CACHE_ALIGN((u64)*base))\n" + "+\tif ((u64)*base == L1_CACHE_ALIGN((u64)*base))\n" " \t\treturn *base;\n" "-\t}\n" "+\n" @@ -360,8 +366,8 @@ " \n" " \t/* nope, we'll have to do it ourselves */\n" " \t*base = kzalloc(size + L1_CACHE_BYTES, flags);\n" - "-\tif (*base = NULL) {\n" - "+\tif (*base = NULL)\n" + "-\tif (*base == NULL) {\n" + "+\tif (*base == NULL)\n" " \t\treturn NULL;\n" "-\t}\n" "+\n" @@ -379,7 +385,7 @@ "@@ -127,11 +128,10 @@ xpc_setup_infrastructure(struct xpc_part\n" " \t\t\t\t\t\t\tGFP_KERNEL,\n" " \t\t\t\t\t\t\t&part->local_GPs_base);\n" - " \tif (part->local_GPs = NULL) {\n" + " \tif (part->local_GPs == NULL) {\n" "-\t\tkfree(part->channels);\n" "-\t\tpart->channels = NULL;\n" " \t\tdev_err(xpc_chan, \"can't get memory for local get/put \"\n" @@ -391,7 +397,7 @@ " \n" " \tpart->remote_GPs = xpc_kzalloc_cacheline_aligned(XPC_GP_SIZE,\n" "@@ -141,11 +141,8 @@ xpc_setup_infrastructure(struct xpc_part\n" - " \tif (part->remote_GPs = NULL) {\n" + " \tif (part->remote_GPs == NULL) {\n" " \t\tdev_err(xpc_chan, \"can't get memory for remote get/put \"\n" " \t\t\t\"values\\n\");\n" "-\t\tkfree(part->local_GPs_base);\n" @@ -406,7 +412,7 @@ " \t/* allocate all the required open and close args */\n" "@@ -155,13 +152,8 @@ xpc_setup_infrastructure(struct xpc_part\n" " \t\t\t\t\t &part->local_openclose_args_base);\n" - " \tif (part->local_openclose_args = NULL) {\n" + " \tif (part->local_openclose_args == NULL) {\n" " \t\tdev_err(xpc_chan, \"can't get memory for local connect args\\n\");\n" "-\t\tkfree(part->remote_GPs_base);\n" "-\t\tpart->remote_GPs = NULL;\n" @@ -419,9 +425,10 @@ "+\t\tgoto out_3;\n" " \t}\n" " \n" - " \tpart->remote_openclose_args @@ -169,15 +161,8 @@ xpc_setup_infrastructure(struct xpc_part\n" + " \tpart->remote_openclose_args =\n" + "@@ -169,15 +161,8 @@ xpc_setup_infrastructure(struct xpc_part\n" " \t\t\t\t\t &part->remote_openclose_args_base);\n" - " \tif (part->remote_openclose_args = NULL) {\n" + " \tif (part->remote_openclose_args == NULL) {\n" " \t\tdev_err(xpc_chan, \"can't get memory for remote connect args\\n\");\n" "-\t\tkfree(part->local_openclose_args_base);\n" "-\t\tpart->local_openclose_args = NULL;\n" @@ -487,8 +494,8 @@ " \tDBUG_ON((u64)dst != L1_CACHE_ALIGN((u64)dst));\n" " \tDBUG_ON(cnt != L1_CACHE_ALIGN(cnt));\n" " \n" - "-\tif (part->act_state = XPC_P_AS_DEACTIVATING) {\n" - "+\tif (part->act_state = XPC_P_AS_DEACTIVATING)\n" + "-\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n" + "+\tif (part->act_state == XPC_P_AS_DEACTIVATING)\n" " \t\treturn part->reason;\n" "-\t}\n" " \n" @@ -508,8 +515,8 @@ " \t\txpc_vars_part[partid].magic = XPC_VP_MAGIC2;\n" " \t}\n" " \n" - "-\tif (pulled_entry->magic = XPC_VP_MAGIC1) {\n" - "+\tif (pulled_entry->magic = XPC_VP_MAGIC1)\n" + "-\tif (pulled_entry->magic == XPC_VP_MAGIC1) {\n" + "+\tif (pulled_entry->magic == XPC_VP_MAGIC1)\n" " \t\treturn xpRetry;\n" "-\t}\n" " \n" @@ -534,9 +541,9 @@ " \t\t\t\t\t\t\t\t GFP_KERNEL,\n" "-\t\t\t\t\t\t\t\t &ch->\n" "-\t\t\t\t\t\t\t\t local_msgqueue_base);\n" - "-\t\tif (ch->local_msgqueue = NULL) {\n" + "-\t\tif (ch->local_msgqueue == NULL) {\n" "+\t\t\t\t\t\t &ch->local_msgqueue_base);\n" - "+\t\tif (ch->local_msgqueue = NULL)\n" + "+\t\tif (ch->local_msgqueue == NULL)\n" " \t\t\tcontinue;\n" "-\t\t}\n" " \n" @@ -548,9 +555,9 @@ " \t\t\t\t\t\t\t\t GFP_KERNEL,\n" "-\t\t\t\t\t\t\t\t &ch->\n" "-\t\t\t\t\t\t\t\t remote_msgqueue_base);\n" - "-\t\tif (ch->remote_msgqueue = NULL) {\n" + "-\t\tif (ch->remote_msgqueue == NULL) {\n" "+\t\t\t\t\t\t &ch->remote_msgqueue_base);\n" - "+\t\tif (ch->remote_msgqueue = NULL)\n" + "+\t\tif (ch->remote_msgqueue == NULL)\n" " \t\t\tcontinue;\n" "-\t\t}\n" " \n" @@ -587,7 +594,7 @@ "-\t\t}\n" " \n" " \t\tDBUG_ON(!(ch->flags & XPC_C_SETUP));\n" - " \t\tDBUG_ON(ch->local_msgqueue = NULL);\n" + " \t\tDBUG_ON(ch->local_msgqueue == NULL);\n" "@@ -590,9 +579,8 @@ xpc_process_connect(struct xpc_channel *\n" " \t\txpc_IPI_send_openreply(ch, irq_flags);\n" " \t}\n" @@ -597,7 +604,7 @@ " \t\treturn;\n" "-\t}\n" " \n" - " \tDBUG_ON(ch->remote_msgqueue_pa = 0);\n" + " \tDBUG_ON(ch->remote_msgqueue_pa == 0);\n" " \n" "@@ -711,9 +699,8 @@ xpc_process_disconnect(struct xpc_channe\n" " \n" @@ -612,7 +619,7 @@ " \n" "@@ -728,26 +715,23 @@ xpc_process_disconnect(struct xpc_channe\n" " \n" - " \tif (part->act_state = XPC_P_AS_DEACTIVATING) {\n" + " \tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n" " \t\t/* can't proceed until the other side disengages from us */\n" "-\t\tif (xpc_partition_engaged(ch->partid)) {\n" "+\t\tif (xpc_partition_engaged(ch->partid))\n" @@ -660,8 +667,8 @@ "-\t\t\tif (reason <= xpSuccess || reason > xpUnknownReason) {\n" "+\t\t\tif (reason <= xpSuccess || reason > xpUnknownReason)\n" " \t\t\t\treason = xpUnknownReason;\n" - "-\t\t\t} else if (reason = xpUnregistering) {\n" - "+\t\t\telse if (reason = xpUnregistering)\n" + "-\t\t\t} else if (reason == xpUnregistering) {\n" + "+\t\t\telse if (reason == xpUnregistering)\n" " \t\t\t\treason = xpOtherUnregistering;\n" "-\t\t\t}\n" " \n" @@ -671,8 +678,8 @@ " \tunsigned long irq_flags;\n" " \tstruct xpc_registration *registration = &xpc_registrations[ch->number];\n" " \n" - "-\tif (mutex_trylock(®istration->mutex) = 0) {\n" - "+\tif (mutex_trylock(®istration->mutex) = 0)\n" + "-\tif (mutex_trylock(®istration->mutex) == 0) {\n" + "+\tif (mutex_trylock(®istration->mutex) == 0)\n" " \t\treturn xpRetry;\n" "-\t}\n" " \n" @@ -733,8 +740,8 @@ " \t\t\tcontinue;\n" " \t\t}\n" " \n" - "-\t\tif (part->act_state = XPC_P_AS_DEACTIVATING) {\n" - "+\t\tif (part->act_state = XPC_P_AS_DEACTIVATING)\n" + "-\t\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n" + "+\t\tif (part->act_state == XPC_P_AS_DEACTIVATING)\n" " \t\t\tcontinue;\n" "-\t\t}\n" " \n" @@ -802,8 +809,8 @@ " \t\t * that will cause the IPI handler to fetch the latest\n" " \t\t * GP values as if an IPI was sent by the other side.\n" " \t\t */\n" - "-\t\tif (ret = xpTimeout) {\n" - "+\t\tif (ret = xpTimeout)\n" + "-\t\tif (ret == xpTimeout) {\n" + "+\t\tif (ret == xpTimeout)\n" " \t\t\txpc_IPI_send_local_msgrequest(ch);\n" "-\t\t}\n" " \n" @@ -824,8 +831,8 @@ " \twhile (1) {\n" " \n" " \t\twhile (1) {\n" - "-\t\t\tif (put = (volatile s64)ch->w_local_GP.put) {\n" - "+\t\t\tif (put = ch->w_local_GP.put)\n" + "-\t\t\tif (put == (volatile s64)ch->w_local_GP.put) {\n" + "+\t\t\tif (put == ch->w_local_GP.put)\n" " \t\t\t\tbreak;\n" "-\t\t\t}\n" " \n" @@ -841,7 +848,8 @@ " \t\t\tput++;\n" " \t\t}\n" "@@ -1810,7 +1782,7 @@ xpc_send_msgs(struct xpc_channel *ch, s6\n" - " \t\tif (cmpxchg_rel(&ch->local_GP->put, initial_put, put) ! \t\t initial_put) {\n" + " \t\tif (cmpxchg_rel(&ch->local_GP->put, initial_put, put) !=\n" + " \t\t initial_put) {\n" " \t\t\t/* someone else beat us to it */\n" "-\t\t\tDBUG_ON((volatile s64)ch->local_GP->put < initial_put);\n" "+\t\t\tDBUG_ON(ch->local_GP->put < initial_put);\n" @@ -863,8 +871,8 @@ " \t/* see if the message is next in line to be sent, if so send it */\n" " \n" " \tput = ch->local_GP->put;\n" - "-\tif (put = msg_number) {\n" - "+\tif (put = msg_number)\n" + "-\tif (put == msg_number) {\n" + "+\tif (put == msg_number)\n" " \t\txpc_send_msgs(ch, put);\n" "-\t}\n" " \n" @@ -874,7 +882,8 @@ " \n" " \t\tmsg_index = ch->next_msg_to_pull % ch->remote_nentries;\n" " \n" - "-\t\tDBUG_ON(ch->next_msg_to_pull >-\t\t\t(volatile s64)ch->w_remote_GP.put);\n" + "-\t\tDBUG_ON(ch->next_msg_to_pull >=\n" + "-\t\t\t(volatile s64)ch->w_remote_GP.put);\n" "-\t\tnmsgs = (volatile s64)ch->w_remote_GP.put -\n" "-\t\t ch->next_msg_to_pull;\n" "+\t\tDBUG_ON(ch->next_msg_to_pull >= ch->w_remote_GP.put);\n" @@ -887,7 +896,8 @@ " \t\t\t\t\t\tmsg_offset);\n" " \n" "-\t\tif ((ret = xpc_pull_remote_cachelines(part, msg, remote_msg,\n" - "-\t\t\t\t\t\t nmsgs * ch->msg_size)) !-\t\t xpSuccess) {\n" + "-\t\t\t\t\t\t nmsgs * ch->msg_size)) !=\n" + "-\t\t xpSuccess) {\n" "-\n" "+\t\tret = xpc_pull_remote_cachelines(part, msg, remote_msg, nmsgs *\n" "+\t\t\t\t\t\t ch->msg_size);\n" @@ -914,10 +924,10 @@ "-\t\t}\n" " \n" "-\t\tget = (volatile s64)ch->w_local_GP.get;\n" - "-\t\tif (get = (volatile s64)ch->w_remote_GP.put) {\n" + "-\t\tif (get == (volatile s64)ch->w_remote_GP.put) {\n" "+\t\tget = ch->w_local_GP.get;\n" "+\t\trmb();\t/* guarantee that .get loads before .put */\n" - "+\t\tif (get = ch->w_remote_GP.put)\n" + "+\t\tif (get == ch->w_remote_GP.put)\n" " \t\t\tbreak;\n" "-\t\t}\n" " \n" @@ -937,8 +947,8 @@ " \twhile (1) {\n" " \n" " \t\twhile (1) {\n" - "-\t\t\tif (get = (volatile s64)ch->w_local_GP.get) {\n" - "+\t\t\tif (get = ch->w_local_GP.get)\n" + "-\t\t\tif (get == (volatile s64)ch->w_local_GP.get) {\n" + "+\t\t\tif (get == ch->w_local_GP.get)\n" " \t\t\t\tbreak;\n" "-\t\t\t}\n" " \n" @@ -954,7 +964,8 @@ " \t\t\tmsg_flags |= msg->flags;\n" " \t\t\tget++;\n" "@@ -2195,7 +2158,7 @@ xpc_acknowledge_msgs(struct xpc_channel \n" - " \t\tif (cmpxchg_rel(&ch->local_GP->get, initial_get, get) ! \t\t initial_get) {\n" + " \t\tif (cmpxchg_rel(&ch->local_GP->get, initial_get, get) !=\n" + " \t\t initial_get) {\n" " \t\t\t/* someone else beat us to it */\n" "-\t\t\tDBUG_ON((volatile s64)ch->local_GP->get <= initial_get);\n" "+\t\t\tDBUG_ON(ch->local_GP->get <= initial_get);\n" @@ -976,15 +987,16 @@ " \t * been delivered.\n" " \t */\n" " \tget = ch->local_GP->get;\n" - "-\tif (get = msg_number) {\n" - "+\tif (get = msg_number)\n" + "-\tif (get == msg_number) {\n" + "+\tif (get == msg_number)\n" " \t\txpc_acknowledge_msgs(ch, get, msg->flags);\n" "-\t}\n" " \n" " \t/* the call to xpc_msgqueue_ref() was done by xpc_deliver_msg() */\n" " \txpc_msgqueue_deref(ch);\n" "Index: linux-2.6/drivers/misc/xp/xpc.h\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xpc.h\t2008-03-26 14:40:29.245382745 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xpc.h\t2008-03-26 14:40:29.245382745 -0500\n" "+++ linux-2.6/drivers/misc/xp/xpc.h\t2008-03-26 14:40:37.246376201 -0500\n" "@@ -109,16 +109,16 @@ struct xpc_rsvd_page {\n" " \tu8 SAL_partid;\t\t/* SAL: partition ID */\n" @@ -1010,9 +1022,9 @@ " {\n" " \tint ret;\n" " \n" - "-\tif ((ret = stamp1->tv_sec - stamp2->tv_sec) = 0) {\n" + "-\tif ((ret = stamp1->tv_sec - stamp2->tv_sec) == 0) {\n" "+\tret = stamp1->tv_sec - stamp2->tv_sec;\n" - "+\tif (ret = 0)\n" + "+\tif (ret == 0)\n" " \t\tret = stamp1->tv_nsec - stamp2->tv_nsec;\n" "-\t}\n" "+\n" @@ -1084,7 +1096,7 @@ "-\tvolatile u8 type;\t/* type of notification */\n" "+\tu8 type;\t\t/* type of notification */\n" " \n" - " \t/* the following two fields are only used if type = XPC_N_CALL */\n" + " \t/* the following two fields are only used if type == XPC_N_CALL */\n" " \txpc_notify_func func;\t/* user's notify function */\n" "@@ -466,10 +468,10 @@ struct xpc_channel {\n" " \tvoid *local_msgqueue_base;\t/* base address of kmalloc'd space */\n" @@ -1242,8 +1254,8 @@ " static inline void\n" " xpc_wakeup_channel_mgr(struct xpc_partition *part)\n" " {\n" - "-\tif (atomic_inc_return(&part->channel_mgr_requests) = 1) {\n" - "+\tif (atomic_inc_return(&part->channel_mgr_requests) = 1)\n" + "-\tif (atomic_inc_return(&part->channel_mgr_requests) == 1) {\n" + "+\tif (atomic_inc_return(&part->channel_mgr_requests) == 1)\n" " \t\twake_up(&part->channel_mgr_wq);\n" "-\t}\n" " }\n" @@ -1253,8 +1265,8 @@ " \ts32 refs = atomic_dec_return(&ch->references);\n" " \n" " \tDBUG_ON(refs < 0);\n" - "-\tif (refs = 0) {\n" - "+\tif (refs = 0)\n" + "-\tif (refs == 0) {\n" + "+\tif (refs == 0)\n" " \t\txpc_wakeup_channel_mgr(&xpc_partitions[ch->partid]);\n" "-\t}\n" " }\n" @@ -1264,8 +1276,8 @@ " \ts32 refs = atomic_dec_return(&part->references);\n" " \n" " \tDBUG_ON(refs < 0);\n" - "-\tif (refs = 0 && part->setup_state = XPC_P_SS_WTEARDOWN) {\n" - "+\tif (refs = 0 && part->setup_state = XPC_P_SS_WTEARDOWN)\n" + "-\tif (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN) {\n" + "+\tif (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN)\n" " \t\twake_up(&part->teardown_wq);\n" "-\t}\n" " }\n" @@ -1274,7 +1286,7 @@ "@@ -776,9 +775,9 @@ xpc_part_ref(struct xpc_partition *part)\n" " \n" " \tatomic_inc(&part->references);\n" - " \tsetup = (part->setup_state = XPC_P_SS_SETUP);\n" + " \tsetup = (part->setup_state == XPC_P_SS_SETUP);\n" "-\tif (!setup) {\n" "+\tif (!setup)\n" " \t\txpc_part_deref(part);\n" @@ -1296,15 +1308,16 @@ " \n" " \tret = xp_get_amo(part->local_IPI_amo_va, XP_AMO_CLEAR, &IPI_amo);\n" " \tBUG_ON(ret != xpSuccess);\t/* should never happen */\n" - "-\tif (IPI_amo = 0) {\n" - "+\tif (IPI_amo = 0)\n" + "-\tif (IPI_amo == 0) {\n" + "+\tif (IPI_amo == 0)\n" " \t\treturn;\n" "-\t}\n" " \n" " \tspin_lock_irqsave(&part->IPI_lock, irq_flags);\n" " \tpart->local_IPI_amo |= IPI_amo;\n" "Index: linux-2.6/drivers/misc/xp/xp_sn2.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c\t2008-03-26 14:40:29.197376784 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xp_sn2.c\t2008-03-26 14:40:29.197376784 -0500\n" "+++ linux-2.6/drivers/misc/xp/xp_sn2.c\t2008-03-26 14:40:37.270379182 -0500\n" "@@ -22,8 +22,6 @@\n" " #include <asm/sn/sn_sal.h>\n" @@ -1345,7 +1358,8 @@ " \n" "@@ -323,10 +321,10 @@ xp_change_memprotect_shub_wars_1_1_sn2(i\n" " \t\t\t/* save current protection values */\n" - " \t\t\txpc_prot_vec[node] \t\t\t (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid,\n" + " \t\t\txpc_prot_vec[node] =\n" + " \t\t\t (u64)HUB_L((u64 *)GLOBAL_MMR_ADDR(nasid,\n" "-\t\t\t\t\t\t\t SH1_MD_DQLP_MMR_DIR_PRIVEC0));\n" "+\t\t\t\t\t\t SH1_MD_DQLP_MMR_DIR_PRIVEC0));\n" " \t\t\t/* open up everything */\n" @@ -1375,7 +1389,8 @@ " \n" " /* SH_IPI_ACCESS shub register value on startup */\n" "Index: linux-2.6/drivers/misc/xp/xp_main.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xp_main.c\t2008-03-26 14:40:29.173373804 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xp_main.c\t2008-03-26 14:40:29.173373804 -0500\n" "+++ linux-2.6/drivers/misc/xp/xp_main.c\t2008-03-26 14:40:37.294382162 -0500\n" "@@ -38,38 +38,58 @@ struct device *xp = &xp_dbg_subname;\n" " u64 xp_nofault_PIOR_target;\n" @@ -1555,7 +1570,8 @@ "-EXPORT_SYMBOL(xpc_connect);\n" "-EXPORT_SYMBOL(xpc_disconnect);\n" "Index: linux-2.6/drivers/misc/xp/xp_uv.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xp_uv.c\t2008-03-26 14:40:29.221379765 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xp_uv.c\t2008-03-26 14:40:29.221379765 -0500\n" "+++ linux-2.6/drivers/misc/xp/xp_uv.c\t2008-03-26 14:40:37.318385142 -0500\n" "@@ -18,8 +18,6 @@\n" " #include <linux/device.h>\n" @@ -1567,7 +1583,8 @@ " xp_register_nofault_code_uv(void)\n" " {\n" "Index: linux-2.6/drivers/misc/xp/xpc_main.c\n" - "=================================--- linux-2.6.orig/drivers/misc/xp/xpc_main.c\t2008-03-26 14:40:29.000000000 -0500\n" + "===================================================================\n" + "--- linux-2.6.orig/drivers/misc/xp/xpc_main.c\t2008-03-26 14:40:29.000000000 -0500\n" "+++ linux-2.6/drivers/misc/xp/xpc_main.c\t2008-03-26 15:51:27.739320504 -0500\n" "@@ -46,14 +46,14 @@\n" " #include <linux/kernel.h>\n" @@ -1633,7 +1650,8 @@ " \t\t\t\"been received\\n\",\n" "@@ -293,7 +289,7 @@ xpc_hb_checker(void *ignore)\n" " \t\t\t\t\t\tatomic_read(&xpc_act_IRQ_rcvd)\n" - " \t\t\t\t\t\t|| jiffies > \t\t\t\t\t\txpc_hb_check_timeout\n" + " \t\t\t\t\t\t|| jiffies >=\n" + " \t\t\t\t\t\txpc_hb_check_timeout\n" "-\t\t\t\t\t\t|| (volatile int)xpc_exiting));\n" "+\t\t\t\t\t\t|| xpc_exiting));\n" " \t}\n" @@ -1652,8 +1670,8 @@ " \t\t/* wait a 1/4 of a second or so */\n" " \t\t(void)msleep_interruptible(250);\n" " \n" - "-\t\tif (part->act_state = XPC_P_AS_DEACTIVATING) {\n" - "+\t\tif (part->act_state = XPC_P_AS_DEACTIVATING)\n" + "-\t\tif (part->act_state == XPC_P_AS_DEACTIVATING) {\n" + "+\t\tif (part->act_state == XPC_P_AS_DEACTIVATING)\n" " \t\t\treturn part->reason;\n" "-\t\t}\n" " \t}\n" @@ -1669,18 +1687,18 @@ "-\t\t\t\t\t\t|| (volatile u64)part->\n" "-\t\t\t\t\t\tlocal_IPI_amo != 0\n" "-\t\t\t\t\t\t|| ((volatile u8)part->\n" - "-\t\t\t\t\t\t act_state =\n" + "-\t\t\t\t\t\t act_state ==\n" "-\t\t\t\t\t\t XPC_P_AS_DEACTIVATING\n" "-\t\t\t\t\t\t && atomic_read(&part->\n" "-\t\t\t\t\t\t\t\t nchannels_active)\n" - "-\t\t\t\t\t\t = 0\n" + "-\t\t\t\t\t\t == 0\n" "-\t\t\t\t\t\t &&\n" "-\t\t\t\t\t\t xpc_partition_disengaged\n" "-\t\t\t\t\t\t (part))));\n" "+\t\t\t (atomic_read(&part->channel_mgr_requests) > 0\n" "+\t\t\t\t|| part->local_IPI_amo != 0\n" - "+\t\t\t\t|| (part->act_state = XPC_P_AS_DEACTIVATING\n" - "+\t\t\t\t&& atomic_read(&part->nchannels_active) = 0\n" + "+\t\t\t\t|| (part->act_state == XPC_P_AS_DEACTIVATING\n" + "+\t\t\t\t&& atomic_read(&part->nchannels_active) == 0\n" "+\t\t\t\t&& xpc_partition_disengaged(part))));\n" " \t\tatomic_set(&part->channel_mgr_requests, 1);\n" " \t}\n" @@ -1700,8 +1718,8 @@ " \n" " \t(void)xpc_part_ref(part);\t/* this will always succeed */\n" " \n" - "-\tif (xpc_make_first_contact(part) = xpSuccess) {\n" - "+\tif (xpc_make_first_contact(part) = xpSuccess)\n" + "-\tif (xpc_make_first_contact(part) == xpSuccess) {\n" + "+\tif (xpc_make_first_contact(part) == xpSuccess)\n" " \t\txpc_channel_mgr(part);\n" "-\t}\n" " \n" @@ -1988,7 +2006,7 @@ " \t/*\n" "@@ -1269,50 +1220,30 @@ xpc_init(void)\n" " \txpc_rsvd_page = xpc_rsvd_page_init();\n" - " \tif (xpc_rsvd_page = NULL) {\n" + " \tif (xpc_rsvd_page == NULL) {\n" " \t\tdev_err(xpc_part, \"could not setup our reserved page\\n\");\n" "-\n" "-\t\tfree_irq(SGI_XPC_ACTIVATE, NULL);\n" @@ -2010,7 +2028,7 @@ " \t\t\t\t\t\t\t GFP_KERNEL,\n" "-\t\t\t\t\t\t\t &xpc_remote_copy_buffer_base);\n" "+\t\t\t\t\t\t &xpc_remote_copy_buffer_base);\n" - " \tif (xpc_remote_copy_buffer = NULL) {\n" + " \tif (xpc_remote_copy_buffer == NULL) {\n" " \t\tdev_err(xpc_part, \"could not allocate remote copy buffer\\n\");\n" "-\n" "-\t\t/* indicate to others that our reserved page is uninitialized */\n" @@ -2119,4 +2137,4 @@ " \n" module_init(xpc_init); -1c3cd122601721d19db2b5b82b8947cff961caa20dedf73faac0bceb13667578 +4cd402270ed4b7bc9b2c8d03edce0245a5e3a3c0a0e5053a4c6e7be1738c289b
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.