* [rclaveau:b4/add-adla_npu-t7-vim4 12/12] drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:156:26: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'adlak_os_printf'
@ 2026-09-09 9:43 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-09 9:43 UTC (permalink / raw)
To: Ronald Claveau; +Cc: oe-kbuild-all
tree: https://github.com/rclaveau-tech/linux-khadas.git b4/add-adla_npu-t7-vim4
head: 3729dea89f4ad77930792d1afd34a3bac456c7a1
commit: 3729dea89f4ad77930792d1afd34a3bac456c7a1 [12/12] Temporary use Adla Legacy driver
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20260909/202609091724.MSVLRBVv-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 803252a70e326051a340e1a80b79cd10ed633e7f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260909/202609091724.MSVLRBVv-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609091724.MSVLRBVv-lkp@intel.com/
All warnings (new ones prefixed by >>):
error: unknown warning option '-Wno-suggest-attribute=format'; did you mean '-Wno-property-attribute-mismatch'? [-Werror,-Wunknown-warning-option]
In file included from drivers/accel/adla_legacy/kmd/drv/port/platform/linux/adlak_platform_device.c:76:
>> drivers/accel/adla_legacy/kmd/drv/port/platform/linux/adlak_fops.c:252:33: warning: variable 'net_reg_desc' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer]
252 | cp_ret = copy_to_user(udata, &net_reg_desc,
| ^~~~~~~~~~~~
1 warning and 1 error generated.
--
error: unknown warning option '-Wno-suggest-attribute=format'; did you mean '-Wno-property-attribute-mismatch'? [-Werror,-Wunknown-warning-option]
>> drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:156:26: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'adlak_os_printf' [-Wmissing-format-attribute]
156 | r = vprintk(format, args);
| ^
drivers/accel/adla_legacy/kmd/drv/port/adlak_os.h:56:7: note: 'adlak_os_printf' declared here
56 | int adlak_os_printf(const char *format, ...);
| ^
>> drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:171:43: warning: diagnostic behavior may be improved by adding the 'format(printf, 3, 4)' attribute to the declaration of 'adlak_os_snprintf' [-Wmissing-format-attribute]
171 | cnt = vsnprintf(buffer, size, format, arg);
| ^
drivers/accel/adla_legacy/kmd/drv/port/adlak_os.h:57:7: note: 'adlak_os_snprintf' declared here
57 | int adlak_os_snprintf(char *buffer, ssize_t buf_size, const char *format, ...);
| ^
>> drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:193:34: warning: diagnostic behavior may be improved by adding the 'format(printf, 2, 0)' attribute to the declaration of 'adlak_os_vasprintf' [-Wmissing-format-attribute]
186 | static char *adlak_os_vasprintf(gfp_t gfp, const char *fmt, va_list ap)
| __attribute__((format(printf, 2, 0)))
187 | {
188 | unsigned int len;
189 | char *p;
190 | va_list aq;
191 |
192 | va_copy(aq, ap);
193 | len = vsnprintf(NULL, 0, fmt, aq);
| ^
drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:186:14: note: 'adlak_os_vasprintf' declared here
186 | static char *adlak_os_vasprintf(gfp_t gfp, const char *fmt, va_list ap)
| ^
>> drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:221:37: warning: diagnostic behavior may be improved by adding the 'format(printf, 2, 3)' attribute to the declaration of 'adlak_os_asprintf' [-Wmissing-format-attribute]
221 | p = adlak_os_vasprintf(gfp, fmt, ap);
| ^
drivers/accel/adla_legacy/kmd/drv/port/adlak_os.h:58:7: note: 'adlak_os_asprintf' declared here
58 | char *adlak_os_asprintf(gfp_t gfp, const char *fmt, ...);
| ^
4 warnings and 1 error generated.
vim +156 drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c
149
150 int adlak_os_printf(const char *format, ...)
151 {
152 va_list args;
153 int r;
154
155 va_start(args, format);
> 156 r = vprintk(format, args);
157 //r = pr_info(format, args);
158 va_end(args);
159 return r;
160 }
161
162 int adlak_os_snprintf(char *buffer, ssize_t size, const char *format, ...)
163 {
164 int cnt;
165 va_list arg;
166
167 if (size <= 0)
168 return 0;
169
170 va_start(arg, format);
> 171 cnt = vsnprintf(buffer, size, format, arg);
172 va_end(arg);
173 return cnt;
174 }
175
176 /**
177 * adlak_os_vasprintf - Allocate resource managed space and format a string
178 * into that.
179 * @gfp: the GFP mask used in the devm_kmalloc() call when
180 * allocating memory
181 * @fmt: The printf()-style format string
182 * @ap: Arguments for the format string
183 * RETURNS:
184 * Pointer to allocated string on success, NULL on failure.
185 */
186 static char *adlak_os_vasprintf(gfp_t gfp, const char *fmt, va_list ap)
187 {
188 unsigned int len;
189 char *p;
190 va_list aq;
191
192 va_copy(aq, ap);
> 193 len = vsnprintf(NULL, 0, fmt, aq);
194 va_end(aq);
195
196 p = kmalloc(len + 1, gfp);
197 if (!p)
198 return NULL;
199
200 vsnprintf(p, len + 1, fmt, ap);
201
202 return p;
203 }
204
205 /*
206 * @brief Allocate resource managed space and format a string
207 * into that.
208 *
209 * @param gfp the GFP mask used in the devm_kmalloc() call when
210 * allocating memory
211 * @param fmt: The printf()-style format string
212 * @param ... Arguments for the format string
213 * @return char* Pointer to allocated string on success, NULL on failure.
214 */
215 char *adlak_os_asprintf(gfp_t gfp, const char *fmt, ...)
216 {
217 va_list ap;
218 char *p;
219
220 va_start(ap, fmt);
> 221 p = adlak_os_vasprintf(gfp, fmt, ap);
222 va_end(ap);
223
224 return p;
225 }
226
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-09 9:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 9:43 [rclaveau:b4/add-adla_npu-t7-vim4 12/12] drivers/accel/adla_legacy/kmd/drv/port/os/linux/adlak_os.c:156:26: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'adlak_os_printf' kernel test robot
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.