* [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h
[not found] <YDvLYzsGu+l1pQ2y@localhost.localdomain>
@ 2021-02-28 17:01 ` Alexey Dobriyan
2021-02-28 22:07 ` Bart Van Assche
2021-02-28 17:11 ` [PATCH 12/11] pragma once: scripted treewide conversion Alexey Dobriyan
1 sibling, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2021-02-28 17:01 UTC (permalink / raw)
To: torvalds
Cc: linux-kernel, akpm, njavali, GR-QLogic-Storage-Upstream,
linux-scsi
From 1f58b4923ca9bfb8b1e73554d3793ee98ab58a77 Mon Sep 17 00:00:00 2001
From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue, 9 Feb 2021 17:14:25 +0300
Subject: [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h
This file has broken include guard which is not obvious just by looking
at the code. Convert it manually. I think I got #endif right.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
drivers/scsi/qla2xxx/qla_target.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h
index 10e5e6c8087d..923910dd1809 100644
--- a/drivers/scsi/qla2xxx/qla_target.h
+++ b/drivers/scsi/qla2xxx/qla_target.h
@@ -15,10 +15,7 @@
* This is the global def file that is useful for including from the
* target portion.
*/
-
-#ifndef __QLA_TARGET_H
-#define __QLA_TARGET_H
-
+#pragma once
#include "qla_def.h"
#include "qla_dsd.h"
@@ -116,7 +113,6 @@
(min(1270, ((ql) > 0) ? (QLA_TGT_DATASEGS_PER_CMD_24XX + \
QLA_TGT_DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
#endif
-#endif
#define GET_TARGET_ID(ha, iocb) ((HAS_EXTENDED_IDS(ha)) \
? le16_to_cpu((iocb)->u.isp2x.target.extended) \
@@ -244,6 +240,7 @@ struct ctio_to_2xxx {
#ifndef CTIO_RET_TYPE
#define CTIO_RET_TYPE 0x17 /* CTIO return entry */
#define ATIO_TYPE7 0x06 /* Accept target I/O entry for 24xx */
+#endif
struct fcp_hdr {
uint8_t r_ctl;
@@ -1082,5 +1079,3 @@ extern void qlt_do_generation_tick(struct scsi_qla_host *, int *);
void qlt_send_resp_ctio(struct qla_qpair *, struct qla_tgt_cmd *, uint8_t,
uint8_t, uint8_t, uint8_t);
-
-#endif /* __QLA_TARGET_H */
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 12/11] pragma once: scripted treewide conversion
[not found] <YDvLYzsGu+l1pQ2y@localhost.localdomain>
2021-02-28 17:01 ` [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h Alexey Dobriyan
@ 2021-02-28 17:11 ` Alexey Dobriyan
1 sibling, 0 replies; 3+ messages in thread
From: Alexey Dobriyan @ 2021-02-28 17:11 UTC (permalink / raw)
To: torvalds, linux-kernel, akpm, linux-arch
[ Bcc a lot of lists so that people understand what's this is all ]
[ about without creating uber-cc-thread. ]
[ Apologies if I missed your subsystem ]
[ Please see [PATCH 11/11: pragma once: conversion script (in Python 2)] ]
Hi, Linus.
Please run the script below from top-level directory, it will convert
most kernel headers to #pragma once directive advancing them into
21-st century.
The advantages are:
* less LOC
18087 files changed, 18878 insertions(+), 99804 deletions(-)
= -81 kLOC (give or take)
* less mental tax on developers forced to name things which aren't even
real code
* less junk in preprocessor hashtables and editors/IDEs autocompletion
lists
There are two bit exceptions: UAPI headers and ACPICA.
Given ubiquity of #pragma once, I personally think even these subsystems
should be converted in the future.
Compile tested on alpha, arc, arm, arm64, h8300, ia64, m68k, microblaze,
mips, nios2, parisc, powerpc, riscv, s390, sh, sparc, um-i386, um-x86_64,
i386, x86_64, xtensa (allnoconfig, all defconfigs, allmodconfig with or
without SMP/DEBUG_KERNEL + misc stuff).
Not compile tested on csky, hexagon, nds32, openrisc.
Love,
Alexey
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
#!/bin/sh -x
find . -type f -name '*.h' -print |\
LC_ALL=C sort |\
sed -e 's#^./##g' |\
xargs ./scripts/pragma-once.py
find . -type d -name 'uapi' | xargs git checkout -f
git checkout -f arch/alpha/include/asm/cmpxchg.h
git checkout -f arch/arm/mach-imx/hardware.h
git checkout -f arch/arm/mach-ixp4xx/include/mach/hardware.h
git checkout -f arch/arm/mach-sa1100/include/mach/hardware.h
git checkout -f arch/mips/include/asm/mips-cps.h
git checkout -f arch/x86/boot/boot.h
git checkout -f arch/x86/boot/ctype.h
git checkout -f arch/x86/include/asm/cpufeatures.h
git checkout -f arch/x86/include/asm/disabled-features.h
git checkout -f arch/x86/include/asm/required-features.h
git checkout -f arch/x86/include/asm/vmxfeatures.h
git checkout -f arch/x86/include/asm/vvar.h
git checkout -f drivers/acpi/acpica/
git checkout -f drivers/gpu/drm/amd/pm/inc/vega10_ppsmc.h
git checkout -f drivers/gpu/drm/amd/pm/powerplay/ppsmc.h
git checkout -f drivers/input/misc/yealink.h
git checkout -f drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
git checkout -f drivers/media/usb/dvb-usb-v2/mxl111sf-tuner.h
git checkout -f drivers/pcmcia/yenta_socket.h
git checkout -f drivers/staging/rtl8723bs/include/hal_com_h2c.h
git checkout -f include/linux/acpi.h
git checkout -f include/linux/bitops.h
git checkout -f include/linux/compiler_types.h
git checkout -f include/linux/device.h
git checkout -f include/linux/kbuild.h
git checkout -f include/linux/libfdt_env.h
git checkout -f include/linux/local_lock.h
git checkout -f include/linux/spinlock.h
git checkout -f include/linux/spinlock_api_smp.h
git checkout -f include/linux/spinlock_types.h
git checkout -f include/linux/tracepoint.h
git checkout -f mm/gup_test.h
git checkout -f net/batman-adv/main.h
git checkout -f scripts/dtc/
git checkout -f tools/include/linux/bitops.h
git checkout -f tools/include/linux/compiler.h
git checkout -f tools/testing/selftests/clone3/clone3_selftests.h
git checkout -f tools/testing/selftests/futex/include/atomic.h
git checkout -f tools/testing/selftests/futex/include/futextest.h
git checkout -f tools/testing/selftests/futex/include/logging.h
git checkout -f tools/testing/selftests/kselftest.h
git checkout -f tools/testing/selftests/kselftest_harness.h
git checkout -f tools/testing/selftests/pidfd/pidfd.h
git checkout -f tools/testing/selftests/x86/helpers.h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h
2021-02-28 17:01 ` [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h Alexey Dobriyan
@ 2021-02-28 22:07 ` Bart Van Assche
0 siblings, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2021-02-28 22:07 UTC (permalink / raw)
To: Alexey Dobriyan, torvalds
Cc: linux-kernel, akpm, njavali, GR-QLogic-Storage-Upstream,
linux-scsi
On 2/28/21 9:01 AM, Alexey Dobriyan wrote:
> This file has broken include guard which is not obvious just by looking
> at the code. Convert it manually. I think I got #endif right.
Why do you think that the include guard is broken? Please mention this
in the patch description.
> -
> -#ifndef __QLA_TARGET_H
> -#define __QLA_TARGET_H
> -
> +#pragma once
> #include "qla_def.h"
> #include "qla_dsd.h"
Please insert a blank line between #pragma once and the #include directives.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-28 22:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <YDvLYzsGu+l1pQ2y@localhost.localdomain>
2021-02-28 17:01 ` [PATCH 05/11] pragma once: convert drivers/scsi/qla2xxx/qla_target.h Alexey Dobriyan
2021-02-28 22:07 ` Bart Van Assche
2021-02-28 17:11 ` [PATCH 12/11] pragma once: scripted treewide conversion Alexey Dobriyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox