* [chrome-os:chromeos-5.15 26/27] drivers/media/v4l2-core/v4l2-ctrls-api.c:157 user_to_new() warn: if statement not indented
@ 2023-03-23 12:41 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-03-23 12:41 UTC (permalink / raw)
To: oe-kbuild, cros-kernel-buildreports, Guenter Roeck; +Cc: lkp, oe-kbuild-all
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.15
head: 0d75c643cb6de73b439e21bae1beab2350753291
commit: 43b2acadebeb69d7317bb321696b9cf5aceb557e [26/27] UPSTREAM: media: v4l2-ctrls-api.c: add back dropped ctrl->is_new = 1
config: nds32-randconfig-m031-20230322 (https://download.01.org/0day-ci/archive/20230323/202303232056.JGQxLz6c-lkp@intel.com/config)
compiler: nds32le-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202303232056.JGQxLz6c-lkp@intel.com/
smatch warnings:
drivers/media/v4l2-core/v4l2-ctrls-api.c:157 user_to_new() warn: if statement not indented
drivers/media/v4l2-core/v4l2-ctrls-api.c:159 user_to_new() warn: inconsistent indenting
vim +157 drivers/media/v4l2-core/v4l2-ctrls-api.c
71c689dc2e732d Hans Verkuil 2021-04-27 138 switch (ctrl->type) {
71c689dc2e732d Hans Verkuil 2021-04-27 139 case V4L2_CTRL_TYPE_INTEGER64:
6f9b5b1a63184c Hans Verkuil 2022-07-08 140 *ctrl->p_new.p_s64 = c->value64;
71c689dc2e732d Hans Verkuil 2021-04-27 141 break;
71c689dc2e732d Hans Verkuil 2021-04-27 142 case V4L2_CTRL_TYPE_STRING:
71c689dc2e732d Hans Verkuil 2021-04-27 143 size = c->size;
71c689dc2e732d Hans Verkuil 2021-04-27 144 if (size == 0)
71c689dc2e732d Hans Verkuil 2021-04-27 145 return -ERANGE;
71c689dc2e732d Hans Verkuil 2021-04-27 146 if (size > ctrl->maximum + 1)
71c689dc2e732d Hans Verkuil 2021-04-27 147 size = ctrl->maximum + 1;
6f9b5b1a63184c Hans Verkuil 2022-07-08 148 ret = copy_from_user(ctrl->p_new.p_char, c->string, size) ? -EFAULT : 0;
71c689dc2e732d Hans Verkuil 2021-04-27 149 if (!ret) {
6f9b5b1a63184c Hans Verkuil 2022-07-08 150 char last = ctrl->p_new.p_char[size - 1];
71c689dc2e732d Hans Verkuil 2021-04-27 151
6f9b5b1a63184c Hans Verkuil 2022-07-08 152 ctrl->p_new.p_char[size - 1] = 0;
71c689dc2e732d Hans Verkuil 2021-04-27 153 /*
71c689dc2e732d Hans Verkuil 2021-04-27 154 * If the string was longer than ctrl->maximum,
71c689dc2e732d Hans Verkuil 2021-04-27 155 * then return an error.
71c689dc2e732d Hans Verkuil 2021-04-27 156 */
6f9b5b1a63184c Hans Verkuil 2022-07-08 @157 if (strlen(ctrl->p_new.p_char) == ctrl->maximum && last)
43b2acadebeb69 Hans Verkuil 2022-12-12 158 ctrl->is_new = 1;
71c689dc2e732d Hans Verkuil 2021-04-27 @159 return -ERANGE;
Something went wrong here. Curly braces? Move the ctrl->is_new = 1;
after the return?
71c689dc2e732d Hans Verkuil 2021-04-27 160 }
71c689dc2e732d Hans Verkuil 2021-04-27 161 return ret;
71c689dc2e732d Hans Verkuil 2021-04-27 162 default:
6f9b5b1a63184c Hans Verkuil 2022-07-08 163 *ctrl->p_new.p_s32 = c->value;
71c689dc2e732d Hans Verkuil 2021-04-27 164 break;
71c689dc2e732d Hans Verkuil 2021-04-27 165 }
6f9b5b1a63184c Hans Verkuil 2022-07-08 166 ctrl->is_new = 1;
71c689dc2e732d Hans Verkuil 2021-04-27 167 return 0;
71c689dc2e732d Hans Verkuil 2021-04-27 168 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-23 12:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 12:41 [chrome-os:chromeos-5.15 26/27] drivers/media/v4l2-core/v4l2-ctrls-api.c:157 user_to_new() warn: if statement not indented Dan Carpenter
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).