[PATCH] mark struct file_operations const 5
[pandora-kernel.git] / drivers / net / ppp_generic.c
index c6de566..11b575f 100644 (file)
@@ -83,7 +83,7 @@ struct ppp_file {
        int             dead;           /* unit/channel has been shut down */
 };
 
-#define PF_TO_X(pf, X)         ((X *)((char *)(pf) - offsetof(X, file)))
+#define PF_TO_X(pf, X)         container_of(pf, X, file)
 
 #define PF_TO_PPP(pf)          PF_TO_X(pf, struct ppp)
 #define PF_TO_CHANNEL(pf)      PF_TO_X(pf, struct channel)
@@ -834,7 +834,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
        return err;
 }
 
-static struct file_operations ppp_device_fops = {
+static const struct file_operations ppp_device_fops = {
        .owner          = THIS_MODULE,
        .read           = ppp_read,
        .write          = ppp_write,