media: si2168: use bits instead of bool for flags
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 4 Oct 2019 12:15:36 +0000 (09:15 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 10 Oct 2019 10:05:51 +0000 (07:05 -0300)
Using bool on struct is not recommended, as it wastes lots of
space. So, instead, let's use bits.

While here, convert the comments to kernel-doc format.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/dvb-frontends/si2168.h
drivers/media/dvb-frontends/si2168_priv.h

index 50dccb3..ecd21ad 100644 (file)
@@ -9,38 +9,43 @@
 #define SI2168_H
 
 #include <linux/dvb/frontend.h>
-/*
- * I2C address
- * 0x64
+/**
+ * struct si2168_config - configuration parameters for si2168
+ *
+ * @fe:
+ *     frontend returned by driver
+ * @i2c_adapter:
+ *     tuner I2C adapter returned by driver
+ * @ts_mode:
+ *     Transport Stream mode. Can be:
+ *     - %SI2168_TS_PARALLEL
+ *     - %SI2168_TS_SERIAL
+ *     - %SI2168_TS_TRISTATE
+ *     - %SI2168_TS_CLK_MANUAL
+ * @ts_clock_inv:
+ *     TS clock inverted
+ * @ts_clock_gapped:
+ *     TS clock gapped
+ * @spectral_inversion:
+ *     Inverted spectrum
+ *
+ * Note:
+ *     The I2C address of this demod is 0x64.
  */
 struct si2168_config {
-       /*
-        * frontend
-        * returned by driver
-        */
        struct dvb_frontend **fe;
-
-       /*
-        * tuner I2C adapter
-        * returned by driver
-        */
        struct i2c_adapter **i2c_adapter;
 
-       /* TS mode */
 #define SI2168_TS_PARALLEL     0x06
 #define SI2168_TS_SERIAL       0x03
 #define SI2168_TS_TRISTATE     0x00
 #define SI2168_TS_CLK_MANUAL   0x20
        u8 ts_mode;
 
-       /* TS clock inverted */
-       bool ts_clock_inv;
-
-       /* TS clock gapped */
-       bool ts_clock_gapped;
-
-       /* Inverted spectrum */
-       bool spectral_inversion;
+       /* Flags */
+       unsigned int ts_clock_inv:1;
+       unsigned int ts_clock_gapped:1;
+       unsigned int spectral_inversion:1;
 };
 
 #endif
index 804d5b3..18bea52 100644 (file)
@@ -34,12 +34,12 @@ struct si2168_dev {
        unsigned int chip_id;
        unsigned int version;
        const char *firmware_name;
-       bool active;
-       bool warm;
        u8 ts_mode;
-       bool ts_clock_inv;
-       bool ts_clock_gapped;
-       bool spectral_inversion;
+       unsigned int active:1;
+       unsigned int warm:1;
+       unsigned int ts_clock_inv:1;
+       unsigned int ts_clock_gapped:1;
+       unsigned int spectral_inversion:1;
 };
 
 /* firmware command struct */