[PATCH] kfree cleanup: misc remaining drivers
[linux-2.6-block.git] / drivers / w1 / w1_ds2433.c
index b7c24b34d270db1129009b374d52710a012c0287..1e3d98aac12dbc788b458a6adbb8e2bf70139889 100644 (file)
 #include <linux/delay.h>
 #ifdef CONFIG_W1_F23_CRC
 #include <linux/crc16.h>
+
+#define CRC16_INIT             0
+#define CRC16_VALID            0xb001
+
 #endif
 
 #include "w1.h"
@@ -214,7 +218,7 @@ static ssize_t w1_f23_write_bin(struct kobject *kobj, char *buf, loff_t off,
 #ifdef CONFIG_W1_F23_CRC
        /* can only write full blocks in cached mode */
        if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
-               dev_err(&sl->dev, "invalid offset/count off=%d cnt=%d\n",
+               dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
                        (int)off, count);
                return -EINVAL;
        }
@@ -295,10 +299,8 @@ static int w1_f23_add_slave(struct w1_slave *sl)
 static void w1_f23_remove_slave(struct w1_slave *sl)
 {
 #ifdef CONFIG_W1_F23_CRC
-       if (sl->family_data) {
-               kfree(sl->family_data);
-               sl->family_data = NULL;
-       }
+       kfree(sl->family_data);
+       sl->family_data = NULL;
 #endif /* CONFIG_W1_F23_CRC */
        sysfs_remove_bin_file(&sl->dev.kobj, &w1_f23_bin_attr);
 }