linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/iio/dac/ad5766.c:109:8: warning: Excessive padding in 'struct ad5766_state' (44 padding bytes, where 12 is optimal). Optimal fields order: data, spi, chip_info, gpio_reset, crt_range, dither_source, dither_scale, lock, dither_enable, dither_invert...
@ 2022-07-19 17:46 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-07-19 17:46 UTC (permalink / raw)
  To: Cristian Pop; +Cc: llvm, kbuild-all, linux-kernel, Jonathan Cameron

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ca85855bdcae8f84f1512e88b4c75009ea17ea2f
commit: fd9373e41b9ba5b609f97e98a04687f4ff136aff iio: dac: ad5766: add driver support for AD5766
date:   1 year, 6 months ago
config: arm-randconfig-c002-20220718 (https://download.01.org/0day-ci/archive/20220720/202207200100.AsG8AClR-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d74b88c69dc2644bd0dc5d64e2d7413a0d4040e5)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fd9373e41b9ba5b609f97e98a04687f4ff136aff
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout fd9373e41b9ba5b609f97e98a04687f4ff136aff
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer 

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   Suppressed 1 warnings (1 with check filters).
   18 warnings generated.
   drivers/media/tuners/mxl5005s.c:2668:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2668:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2669:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2669:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2677:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2677:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2678:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2678:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2686:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2686:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2687:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2687:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2695:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2695:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2696:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2696:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2704:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2704:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2705:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2705:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2713:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2713:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2714:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2714:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2722:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2722:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2723:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2723:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2731:3: warning: Value stored to 'Fmax' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2731:3: note: Value stored to 'Fmax' is never read
                   Fmax = FmaxBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2732:3: warning: Value stored to 'Fmin' is never read [clang-analyzer-deadcode.DeadStores]
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   drivers/media/tuners/mxl5005s.c:2732:3: note: Value stored to 'Fmin' is never read
                   Fmin = FminBin ;
                   ^      ~~~~~~~
   Suppressed 2 warnings (2 with check filters).
   1 warning generated.
>> drivers/iio/dac/ad5766.c:109:8: warning: Excessive padding in 'struct ad5766_state' (44 padding bytes, where 12 is optimal). Optimal fields order: data, spi, chip_info, gpio_reset, crt_range, dither_source, dither_scale, lock, dither_enable, dither_invert, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct ad5766_state {
   ~~~~~~~^~~~~~~~~~~~~~
   drivers/iio/dac/ad5766.c:109:8: note: Excessive padding in 'struct ad5766_state' (44 padding bytes, where 12 is optimal). Optimal fields order: data, spi, chip_info, gpio_reset, crt_range, dither_source, dither_scale, lock, dither_enable, dither_invert, consider reordering the fields or adding explicit padding members
   struct ad5766_state {
   ~~~~~~~^~~~~~~~~~~~~~
   2 warnings generated.
   drivers/iio/dac/ad5770r.c:133:8: warning: Excessive padding in 'struct ad5770r_state' (54 padding bytes, where 22 is optimal). Optimal fields order: transf_buf, internal_ref, external_res, spi, regmap, vref_reg, gpio_reset, vref, ch_pwr_down, output_mode, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding]
   struct ad5770r_state {
   ~~~~~~~^~~~~~~~~~~~~~~
   drivers/iio/dac/ad5770r.c:133:8: note: Excessive padding in 'struct ad5770r_state' (54 padding bytes, where 22 is optimal). Optimal fields order: transf_buf, internal_ref, external_res, spi, regmap, vref_reg, gpio_reset, vref, ch_pwr_down, output_mode, consider reordering the fields or adding explicit padding members
   struct ad5770r_state {
   ~~~~~~~^~~~~~~~~~~~~~~
   drivers/iio/dac/ad5770r.c:544:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
           return ret;
           ^
   drivers/iio/dac/ad5770r.c:609:6: note: Assuming 'indio_dev' is non-null
           if (!indio_dev)
               ^~~~~~~~~~
   drivers/iio/dac/ad5770r.c:609:2: note: Taking false branch
           if (!indio_dev)
           ^
   drivers/iio/dac/ad5770r.c:618:2: note: Taking false branch
           if (IS_ERR(regmap)) {
           ^
   drivers/iio/dac/ad5770r.c:626:2: note: Taking false branch
           if (!IS_ERR(st->vref_reg)) {
           ^
   drivers/iio/dac/ad5770r.c:646:7: note: Assuming the condition is true
                   if (PTR_ERR(st->vref_reg) == -ENODEV) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad5770r.c:646:3: note: Taking true branch
                   if (PTR_ERR(st->vref_reg) == -ENODEV) {
                   ^
   drivers/iio/dac/ad5770r.c:660:8: note: Calling 'ad5770r_init'
           ret = ad5770r_init(st);
                 ^~~~~~~~~~~~~~~~
   drivers/iio/dac/ad5770r.c:553:2: note: Taking false branch
           if (IS_ERR(st->gpio_reset))
           ^
   drivers/iio/dac/ad5770r.c:558:6: note: 'ret' is 0
           if (ret)
               ^~~
   drivers/iio/dac/ad5770r.c:558:2: note: Taking false branch
           if (ret)
           ^
   drivers/iio/dac/ad5770r.c:562:8: note: Calling 'ad5770r_channel_config'
           ret = ad5770r_channel_config(st);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad5770r.c:516:6: note: 'ret' declared without an initial value
           int ret, tmp[2], min, max;
               ^~~
   drivers/iio/dac/ad5770r.c:521:6: note: Assuming 'num' is equal to AD5770R_MAX_CHANNELS
           if (num != AD5770R_MAX_CHANNELS)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/iio/dac/ad5770r.c:521:2: note: Taking false branch
           if (num != AD5770R_MAX_CHANNELS)
           ^
   drivers/iio/dac/ad5770r.c:524:2: note: Loop condition is false. Execution continues on line 544
           device_for_each_child_node(&st->spi->dev, child) {
           ^
   include/linux/property.h:111:2: note: expanded from macro 'device_for_each_child_node'
           for (child = device_get_next_child_node(dev, NULL); child;      \
           ^
   drivers/iio/dac/ad5770r.c:544:2: note: Undefined or garbage value returned to caller
           return ret;
           ^      ~~~
   1 warning generated.
   kernel/irq/irqdomain.c:595:2: warning: Value stored to 'of_node' is never read [clang-analyzer-deadcode.DeadStores]
           of_node = irq_domain_get_of_node(domain);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/irq/irqdomain.c:595:2: note: Value stored to 'of_node' is never read
           of_node = irq_domain_get_of_node(domain);
           ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   2 warnings generated.
   drivers/mfd/qcom-pm8xxx.c:557:2: warning: Value stored to 'rev' is never read [clang-analyzer-deadcode.DeadStores]
           rev |= val << BITS_PER_BYTE;
           ^      ~~~~~~~~~~~~~~~~~~~~
   drivers/mfd/qcom-pm8xxx.c:557:2: note: Value stored to 'rev' is never read
           rev |= val << BITS_PER_BYTE;
           ^      ~~~~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   1 warning generated.
   drivers/input/rmi4/rmi_f11.c:1129:2: warning: Value stored to 'query_offset' is never read [clang-analyzer-deadcode.DeadStores]
           query_offset += rc;
           ^               ~~
   drivers/input/rmi4/rmi_f11.c:1129:2: note: Value stored to 'query_offset' is never read
           query_offset += rc;
           ^               ~~

vim +109 drivers/iio/dac/ad5766.c

    88	
    89	/**
    90	 * struct ad5766_state - driver instance specific data
    91	 * @spi:		SPI device
    92	 * @lock:		Lock used to restrict concurent access to SPI device
    93	 * @chip_info:		Chip model specific constants
    94	 * @gpio_reset:		Reset GPIO, used to reset the device
    95	 * @crt_range:		Current selected output range
    96	 * @dither_enable:	Power enable bit for each channel dither block (for
    97	 *			example, D15 = DAC 15,D8 = DAC 8, and D0 = DAC 0)
    98	 *			0 - Normal operation, 1 - Power down
    99	 * @dither_invert:	Inverts the dither signal applied to the selected DAC
   100	 *			outputs
   101	 * @dither_source:	Selects between 2 possible sources:
   102	 *			1: N0, 2: N1
   103	 *			Two bits are used for each channel
   104	 * @dither_scale:	Two bits are used for each of the 16 channels:
   105	 *			0: 1 SCALING, 1: 0.75 SCALING, 2: 0.5 SCALING,
   106	 *			3: 0.25 SCALING.
   107	 * @data:		SPI transfer buffers
   108	 */
 > 109	struct ad5766_state {
   110		struct spi_device		*spi;
   111		struct mutex			lock;
   112		const struct ad5766_chip_info	*chip_info;
   113		struct gpio_desc		*gpio_reset;
   114		enum ad5766_voltage_range	crt_range;
   115		u16		dither_enable;
   116		u16		dither_invert;
   117		u32		dither_source;
   118		u32		dither_scale;
   119		union {
   120			u32	d32;
   121			u16	w16[2];
   122			u8	b8[4];
   123		} data[3] ____cacheline_aligned;
   124	};
   125	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-19 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 17:46 drivers/iio/dac/ad5766.c:109:8: warning: Excessive padding in 'struct ad5766_state' (44 padding bytes, where 12 is optimal). Optimal fields order: data, spi, chip_info, gpio_reset, crt_range, dither_source, dither_scale, lock, dither_enable, dither_invert kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).