All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH v2 15/16] treewide: Remove uninitialized_var() usage
Date: Mon, 22 Jun 2020 14:32:07 +0300	[thread overview]
Message-ID: <20200622113207.GZ4151@kadam> (raw)
In-Reply-To: <20200620033007.1444705-15-keescook@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 4728 bytes --]

Hi Kees,

I love your patch! Perhaps something to improve:

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on linus/master v5.8-rc1 next-20200618]
[cannot apply to wireless-drivers/master rw-ubifs/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Kees-Cook/Remove-uninitialized_var-macro/20200620-113245
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-randconfig-m001-20200619 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/drm_edid.c:3078 drm_cvt_modes() error: uninitialized symbol 'width'.

# https://github.com/0day-ci/linux/commit/f58ed1805d1492d80a38f58702a37a0996973ffc
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout f58ed1805d1492d80a38f58702a37a0996973ffc
vim +/width +3078 drivers/gpu/drm/drm_edid.c

139315796778a6 Adam Jackson 2010-08-03  3043  static int drm_cvt_modes(struct drm_connector *connector,
139315796778a6 Adam Jackson 2010-08-03  3044  			 struct detailed_timing *timing)
139315796778a6 Adam Jackson 2010-08-03  3045  {
139315796778a6 Adam Jackson 2010-08-03  3046  	int i, j, modes = 0;
139315796778a6 Adam Jackson 2010-08-03  3047  	struct drm_display_mode *newmode;
139315796778a6 Adam Jackson 2010-08-03  3048  	struct drm_device *dev = connector->dev;
139315796778a6 Adam Jackson 2010-08-03  3049  	struct cvt_timing *cvt;
139315796778a6 Adam Jackson 2010-08-03  3050  	const int rates[] = { 60, 85, 75, 60, 50 };
139315796778a6 Adam Jackson 2010-08-03  3051  	const u8 empty[3] = { 0, 0, 0 };
a327f6b806103e Adam Jackson 2010-03-29  3052  
139315796778a6 Adam Jackson 2010-08-03  3053  	for (i = 0; i < 4; i++) {
f58ed1805d1492 Kees Cook    2020-06-19  3054  		int width, height;
139315796778a6 Adam Jackson 2010-08-03  3055  		cvt = &(timing->data.other_data.data.cvt[i]);
9cf00977da0920 Adam Jackson 2009-12-03  3056  
139315796778a6 Adam Jackson 2010-08-03  3057  		if (!memcmp(cvt->code, empty, 3))
9cf00977da0920 Adam Jackson 2009-12-03  3058  			continue;
9cf00977da0920 Adam Jackson 2009-12-03  3059  
139315796778a6 Adam Jackson 2010-08-03  3060  		height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
139315796778a6 Adam Jackson 2010-08-03  3061  		switch (cvt->code[1] & 0x0c) {
139315796778a6 Adam Jackson 2010-08-03  3062  		case 0x00:
139315796778a6 Adam Jackson 2010-08-03  3063  			width = height * 4 / 3;
139315796778a6 Adam Jackson 2010-08-03  3064  			break;
139315796778a6 Adam Jackson 2010-08-03  3065  		case 0x04:
139315796778a6 Adam Jackson 2010-08-03  3066  			width = height * 16 / 9;
139315796778a6 Adam Jackson 2010-08-03  3067  			break;
139315796778a6 Adam Jackson 2010-08-03  3068  		case 0x08:
139315796778a6 Adam Jackson 2010-08-03  3069  			width = height * 16 / 10;
139315796778a6 Adam Jackson 2010-08-03  3070  			break;
139315796778a6 Adam Jackson 2010-08-03  3071  		case 0x0c:
139315796778a6 Adam Jackson 2010-08-03  3072  			width = height * 15 / 9;
139315796778a6 Adam Jackson 2010-08-03  3073  			break;

Default case?

139315796778a6 Adam Jackson 2010-08-03  3074  		}
139315796778a6 Adam Jackson 2010-08-03  3075  
139315796778a6 Adam Jackson 2010-08-03  3076  		for (j = 1; j < 5; j++) {
139315796778a6 Adam Jackson 2010-08-03  3077  			if (cvt->code[2] & (1 << j)) {
139315796778a6 Adam Jackson 2010-08-03 @3078  				newmode = drm_cvt_mode(dev, width, height,
139315796778a6 Adam Jackson 2010-08-03  3079  						       rates[j], j == 0,
139315796778a6 Adam Jackson 2010-08-03  3080  						       false, false);
139315796778a6 Adam Jackson 2010-08-03  3081  				if (newmode) {
139315796778a6 Adam Jackson 2010-08-03  3082  					drm_mode_probed_add(connector, newmode);
139315796778a6 Adam Jackson 2010-08-03  3083  					modes++;
139315796778a6 Adam Jackson 2010-08-03  3084  				}
139315796778a6 Adam Jackson 2010-08-03  3085  			}
139315796778a6 Adam Jackson 2010-08-03  3086  		}
f453ba0460742a Dave Airlie  2008-11-07  3087  	}
f453ba0460742a Dave Airlie  2008-11-07  3088  
f453ba0460742a Dave Airlie  2008-11-07  3089  	return modes;
f453ba0460742a Dave Airlie  2008-11-07  3090  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36423 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v2 15/16] treewide: Remove uninitialized_var() usage
Date: Mon, 22 Jun 2020 14:32:07 +0300	[thread overview]
Message-ID: <20200622113207.GZ4151@kadam> (raw)
In-Reply-To: <20200620033007.1444705-15-keescook@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 4728 bytes --]

Hi Kees,

I love your patch! Perhaps something to improve:

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on linus/master v5.8-rc1 next-20200618]
[cannot apply to wireless-drivers/master rw-ubifs/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Kees-Cook/Remove-uninitialized_var-macro/20200620-113245
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-randconfig-m001-20200619 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/gpu/drm/drm_edid.c:3078 drm_cvt_modes() error: uninitialized symbol 'width'.

# https://github.com/0day-ci/linux/commit/f58ed1805d1492d80a38f58702a37a0996973ffc
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout f58ed1805d1492d80a38f58702a37a0996973ffc
vim +/width +3078 drivers/gpu/drm/drm_edid.c

139315796778a6 Adam Jackson 2010-08-03  3043  static int drm_cvt_modes(struct drm_connector *connector,
139315796778a6 Adam Jackson 2010-08-03  3044  			 struct detailed_timing *timing)
139315796778a6 Adam Jackson 2010-08-03  3045  {
139315796778a6 Adam Jackson 2010-08-03  3046  	int i, j, modes = 0;
139315796778a6 Adam Jackson 2010-08-03  3047  	struct drm_display_mode *newmode;
139315796778a6 Adam Jackson 2010-08-03  3048  	struct drm_device *dev = connector->dev;
139315796778a6 Adam Jackson 2010-08-03  3049  	struct cvt_timing *cvt;
139315796778a6 Adam Jackson 2010-08-03  3050  	const int rates[] = { 60, 85, 75, 60, 50 };
139315796778a6 Adam Jackson 2010-08-03  3051  	const u8 empty[3] = { 0, 0, 0 };
a327f6b806103e Adam Jackson 2010-03-29  3052  
139315796778a6 Adam Jackson 2010-08-03  3053  	for (i = 0; i < 4; i++) {
f58ed1805d1492 Kees Cook    2020-06-19  3054  		int width, height;
139315796778a6 Adam Jackson 2010-08-03  3055  		cvt = &(timing->data.other_data.data.cvt[i]);
9cf00977da0920 Adam Jackson 2009-12-03  3056  
139315796778a6 Adam Jackson 2010-08-03  3057  		if (!memcmp(cvt->code, empty, 3))
9cf00977da0920 Adam Jackson 2009-12-03  3058  			continue;
9cf00977da0920 Adam Jackson 2009-12-03  3059  
139315796778a6 Adam Jackson 2010-08-03  3060  		height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
139315796778a6 Adam Jackson 2010-08-03  3061  		switch (cvt->code[1] & 0x0c) {
139315796778a6 Adam Jackson 2010-08-03  3062  		case 0x00:
139315796778a6 Adam Jackson 2010-08-03  3063  			width = height * 4 / 3;
139315796778a6 Adam Jackson 2010-08-03  3064  			break;
139315796778a6 Adam Jackson 2010-08-03  3065  		case 0x04:
139315796778a6 Adam Jackson 2010-08-03  3066  			width = height * 16 / 9;
139315796778a6 Adam Jackson 2010-08-03  3067  			break;
139315796778a6 Adam Jackson 2010-08-03  3068  		case 0x08:
139315796778a6 Adam Jackson 2010-08-03  3069  			width = height * 16 / 10;
139315796778a6 Adam Jackson 2010-08-03  3070  			break;
139315796778a6 Adam Jackson 2010-08-03  3071  		case 0x0c:
139315796778a6 Adam Jackson 2010-08-03  3072  			width = height * 15 / 9;
139315796778a6 Adam Jackson 2010-08-03  3073  			break;

Default case?

139315796778a6 Adam Jackson 2010-08-03  3074  		}
139315796778a6 Adam Jackson 2010-08-03  3075  
139315796778a6 Adam Jackson 2010-08-03  3076  		for (j = 1; j < 5; j++) {
139315796778a6 Adam Jackson 2010-08-03  3077  			if (cvt->code[2] & (1 << j)) {
139315796778a6 Adam Jackson 2010-08-03 @3078  				newmode = drm_cvt_mode(dev, width, height,
139315796778a6 Adam Jackson 2010-08-03  3079  						       rates[j], j == 0,
139315796778a6 Adam Jackson 2010-08-03  3080  						       false, false);
139315796778a6 Adam Jackson 2010-08-03  3081  				if (newmode) {
139315796778a6 Adam Jackson 2010-08-03  3082  					drm_mode_probed_add(connector, newmode);
139315796778a6 Adam Jackson 2010-08-03  3083  					modes++;
139315796778a6 Adam Jackson 2010-08-03  3084  				}
139315796778a6 Adam Jackson 2010-08-03  3085  			}
139315796778a6 Adam Jackson 2010-08-03  3086  		}
f453ba0460742a Dave Airlie  2008-11-07  3087  	}
f453ba0460742a Dave Airlie  2008-11-07  3088  
f453ba0460742a Dave Airlie  2008-11-07  3089  	return modes;
f453ba0460742a Dave Airlie  2008-11-07  3090  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36423 bytes --]

  reply	other threads:[~2020-06-22 11:32 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20  3:29 [PATCH v2 00/16] Remove uninitialized_var() macro Kees Cook
2020-06-20  3:29 ` [PATCH v2 01/16] docs: deprecated.rst: Add uninitialized_var() Kees Cook
2020-06-22 16:59   ` Nick Desaulniers
2020-06-22 16:59     ` Nick Desaulniers
2020-06-22 16:59     ` Nick Desaulniers
2020-06-20  3:29 ` [PATCH v2 02/16] x86/mm/numa: Remove uninitialized_var() usage Kees Cook
2020-06-20  3:29 ` [PATCH v2 03/16] drbd: " Kees Cook
2020-06-20  3:29 ` [PATCH v2 04/16] b43: " Kees Cook
2020-06-22 17:04   ` Nick Desaulniers
2020-06-22 17:04     ` Nick Desaulniers
2020-06-22 17:04     ` Nick Desaulniers
2020-06-22 21:04     ` Kees Cook
2020-06-22 21:04       ` Kees Cook
2020-06-23 18:29       ` Nick Desaulniers
2020-06-23 18:29         ` Nick Desaulniers
2020-06-23 18:29         ` Nick Desaulniers
2020-07-15 10:37   ` Kalle Valo
2020-07-15 10:37   ` Kalle Valo
2020-07-15 10:37   ` Kalle Valo
2020-06-20  3:29 ` [PATCH v2 05/16] rtlwifi: rtl8192cu: " Kees Cook
2020-06-20  3:29 ` [PATCH v2 06/16] ide: " Kees Cook
2020-06-20  3:29 ` [PATCH v2 07/16] clk: st: " Kees Cook
2020-06-22  9:03   ` Stephen Boyd
2020-06-22  9:03     ` Stephen Boyd
2020-06-20  3:29 ` [PATCH v2 08/16] spi: davinci: " Kees Cook
2020-07-01 20:39   ` Mark Brown
2020-07-01 20:39     ` Mark Brown
2020-07-02 15:21     ` Kees Cook
2020-07-02 15:21       ` Kees Cook
2020-07-02 15:23       ` Mark Brown
2020-07-02 15:23         ` Mark Brown
2020-07-02 15:42         ` Kees Cook
2020-07-02 15:42           ` Kees Cook
2020-07-02 16:23           ` Joe Perches
2020-07-02 16:23             ` Joe Perches
2020-07-02 16:23             ` Joe Perches
2020-06-20  3:30 ` [PATCH v2 09/16] clk: spear: " Kees Cook
2020-06-22  9:03   ` Stephen Boyd
2020-06-22  9:03     ` Stephen Boyd
2020-06-20  3:30 ` [PATCH v2 10/16] KVM: PPC: Book3S PR: " Kees Cook
2020-06-22 17:22   ` Nick Desaulniers
2020-06-22 17:22     ` Nick Desaulniers
2020-06-22 17:22     ` Nick Desaulniers
2020-06-20  3:30 ` [PATCH v2 11/16] media: sur40: " Kees Cook
2020-06-22 18:39   ` Nick Desaulniers
2020-06-22 18:39     ` Nick Desaulniers
2020-06-22 18:39     ` Nick Desaulniers
2020-06-20  3:30 ` [PATCH v2 12/16] f2fs: Eliminate usage of uninitialized_var() macro Kees Cook
2020-06-20  3:30 ` [PATCH v2 14/16] checkpatch: Remove awareness " Kees Cook
2020-06-20  3:30 ` [PATCH v2 15/16] treewide: Remove uninitialized_var() usage Kees Cook
2020-06-22 11:32   ` Dan Carpenter [this message]
2020-06-22 11:32     ` Dan Carpenter
2020-06-20  3:30 ` [PATCH v2 16/16] compiler: Remove uninitialized_var() macro Kees Cook
2020-06-20  3:30 ` [PATCH v2 13/16] mm/debug_vm_pgtable: Remove uninitialized_var() usage Kees Cook
2020-06-22 17:27   ` Nick Desaulniers
2020-06-22 17:27     ` Nick Desaulniers
2020-06-22 17:27     ` Nick Desaulniers
2020-06-20  7:03 ` [PATCH v2 00/16] Remove uninitialized_var() macro Sedat Dilek
2020-06-20  7:03   ` Sedat Dilek
2020-06-20 15:57   ` Kees Cook
2020-06-22  9:07     ` Sedat Dilek
2020-06-22  9:07       ` Sedat Dilek
2020-06-22  9:07       ` Sedat Dilek
2020-06-20 12:36 [PATCH v2 15/16] treewide: Remove uninitialized_var() usage kernel test robot
2020-06-20 13:56 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200622113207.GZ4151@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.