[ofw] [PATCH] Cleanup MTHCA atomic_set function

Fab Tillier ftillier at windows.microsoft.com
Fri Jul 11 09:33:24 PDT 2008


This patch cleans up the atomic_set function in the HCA drivers.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\hw\mthca\kernel\mt_atomic.h \dev\ofw\ftillier\openib\hw\mthca\kernel\mt_atomic.h
--- old\hw\mthca\kernel\mt_atomic.h     Thu Jun 26 20:35:14 2008
+++ \dev\ofw\ftillier\openib\hw\mthca\kernel\mt_atomic.h        Tue Jul 08 16:46:22 2008
@@ -1,3 +1,35 @@
+/*
+ * Copyright (c) 2004-2005 Mellanox Technologies, Inc. All rights reserved.
+ * Portions Copyright (c) 2008 Microsoft Corporation.  All rights reserved.
+ *
+ * This software is available to you under the OpenIB.org BSD license
+ * below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * $Id:$
+ */
+
 #ifndef MT_ATOMIC_H
 #define MT_ATOMIC_H

@@ -15,7 +47,7 @@ static inline atomic_t atomic_read(atomi

 static inline void atomic_set(atomic_t *pval, long val)
 {
-       *pval = *(atomic_t *)&val; //to avoid C4197
+       *pval = val;
 }

 /**
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atomic_set.patch
Type: application/octet-stream
Size: 1924 bytes
Desc: atomic_set.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080711/c553e850/attachment.obj>


More information about the ofw mailing list