[xlnx:xlnx_rebase_v5.4 1296/1697] drivers/media/i2c/adv7511-v4l2.c:2102:63: sparse: sparse: incorrect type in argument 1 (different base types)
by kernel test robot
Hi Vishal,
First bad commit (maybe != root cause):
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head: 629150468791671b5fde21363e643e87c5815b17
commit: 0b197959bbbdb68e1da974bd013339f08704b178 [1296/1697] staging: xlnxsync: Fix the uapi header license
config: alpha-randconfig-s032-20210113 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://github.com/Xilinx/linux-xlnx/commit/0b197959bbbdb68e1da974bd01333...
git remote add xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xlnx xlnx_rebase_v5.4
git checkout 0b197959bbbdb68e1da974bd013339f08704b178
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/media/i2c/adv7511-v4l2.c:427:16: sparse: sparse: return expression in void function
>> drivers/media/i2c/adv7511-v4l2.c:2102:63: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2102:63: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2102:63: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2106:65: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2106:65: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2106:65: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2110:62: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2110:62: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2110:62: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2117:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2117:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2117:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2121:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2121:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2121:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2125:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2125:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2125:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2129:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2129:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2129:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2133:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2133:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2133:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2137:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2137:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2137:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2141:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2141:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2141:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2151:42: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2151:42: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2151:42: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2157:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2157:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2157:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2161:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2161:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2161:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2165:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2165:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2165:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2169:55: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2169:55: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2169:55: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2174:63: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2174:63: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2174:63: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2181:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2181:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2181:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2186:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2186:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2186:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2191:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2191:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2191:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2196:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2196:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2196:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2201:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2201:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2201:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2206:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2206:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2206:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2211:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2211:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2211:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2216:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2216:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2216:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2221:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2221:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2221:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2226:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2226:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2226:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2231:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2231:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2231:72: sparse: got unsigned int const [usertype] *[assigned] prop
drivers/media/i2c/adv7511-v4l2.c:2236:72: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __be32 const [usertype] *p @@ got unsigned int const [usertype] *[assigned] prop @@
drivers/media/i2c/adv7511-v4l2.c:2236:72: sparse: expected restricted __be32 const [usertype] *p
drivers/media/i2c/adv7511-v4l2.c:2236:72: sparse: got unsigned int const [usertype] *[assigned] prop
vim +2102 drivers/media/i2c/adv7511-v4l2.c
5a544cce2177fe36 drivers/media/i2c/adv7511.c Hans Verkuil 2013-08-23 2086
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2087
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2088 static void adv7511_get_ofdt_config(struct i2c_client *client,
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2089 struct adv7511_state *state)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2090 {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2091 struct device_node *dn = client->dev.of_node;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2092 struct device_node *np;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2093 struct adv7511_config *config = &state->cfg;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2094 u32 const *prop;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2095 int size;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2096 bool vin_loaded, vout_loaded;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2097
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2098 vin_loaded = vout_loaded = false;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2099
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2100 prop = of_get_property(dn, "edid-addr", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2101 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 @2102 state->pdata.i2c_edid = (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2103
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2104 prop = of_get_property(dn, "pktmem-addr", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2105 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2106 state->pdata.i2c_pktmem = (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2107
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2108 prop = of_get_property(dn, "cec-addr", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2109 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2110 state->pdata.i2c_cec = (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2111
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2112 np = of_find_node_by_name(dn, "video-input");
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2113 if (np) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2114 prop = of_get_property(np, "input-id", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2115 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2116 config->in_params.input_id =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2117 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2118 prop = of_get_property(np, "input-style", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2119 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2120 config->in_params.input_style =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2121 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2122 prop = of_get_property(np, "input-color-depth", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2123 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2124 config->in_params.input_color_depth =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2125 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2126 prop = of_get_property(np, "bit-justification", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2127 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2128 config->in_params.bit_justification =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2129 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2130 prop = of_get_property(np, "hsync-polarity", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2131 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2132 config->in_params.hsync_polarity =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2133 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2134 prop = of_get_property(np, "vsync-polarity", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2135 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2136 config->in_params.vsync_polarity =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2137 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2138 prop = of_get_property(np, "clock-delay", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2139 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2140 config->in_params.clock_delay =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2141 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2142 vin_loaded = true;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2143 } else {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2144 pr_info("No video input configuration, using device default\n");
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2145 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2146
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2147 np = of_find_node_by_name(dn, "video-output");
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2148 if (np) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2149 prop = of_get_property(np, "hdmi-mode", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2150 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2151 if (be32_to_cpup(prop) == 1)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2152 config->out_params.hdmi_mode = true;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2153 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2154 prop = of_get_property(np, "output-format", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2155 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2156 config->out_params.output_format =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2157 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2158 prop = of_get_property(np, "output-color-space", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2159 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2160 config->out_params.output_color_space =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2161 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2162 prop = of_get_property(np, "up-conversion", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2163 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2164 config->out_params.up_conversion =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2165 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2166 prop = of_get_property(np, "csc-enable", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2167 if (prop)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2168 config->out_params.csc_enable =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2169 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2170 if (config->out_params.csc_enable) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2171 prop = of_get_property(np, "csc-scaling-factor", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2172 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2173 config->out_params.csc_scaling_factor =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2174 (uint8_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2175 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2176 np = of_find_node_by_name(dn, "csc-coefficients");
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2177 if (np) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2178 prop = of_get_property(np, "a1", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2179 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2180 config->out_params.csc_coeff.a1 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2181 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2182 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2183 prop = of_get_property(np, "a2", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2184 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2185 config->out_params.csc_coeff.a2 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2186 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2187 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2188 prop = of_get_property(np, "a3", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2189 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2190 config->out_params.csc_coeff.a3 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2191 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2192 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2193 prop = of_get_property(np, "a4", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2194 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2195 config->out_params.csc_coeff.a4 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2196 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2197 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2198 prop = of_get_property(np, "b1", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2199 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2200 config->out_params.csc_coeff.b1 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2201 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2202 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2203 prop = of_get_property(np, "b2", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2204 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2205 config->out_params.csc_coeff.b2 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2206 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2207 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2208 prop = of_get_property(np, "b3", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2209 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2210 config->out_params.csc_coeff.b3 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2211 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2212 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2213 prop = of_get_property(np, "b4", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2214 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2215 config->out_params.csc_coeff.b4 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2216 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2217 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2218 prop = of_get_property(np, "c1", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2219 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2220 config->out_params.csc_coeff.c1 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2221 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2222 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2223 prop = of_get_property(np, "c2", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2224 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2225 config->out_params.csc_coeff.c2 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2226 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2227 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2228 prop = of_get_property(np, "c3", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2229 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2230 config->out_params.csc_coeff.c3 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2231 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2232 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2233 prop = of_get_property(np, "c4", &size);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2234 if (prop) {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2235 config->out_params.csc_coeff.c4 =
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2236 (uint16_t)be32_to_cpup(prop);
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2237 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2238 } else {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2239 pr_info("No CSC coefficients, using default\n");
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2240 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2241 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2242 vout_loaded = true;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2243 } else {
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2244 pr_info("No video output configuration, using device default\n");
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2245 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2246
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2247 if (vin_loaded && vout_loaded)
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2248 config->loaded = true;
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2249 }
9836a252284b997a drivers/media/i2c/adv7511-v4l2.c Radhey Shyam Pandey 2014-01-15 2250
:::::: The code at line 2102 was first introduced by commit
:::::: 9836a252284b997aacd6b86766514a0bb84b4f43 drivers: media: Customized adv7511 for Xylon LogiCVC (deprecated)
:::::: TO: Radhey Shyam Pandey <radhey.shyam.pandey(a)xilinx.com>
:::::: CC: Michal Simek <michal.simek(a)xilinx.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
drivers/gpu/drm/i915/i915_sw_fence.c:41:20: error: unused function 'debug_fence_init_onstack'
by kernel test robot
Hi Masahiro,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 146620506274bd24d52fb1c589110a30eed8240b
commit: 6863f5643dd717376c2fdc85a47a00f9d738a834 kbuild: allow Clang to find unused static inline functions for W=1 build
date: 1 year, 4 months ago
config: x86_64-randconfig-a014-20210115 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6077d55381a6aa3e947ef7abdc36a7515c598c8a)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6863f5643dd717376c2fdc85a47a00f9d738a834
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/i915/i915_sw_fence.c:41:20: error: unused function 'debug_fence_init_onstack' [-Werror,-Wunused-function]
static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
^
1 error generated.
vim +/debug_fence_init_onstack +41 drivers/gpu/drm/i915/i915_sw_fence.c
fc1584059d6c438b Chris Wilson 2016-11-25 40
214707fc2ce08d09 Chris Wilson 2017-10-12 @41 static inline void debug_fence_init_onstack(struct i915_sw_fence *fence)
214707fc2ce08d09 Chris Wilson 2017-10-12 42 {
214707fc2ce08d09 Chris Wilson 2017-10-12 43 debug_object_init_on_stack(fence, &i915_sw_fence_debug_descr);
214707fc2ce08d09 Chris Wilson 2017-10-12 44 }
214707fc2ce08d09 Chris Wilson 2017-10-12 45
:::::: The code at line 41 was first introduced by commit
:::::: 214707fc2ce08d09982bc4fe4b7a1c1f010e82be drm/i915/selftests: Wrap a timer into a i915_sw_fence
:::::: TO: Chris Wilson <chris(a)chris-wilson.co.uk>
:::::: CC: Chris Wilson <chris(a)chris-wilson.co.uk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
[xlnx:xlnx_rebase_v5.4 942/1697] drivers/mtd/spi-nor/spi-nor.c:5196:14: error: implicit declaration of function 'of_get_next_parent'; did you mean
by kernel test robot
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head: 629150468791671b5fde21363e643e87c5815b17
commit: 24bcc7359bdd609cedf0a715d77dc39e4ad782db [942/1697] mtd: spi-nor: Added axi-qspi support in spi-nor framework
config: alpha-randconfig-s032-20210113 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://github.com/Xilinx/linux-xlnx/commit/24bcc7359bdd609cedf0a715d77dc...
git remote add xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xlnx xlnx_rebase_v5.4
git checkout 24bcc7359bdd609cedf0a715d77dc39e4ad782db
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_write_ear':
drivers/mtd/spi-nor/spi-nor.c:691:5: warning: variable 'code' set but not used [-Wunused-but-set-variable]
691 | u8 code;
| ^~~~
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_read':
drivers/mtd/spi-nor/spi-nor.c:2741:9: warning: variable 'addr' set but not used [-Wunused-but-set-variable]
2741 | loff_t addr = 0;
| ^~~~
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_set_addr_width':
>> drivers/mtd/spi-nor/spi-nor.c:5196:14: error: implicit declaration of function 'of_get_next_parent'; did you mean 'of_get_parent'? [-Werror=implicit-function-declaration]
5196 | np_spi = of_get_next_parent(np);
| ^~~~~~~~~~~~~~~~~~
| of_get_parent
>> drivers/mtd/spi-nor/spi-nor.c:5196:12: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
5196 | np_spi = of_get_next_parent(np);
| ^
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_get_flash_info':
drivers/mtd/spi-nor/spi-nor.c:5266:11: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
5266 | return jinfo;
| ^~~~~
drivers/mtd/spi-nor/spi-nor.c:5281:9: warning: return discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
5281 | return info;
| ^~~~
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_scan':
drivers/mtd/spi-nor/spi-nor.c:5295:6: warning: unused variable 'is_dual' [-Wunused-variable]
5295 | u32 is_dual;
| ^~~~~~~
drivers/mtd/spi-nor/spi-nor.c:5294:22: warning: unused variable 'np_spi' [-Wunused-variable]
5294 | struct device_node *np_spi;
| ^~~~~~
At top level:
drivers/mtd/spi-nor/spi-nor.c:781:12: warning: 'read_ear' defined but not used [-Wunused-function]
781 | static int read_ear(struct spi_nor *nor, struct flash_info *info)
| ^~~~~~~~
cc1: some warnings being treated as errors
vim +5196 drivers/mtd/spi-nor/spi-nor.c
5162
5163 static int spi_nor_set_addr_width(struct spi_nor *nor)
5164 {
5165 struct device_node *np = spi_nor_get_flash_node(nor);
5166 struct device_node *np_spi;
5167 if (nor->addr_width) {
5168 /* already configured from SFDP */
5169 } else if (nor->info->addr_width) {
5170 nor->addr_width = nor->info->addr_width;
5171 } else if (nor->mtd.size > 0x1000000) {
5172 #ifdef CONFIG_OF
5173 np_spi = of_get_next_parent(np);
5174 if (of_property_match_string(np_spi, "compatible",
5175 "xlnx,zynq-qspi-1.0") >= 0) {
5176 int status;
5177
5178 nor->addr_width = 3;
5179 nor->params.set_4byte(nor, false);
5180 status = read_ear(nor, (struct flash_info *)nor->info);
5181 if (status < 0)
5182 dev_warn(nor->dev, "failed to read ear reg\n");
5183 else
5184 nor->curbank = status & EAR_SEGMENT_MASK;
5185 } else {
5186 #endif
5187 /*
5188 * enable 4-byte addressing if the
5189 * device exceeds 16MiB
5190 */
5191 nor->addr_width = 4;
5192 if (JEDEC_MFR(nor->info) == SNOR_MFR_SPANSION ||
5193 nor->info->flags & SPI_NOR_4B_OPCODES) {
5194 spi_nor_set_4byte_opcodes(nor);
5195 } else {
> 5196 np_spi = of_get_next_parent(np);
5197 if (of_property_match_string(np_spi,
5198 "compatible",
5199 "xlnx,xps-spi-2.00.a") >= 0) {
5200 nor->addr_width = 3;
5201 nor->params.set_4byte(nor, false);
5202 } else {
5203 nor->params.set_4byte(nor, true);
5204 if (nor->isstacked) {
5205 nor->spi->master->flags |=
5206 SPI_MASTER_U_PAGE;
5207 nor->params.set_4byte(nor, true);
5208 nor->spi->master->flags &=
5209 ~SPI_MASTER_U_PAGE;
5210 }
5211 }
5212 }
5213 #ifdef CONFIG_OF
5214 }
5215 #endif
5216 } else {
5217 nor->addr_width = 3;
5218 }
5219
5220 if (nor->addr_width > SPI_NOR_MAX_ADDR_WIDTH) {
5221 dev_err(nor->dev, "address width is too large: %u\n",
5222 nor->addr_width);
5223 return -EINVAL;
5224 }
5225
5226 /* Set 4byte opcodes when possible. */
5227 if (nor->addr_width == 4 && nor->flags & SNOR_F_4B_OPCODES &&
5228 !(nor->flags & SNOR_F_HAS_4BAIT))
5229 spi_nor_set_4byte_opcodes(nor);
5230
5231 return 0;
5232 }
5233
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:154:34: sparse: sparse: incorrect type in assignment (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: 0cd1ad2d7fd41e0de4969fd1dd0aa846c99830d1 iwlwifi: move all bus-independent TX functions to common code
date: 4 months ago
config: i386-randconfig-s002-20210115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-208-g46a52ca4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0cd1ad2d7fd41e0de4969fd1dd0aa846c99830d1
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/net/wireless/intel/iwlwifi/iwl-trans.c: note: in included file (through drivers/net/wireless/intel/iwlwifi/fw/img.h, drivers/net/wireless/intel/iwlwifi/iwl-trans.h):
drivers/net/wireless/intel/iwlwifi/fw/file.h:330:19: sparse: sparse: mixed bitwiseness
drivers/net/wireless/intel/iwlwifi/fw/file.h:485:19: sparse: sparse: mixed bitwiseness
drivers/net/wireless/intel/iwlwifi/iwl-trans.c: note: in included file:
drivers/net/wireless/intel/iwlwifi/iwl-trans.h:788:52: sparse: sparse: array of flexible structures
>> drivers/net/wireless/intel/iwlwifi/iwl-trans.c:154:34: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct iwl_tso_hdr_page *tso_hdr_page @@ got struct iwl_tso_hdr_page [noderef] __percpu * @@
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:154:34: sparse: expected struct iwl_tso_hdr_page *tso_hdr_page
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:154:34: sparse: got struct iwl_tso_hdr_page [noderef] __percpu *
>> drivers/net/wireless/intel/iwlwifi/iwl-trans.c:169:25: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct iwl_tso_hdr_page * @@
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:169:25: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:169:25: sparse: got struct iwl_tso_hdr_page *
>> drivers/net/wireless/intel/iwlwifi/iwl-trans.c:175:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got struct iwl_tso_hdr_page *tso_hdr_page @@
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:175:32: sparse: expected void [noderef] __percpu *__pdata
drivers/net/wireless/intel/iwlwifi/iwl-trans.c:175:32: sparse: got struct iwl_tso_hdr_page *tso_hdr_page
--
drivers/net/wireless/intel/iwlwifi/queue/tx.c: note: in included file (through drivers/net/wireless/intel/iwlwifi/fw/img.h, drivers/net/wireless/intel/iwlwifi/iwl-trans.h, ...):
drivers/net/wireless/intel/iwlwifi/fw/file.h:330:19: sparse: sparse: mixed bitwiseness
drivers/net/wireless/intel/iwlwifi/fw/file.h:485:19: sparse: sparse: mixed bitwiseness
drivers/net/wireless/intel/iwlwifi/queue/tx.c: note: in included file (through drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h, drivers/net/wireless/intel/iwlwifi/iwl-io.h):
drivers/net/wireless/intel/iwlwifi/iwl-trans.h:788:52: sparse: sparse: array of flexible structures
>> drivers/net/wireless/intel/iwlwifi/queue/tx.c:354:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct iwl_tso_hdr_page * @@
drivers/net/wireless/intel/iwlwifi/queue/tx.c:354:38: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/net/wireless/intel/iwlwifi/queue/tx.c:354:38: sparse: got struct iwl_tso_hdr_page *
vim +154 drivers/net/wireless/intel/iwlwifi/iwl-trans.c
110
111 trans->dev = dev;
112 trans->ops = ops;
113 trans->num_rx_queues = 1;
114
115 if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
116 trans->txqs.bc_tbl_size = sizeof(struct iwl_gen3_bc_tbl);
117 else
118 trans->txqs.bc_tbl_size = sizeof(struct iwlagn_scd_bc_tbl);
119 /*
120 * For gen2 devices, we use a single allocation for each byte-count
121 * table, but they're pretty small (1k) so use a DMA pool that we
122 * allocate here.
123 */
124 if (trans->trans_cfg->gen2) {
125 trans->txqs.bc_pool = dmam_pool_create("iwlwifi:bc", dev,
126 trans->txqs.bc_tbl_size,
127 256, 0);
128 if (!trans->txqs.bc_pool)
129 return NULL;
130 }
131
132 if (trans->trans_cfg->use_tfh) {
133 trans->txqs.tfd.addr_size = 64;
134 trans->txqs.tfd.max_tbs = IWL_TFH_NUM_TBS;
135 trans->txqs.tfd.size = sizeof(struct iwl_tfh_tfd);
136 } else {
137 trans->txqs.tfd.addr_size = 36;
138 trans->txqs.tfd.max_tbs = IWL_NUM_OF_TBS;
139 trans->txqs.tfd.size = sizeof(struct iwl_tfd);
140 }
141 trans->max_skb_frags = IWL_TRANS_MAX_FRAGS(trans);
142
143 snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name),
144 "iwl_cmd_pool:%s", dev_name(trans->dev));
145 trans->dev_cmd_pool =
146 kmem_cache_create(trans->dev_cmd_pool_name,
147 txcmd_size, txcmd_align,
148 SLAB_HWCACHE_ALIGN, NULL);
149 if (!trans->dev_cmd_pool)
150 return NULL;
151
152 WARN_ON(!ops->wait_txq_empty && !ops->wait_tx_queues_empty);
153
> 154 trans->txqs.tso_hdr_page = alloc_percpu(struct iwl_tso_hdr_page);
155 if (!trans->txqs.tso_hdr_page) {
156 kmem_cache_destroy(trans->dev_cmd_pool);
157 return NULL;
158 }
159
160 return trans;
161 }
162
163 void iwl_trans_free(struct iwl_trans *trans)
164 {
165 int i;
166
167 for_each_possible_cpu(i) {
168 struct iwl_tso_hdr_page *p =
> 169 per_cpu_ptr(trans->txqs.tso_hdr_page, i);
170
171 if (p->page)
172 __free_page(p->page);
173 }
174
> 175 free_percpu(trans->txqs.tso_hdr_page);
176
177 kmem_cache_destroy(trans->dev_cmd_pool);
178 }
179
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
Re: [PATCH net-next] net: marvell: prestera: fix uninitialized vid in prestera_port_vlans_add
by Taras Chornyi [C]
________________________________________
From: Vladimir Oltean <olteanv(a)gmail.com>
Sent: Thursday, January 14, 2021 10:35 AM
To: David S. Miller; Jakub Kicinski; netdev(a)vger.kernel.org
Cc: Florian Fainelli; Kurt Kanzenbach; Vadym Kochan [C]; Taras Chornyi [C]; Ido Schimmel; clang-built-linux(a)googlegroups.com; linux-mm(a)kvack.org; kbuild-all(a)lists.01.org
Subject: [PATCH net-next] net: marvell: prestera: fix uninitialized vid in prestera_port_vlans_add
----------------------------------------------------------------------
From: Vladimir Oltean <vladimir.oltean(a)nxp.com>
prestera_bridge_port_vlan_add should have been called with vlan->vid,
however this was masked by the presence of the local vid variable and I
did not notice the build warning.
Reported-by: kernel test robot <lkp(a)intel.com>
Fixes: b7a9e0da2d1c ("net: switchdev: remove vid_begin -> vid_end range from VLAN objects")
Signed-off-by: Vladimir Oltean <vladimir.oltean(a)nxp.com>
---
drivers/net/ethernet/marvell/prestera/prestera_switchdev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c
index beb6447fbe40..8c2b03151736 100644
--- a/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c
+++ b/drivers/net/ethernet/marvell/prestera/prestera_switchdev.c
@@ -1007,7 +1007,6 @@ static int prestera_port_vlans_add(struct prestera_port *port,
struct prestera_bridge_port *br_port;
struct prestera_switch *sw = port->sw;
struct prestera_bridge *bridge;
- u16 vid;
if (netif_is_bridge_master(dev))
return 0;
@@ -1021,7 +1020,7 @@ static int prestera_port_vlans_add(struct prestera_port *port,
return 0;
return prestera_bridge_port_vlan_add(port, br_port,
- vid, flag_untagged,
+ vlan->vid, flag_untagged,
flag_pvid, extack);
}
--
2.25.1
Reviewed-by: Taras Chornyi <tchornyi(a)marvell.com>
1 year, 8 months
drivers/media/test-drivers/vidtv/vidtv_psi.c:1778:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_eit_event' may result in an unaligned pointer value
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: 7a7899f6f58e3270ccfd200ee63ebced5ddba3c9 media: vidtv: psi: Implement an Event Information Table (EIT)
date: 7 weeks ago
config: mips-randconfig-r026-20210114 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 68ff52ffead2ba25cca442778ab19286000daad7)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7a7899f6f58e3270ccfd200ee63ebced5ddba3c9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
return xchg(&v->counter, n); \
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:257:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic, int, subu, ll, sc)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:261:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic64, s64, dsubu, lld, scd)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:15:
In file included from include/linux/smp_types.h:5:
include/linux/llist.h:222:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&head->first, NULL);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:27:
include/linux/debug_locks.h:17:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&debug_locks, 0);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
drivers/media/test-drivers/vidtv/vidtv_psi.c:850:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&pmt->bitfield2, desc_loop_len, 10);
^~~~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:861:32: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&s->bitfield2, desc_loop_len, 10);
^~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:893:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&s->bitfield, desc_loop_len, 12);
^~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:1556:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
^~~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:1571:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_transport' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
^~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:1579:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
^~~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1778:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_eit_event' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&e->bitfield, desc_loop_len, 12);
^~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:93:19: warning: unused function 'vidtv_psi_sdt_serv_get_desc_loop_len' [-Wunused-function]
static inline u16 vidtv_psi_sdt_serv_get_desc_loop_len(struct vidtv_psi_table_sdt_service *s)
^
drivers/media/test-drivers/vidtv/vidtv_psi.c:104:19: warning: unused function 'vidtv_psi_pmt_stream_get_desc_loop_len' [-Wunused-function]
static inline u16 vidtv_psi_pmt_stream_get_desc_loop_len(struct vidtv_psi_table_pmt_stream *s)
^
drivers/media/test-drivers/vidtv/vidtv_psi.c:115:19: warning: unused function 'vidtv_psi_pmt_get_desc_loop_len' [-Wunused-function]
static inline u16 vidtv_psi_pmt_get_desc_loop_len(struct vidtv_psi_table_pmt *p)
^
20 warnings generated.
--
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_channel.c:23:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:52:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
arch/mips/include/asm/atomic.h:45:9: note: expanded from macro 'ATOMIC_OPS'
return xchg(&v->counter, n); \
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_channel.c:23:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:257:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic, int, subu, ll, sc)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_channel.c:23:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:261:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic64, s64, dsubu, lld, scd)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_channel.c:23:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:15:
In file included from include/linux/smp_types.h:5:
include/linux/llist.h:222:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&head->first, NULL);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_channel.c:23:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:27:
include/linux/debug_locks.h:17:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&debug_locks, 0);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
>> drivers/media/test-drivers/vidtv/vidtv_channel.c:147:27: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_eit_event' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_desc_assign(&tail->descriptor, desc);
^~~~~~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_channel.c:192:27: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_desc_assign(&tail->descriptor, desc);
^~~~~~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_channel.c:292:29: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_desc_assign(&tail->descriptor, desc);
^~~~~~~~~~~~~~~~
13 warnings generated.
vim +1778 drivers/media/test-drivers/vidtv/vidtv_psi.c
1758
1759 void vidtv_psi_eit_table_update_sec_len(struct vidtv_psi_table_eit *eit)
1760 {
1761 u16 length = 0;
1762 struct vidtv_psi_table_eit_event *e = eit->event;
1763 u16 desc_loop_len;
1764
1765 /*
1766 * from immediately after 'section_length' until
1767 * 'last_table_id'
1768 */
1769 length += EIT_LEN_UNTIL_LAST_TABLE_ID;
1770
1771 while (e) {
1772 /* skip both pointers at the end */
1773 length += sizeof(struct vidtv_psi_table_eit_event) -
1774 sizeof(struct vidtv_psi_desc *) -
1775 sizeof(struct vidtv_psi_table_eit_event *);
1776
1777 desc_loop_len = vidtv_psi_desc_comp_loop_len(e->descriptor);
> 1778 vidtv_psi_set_desc_loop_len(&e->bitfield, desc_loop_len, 12);
1779
1780 length += desc_loop_len;
1781
1782 e = e->next;
1783 }
1784
1785 length += CRC_SIZE_IN_BYTES;
1786
1787 vidtv_psi_set_sec_len(&eit->header, length);
1788 }
1789
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
drivers/media/test-drivers/vidtv/vidtv_psi.c:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da media: vidtv: psi: add a Network Information Table (NIT)
date: 7 weeks ago
config: mips-randconfig-r026-20210114 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 68ff52ffead2ba25cca442778ab19286000daad7)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:52:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
arch/mips/include/asm/atomic.h:45:9: note: expanded from macro 'ATOMIC_OPS'
return xchg(&v->counter, n); \
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:257:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic, int, subu, ll, sc)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:51:
In file included from include/linux/preempt.h:78:
In file included from ./arch/mips/include/generated/asm/preempt.h:1:
In file included from include/asm-generic/preempt.h:5:
In file included from include/linux/thread_info.h:38:
In file included from arch/mips/include/asm/thread_info.h:16:
In file included from arch/mips/include/asm/processor.h:14:
In file included from include/linux/atomic.h:7:
arch/mips/include/asm/atomic.h:261:1: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
ATOMIC_SIP_OP(atomic64, s64, dsubu, lld, scd)
^
arch/mips/include/asm/atomic.h:251:7: note: expanded from macro 'ATOMIC_SIP_OP'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:14:
In file included from include/linux/smp.h:15:
In file included from include/linux/smp_types.h:5:
include/linux/llist.h:222:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&head->first, NULL);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
In file included from drivers/media/test-drivers/vidtv/vidtv_psi.c:16:
In file included from include/linux/slab.h:15:
In file included from include/linux/gfp.h:6:
In file included from include/linux/mmzone.h:8:
In file included from include/linux/spinlock.h:59:
In file included from include/linux/lockdep.h:27:
include/linux/debug_locks.h:17:9: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
return xchg(&debug_locks, 0);
^
arch/mips/include/asm/cmpxchg.h:102:7: note: expanded from macro 'xchg'
if (!__SYNC_loongson3_war) \
^
arch/mips/include/asm/sync.h:147:34: note: expanded from macro '__SYNC_loongson3_war'
# define __SYNC_loongson3_war (1 << 31)
^
drivers/media/test-drivers/vidtv/vidtv_psi.c:753:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&pmt->bitfield2, desc_loop_len, 10);
^~~~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:764:32: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&s->bitfield2, desc_loop_len, 10);
^~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:796:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&s->bitfield, desc_loop_len, 12);
^~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
^~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1472:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_transport' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
^~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1480:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
^~~~~~~~~~~~~~
drivers/media/test-drivers/vidtv/vidtv_psi.c:92:19: warning: unused function 'vidtv_psi_sdt_serv_get_desc_loop_len' [-Wunused-function]
static inline u16 vidtv_psi_sdt_serv_get_desc_loop_len(struct vidtv_psi_table_sdt_service *s)
^
drivers/media/test-drivers/vidtv/vidtv_psi.c:103:19: warning: unused function 'vidtv_psi_pmt_stream_get_desc_loop_len' [-Wunused-function]
static inline u16 vidtv_psi_pmt_stream_get_desc_loop_len(struct vidtv_psi_table_pmt_stream *s)
^
drivers/media/test-drivers/vidtv/vidtv_psi.c:114:19: warning: unused function 'vidtv_psi_pmt_get_desc_loop_len' [-Wunused-function]
static inline u16 vidtv_psi_pmt_get_desc_loop_len(struct vidtv_psi_table_pmt *p)
^
19 warnings generated.
vim +1457 drivers/media/test-drivers/vidtv/vidtv_psi.c
1442
1443 static void vidtv_psi_nit_table_update_sec_len(struct vidtv_psi_table_nit *nit)
1444 {
1445 u16 length = 0;
1446 struct vidtv_psi_table_transport *t = nit->transport;
1447 u16 desc_loop_len;
1448 u16 transport_loop_len = 0;
1449
1450 /*
1451 * from immediately after 'section_length' until
1452 * 'network_descriptor_length'
1453 */
1454 length += NIT_LEN_UNTIL_NETWORK_DESCRIPTOR_LEN;
1455
1456 desc_loop_len = vidtv_psi_desc_comp_loop_len(nit->descriptor);
> 1457 vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
1458
1459 length += desc_loop_len;
1460
1461 length += sizeof_field(struct vidtv_psi_table_nit, bitfield2);
1462
1463 while (t) {
1464 /* skip both pointers at the end */
1465 transport_loop_len += sizeof(struct vidtv_psi_table_transport) -
1466 sizeof(struct vidtv_psi_desc *) -
1467 sizeof(struct vidtv_psi_table_transport *);
1468
1469 length += transport_loop_len;
1470
1471 desc_loop_len = vidtv_psi_desc_comp_loop_len(t->descriptor);
> 1472 vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
1473
1474 length += desc_loop_len;
1475
1476 t = t->next;
1477 }
1478
1479 // Actually sets the transport stream loop len, maybe rename this function later
> 1480 vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
1481 length += CRC_SIZE_IN_BYTES;
1482
1483 vidtv_psi_set_sec_len(&nit->header, length);
1484 }
1485
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months
Re: [PATCH v2 2/2] clk: mvebu: use firmware SiP service for accessing dfx register set
by kernel test robot
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on clk/clk-next]
[also build test ERROR on linus/master v5.11-rc3 next-20210114]
[cannot apply to thermal/next soc-thermal/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/kostap-marvell-com/Enable-usage-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/8dc917b26b54d723831b58c1f166a15a1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review kostap-marvell-com/Enable-usage-of-Marvell-FW-SIP-services/20210114-183207
git checkout 8dc917b26b54d723831b58c1f166a15a1b7d28e2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/regmap.h:20,
from drivers/clk/mvebu/ap-cpu-clk.c:21:
drivers/clk/mvebu/ap-cpu-clk.c: In function 'legacy_regmap_read_poll_timeout':
>> drivers/clk/mvebu/ap-cpu-clk.c:252:11: error: 'val' undeclared (first use in this function)
252 | reg, val,
| ^~~
include/linux/iopoll.h:46:14: note: in definition of macro 'read_poll_timeout'
46 | (val) = op(args); \
| ^~~~
drivers/clk/mvebu/ap-cpu-clk.c:251:9: note: in expansion of macro 'regmap_read_poll_timeout'
251 | return regmap_read_poll_timeout(clk->pll_cr_base,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/mvebu/ap-cpu-clk.c:252:11: note: each undeclared identifier is reported only once for each function it appears in
252 | reg, val,
| ^~~
include/linux/iopoll.h:46:14: note: in definition of macro 'read_poll_timeout'
46 | (val) = op(args); \
| ^~~~
drivers/clk/mvebu/ap-cpu-clk.c:251:9: note: in expansion of macro 'regmap_read_poll_timeout'
251 | return regmap_read_poll_timeout(clk->pll_cr_base,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/clk/mvebu/ap-cpu-clk.c: In function 'ap_cpu_clk_set_rate':
>> drivers/clk/mvebu/ap-cpu-clk.c:313:20: error: macro "regmap_read_poll_timeout" requires 6 arguments, but only 3 given
313 | stable_bit);
| ^
In file included from drivers/clk/mvebu/ap-cpu-clk.c:21:
include/linux/regmap.h:103: note: macro "regmap_read_poll_timeout" defined here
103 | #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
|
drivers/clk/mvebu/ap-cpu-clk.c:311:6: warning: assignment to 'int' from 'int (*)(struct ap_cpu_clk *, unsigned int, unsigned int)' makes integer from pointer without a cast [-Wint-conversion]
311 | ret = clk->regmap_read_poll_timeout(clk,
| ^
drivers/clk/mvebu/ap-cpu-clk.c:277:61: warning: variable 'stable_bit' set but not used [-Wunused-but-set-variable]
277 | unsigned int cpu_clkdiv_reg, cpu_force_reg, cpu_ratio_reg, stable_bit;
| ^~~~~~~~~~
drivers/clk/mvebu/ap-cpu-clk.c: In function 'ap_cpu_clock_probe':
>> drivers/clk/mvebu/ap-cpu-clk.c:440:30: error: 'struct ap_cpu_clk' has no member named 'regmap_wriite'; did you mean 'regmap_write'?
440 | ap_cpu_clk[cluster_index].regmap_wriite = smc_regmap_write;
| ^~~~~~~~~~~~~
| regmap_write
drivers/clk/mvebu/ap-cpu-clk.c:446:30: error: 'struct ap_cpu_clk' has no member named 'regmap_wriite'; did you mean 'regmap_write'?
446 | ap_cpu_clk[cluster_index].regmap_wriite = legacy_regmap_write;
| ^~~~~~~~~~~~~
| regmap_write
drivers/clk/mvebu/ap-cpu-clk.c: In function 'smc_regmap_read_poll_timeout':
drivers/clk/mvebu/ap-cpu-clk.c:245:1: error: control reaches end of non-void function [-Werror=return-type]
245 | }
| ^
cc1: some warnings being treated as errors
vim +/val +252 drivers/clk/mvebu/ap-cpu-clk.c
246
247 static int legacy_regmap_read_poll_timeout(struct ap_cpu_clk *clk,
248 unsigned int reg,
249 unsigned int stable_bit)
250 {
> 251 return regmap_read_poll_timeout(clk->pll_cr_base,
> 252 reg, val,
253 val & stable_bit, STATUS_POLL_PERIOD_US,
254 STATUS_POLL_TIMEOUT_US);
255 }
256 static unsigned long ap_cpu_clk_recalc_rate(struct clk_hw *hw,
257 unsigned long parent_rate)
258 {
259 struct ap_cpu_clk *clk = to_ap_cpu_clk(hw);
260 unsigned int cpu_clkdiv_reg;
261 int cpu_clkdiv_ratio;
262
263 cpu_clkdiv_reg = clk->pll_regs->divider_reg +
264 (clk->cluster * clk->pll_regs->cluster_offset);
265 clk->regmap_read(clk, cpu_clkdiv_reg, &cpu_clkdiv_ratio);
266 cpu_clkdiv_ratio &= clk->pll_regs->divider_mask;
267 cpu_clkdiv_ratio >>= clk->pll_regs->divider_offset;
268
269 return parent_rate / cpu_clkdiv_ratio;
270 }
271
272 static int ap_cpu_clk_set_rate(struct clk_hw *hw, unsigned long rate,
273 unsigned long parent_rate)
274 {
275 struct ap_cpu_clk *clk = to_ap_cpu_clk(hw);
276 int ret, reg, divider = parent_rate / rate;
277 unsigned int cpu_clkdiv_reg, cpu_force_reg, cpu_ratio_reg, stable_bit;
278
279 cpu_clkdiv_reg = clk->pll_regs->divider_reg +
280 (clk->cluster * clk->pll_regs->cluster_offset);
281 cpu_force_reg = clk->pll_regs->force_reg +
282 (clk->cluster * clk->pll_regs->cluster_offset);
283 cpu_ratio_reg = clk->pll_regs->ratio_reg +
284 (clk->cluster * clk->pll_regs->cluster_offset);
285
286 clk->regmap_read(clk, cpu_clkdiv_reg, ®);
287 reg &= ~(clk->pll_regs->divider_mask);
288 reg |= (divider << clk->pll_regs->divider_offset);
289
290 /*
291 * AP807 CPU divider has two channels with ratio 1:3 and divider_ratio
292 * is 1. Otherwise, in the case of the AP806, divider_ratio is 0.
293 */
294 if (clk->pll_regs->divider_ratio) {
295 reg &= ~(AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_MASK);
296 reg |= ((divider * clk->pll_regs->divider_ratio) <<
297 AP807_PLL_CR_1_CPU_CLK_DIV_RATIO_OFFSET);
298 }
299 clk->regmap_write(clk, cpu_clkdiv_reg, reg);
300
301 clk->regmap_update_bits(clk, cpu_force_reg, clk->pll_regs->force_mask,
302 clk->pll_regs->force_mask);
303
304 clk->regmap_update_bits(clk, cpu_ratio_reg,
305 BIT(clk->pll_regs->ratio_offset),
306 BIT(clk->pll_regs->ratio_offset));
307
308 stable_bit = BIT(clk->pll_regs->ratio_state_offset +
309 clk->cluster *
310 clk->pll_regs->ratio_state_cluster_offset);
> 311 ret = clk->regmap_read_poll_timeout(clk,
312 clk->pll_regs->ratio_state_reg,
> 313 stable_bit);
314 if (ret)
315 return ret;
316
317 clk->regmap_update_bits(clk, cpu_ratio_reg,
318 BIT(clk->pll_regs->ratio_offset), 0);
319
320 return 0;
321 }
322
323 static long ap_cpu_clk_round_rate(struct clk_hw *hw, unsigned long rate,
324 unsigned long *parent_rate)
325 {
326 int divider = *parent_rate / rate;
327
328 divider = min(divider, APN806_MAX_DIVIDER);
329
330 return *parent_rate / divider;
331 }
332
333 static const struct clk_ops ap_cpu_clk_ops = {
334 .recalc_rate = ap_cpu_clk_recalc_rate,
335 .round_rate = ap_cpu_clk_round_rate,
336 .set_rate = ap_cpu_clk_set_rate,
337 };
338
339 static int ap_cpu_clock_probe(struct platform_device *pdev)
340 {
341 int ret, nclusters = 0, cluster_index = 0;
342 struct device *dev = &pdev->dev;
343 struct device_node *dn, *np = dev->of_node;
344 struct clk_hw_onecell_data *ap_cpu_data;
345 struct ap_cpu_clk *ap_cpu_clk;
346 struct regmap *regmap;
347 struct resource res;
348
349 ret = of_address_to_resource(np->parent, 0, &res);
350 if (ret)
351 return ret;
352
353 regmap = syscon_node_to_regmap(np->parent);
354 if (IS_ERR(regmap)) {
355 pr_err("cannot get pll_cr_base regmap\n");
356 return PTR_ERR(regmap);
357 }
358
359 /*
360 * AP806 has 4 cpus and DFS for AP806 is controlled per
361 * cluster (2 CPUs per cluster), cpu0 and cpu1 are fixed to
362 * cluster0 while cpu2 and cpu3 are fixed to cluster1 whether
363 * they are enabled or not. Since cpu0 is the boot cpu, then
364 * cluster0 must exist. If cpu2 or cpu3 is enabled, cluster1
365 * will exist and the cluster number is 2; otherwise the
366 * cluster number is 1.
367 */
368 nclusters = 1;
369 for_each_of_cpu_node(dn) {
370 int cpu, err;
371
372 err = of_property_read_u32(dn, "reg", &cpu);
373 if (WARN_ON(err))
374 return err;
375
376 /* If cpu2 or cpu3 is enabled */
377 if (cpu & APN806_CLUSTER_NUM_MASK) {
378 nclusters = 2;
379 break;
380 }
381 }
382 /*
383 * DFS for AP806 is controlled per cluster (2 CPUs per cluster),
384 * so allocate structs per cluster
385 */
386 ap_cpu_clk = devm_kcalloc(dev, nclusters, sizeof(*ap_cpu_clk),
387 GFP_KERNEL);
388 if (!ap_cpu_clk)
389 return -ENOMEM;
390
391 ap_cpu_data = devm_kzalloc(dev, struct_size(ap_cpu_data, hws,
392 nclusters),
393 GFP_KERNEL);
394 if (!ap_cpu_data)
395 return -ENOMEM;
396
397 for_each_of_cpu_node(dn) {
398 char *clk_name = "cpu-cluster-0";
399 struct clk_init_data init;
400 const char *parent_name;
401 struct clk *parent;
402 int cpu, err;
403 unsigned int tmp;
404
405 err = of_property_read_u32(dn, "reg", &cpu);
406 if (WARN_ON(err))
407 return err;
408
409 cluster_index = cpu & APN806_CLUSTER_NUM_MASK;
410 cluster_index >>= APN806_CLUSTER_NUM_OFFSET;
411
412 /* Initialize once for one cluster */
413 if (ap_cpu_data->hws[cluster_index])
414 continue;
415
416 parent = of_clk_get(np, cluster_index);
417 if (IS_ERR(parent)) {
418 dev_err(dev, "Could not get the clock parent\n");
419 return -EINVAL;
420 }
421 parent_name = __clk_get_name(parent);
422 clk_name[12] += cluster_index;
423 ap_cpu_clk[cluster_index].clk_name =
424 ap_cp_unique_name(dev, np->parent, clk_name);
425 ap_cpu_clk[cluster_index].cluster = cluster_index;
426 ap_cpu_clk[cluster_index].pll_cr_base = regmap;
427 ap_cpu_clk[cluster_index].hw.init = &init;
428 ap_cpu_clk[cluster_index].dev = dev;
429 ap_cpu_clk[cluster_index].pll_regs = of_device_get_match_data(&pdev->dev);
430
431 /* Get the physical address to hand to the firmware. */
432 ap_cpu_clk[cluster_index].phys = res.start;
433
434 /* Try to read a register using SMC and setup DFX access APIs accordingly */
435 ret = smc_regmap_read(&ap_cpu_clk[cluster_index],
436 ap_cpu_clk[cluster_index].pll_regs->divider_reg,
437 &tmp);
438 if (ret == SMCCC_RET_SUCCESS) {
439 ap_cpu_clk[cluster_index].regmap_read = smc_regmap_read;
> 440 ap_cpu_clk[cluster_index].regmap_wriite = smc_regmap_write;
441 ap_cpu_clk[cluster_index].regmap_update_bits = smc_regmap_update_bits;
442 ap_cpu_clk[cluster_index].regmap_read_poll_timeout =
443 smc_regmap_read_poll_timeout;
444 } else {
445 ap_cpu_clk[cluster_index].regmap_read = legacy_regmap_read;
446 ap_cpu_clk[cluster_index].regmap_wriite = legacy_regmap_write;
447 ap_cpu_clk[cluster_index].regmap_update_bits = legacy_regmap_update_bits;
448 ap_cpu_clk[cluster_index].regmap_read_poll_timeout =
449 legacy_regmap_read_poll_timeout;
450 }
451
452 init.name = ap_cpu_clk[cluster_index].clk_name;
453 init.ops = &ap_cpu_clk_ops;
454 init.num_parents = 1;
455 init.parent_names = &parent_name;
456
457 ret = devm_clk_hw_register(dev, &ap_cpu_clk[cluster_index].hw);
458 if (ret)
459 return ret;
460 ap_cpu_data->hws[cluster_index] = &ap_cpu_clk[cluster_index].hw;
461 }
462
463 ap_cpu_data->num = cluster_index + 1;
464
465 ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, ap_cpu_data);
466 if (ret)
467 dev_err(dev, "failed to register OF clock provider\n");
468
469 return ret;
470 }
471
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 8 months