Skip to contentSkip to conversation

Abbreviation for variables

DISCUSSION Philipp Hortmann 2 participants 3 messages Oct 1, 2022 – Oct 2, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

I am looking for a list of commonly used variable names and the abbreviations. I need this to shorten some of the CamelCase variables in the staging area.

I have not found any good list in the web:
Here some examples (guessed)

reg -> register
cnt -> counter
pwr -> power
addr -> address
dis -> disable
en -> enable
sta -> status
init -> initialisation
wdt -> watchdogtimer
ch -> channel
skb -> socket buffer
stp -> stop
dev -> device
drv -> driver
net -> network
dst -> destination
len -> length
rf -> radio frequency
rt -> radio transceiver

here what I am looking for:

? -> handler
? -> current
? -> preamble
? -> promiscuous
? -> progress
? -> allow
? -> backup
? -> support
? -> becon
? -> interrupt
? -> filter
? -> source
? -> present
? -> attenuation
? -> tracking
? -> index
? -> network
? -> modulation
? -> active
? -> change
? -> associate
? -> calculate
? -> level
? -> original

Here some examples of the names I want to change.

IntelPromiscuousModeInfo
ScanOperationBackupHandler
UpdateBeaconInterruptHandler
AllowAllDestAddrHandler
GetHalfNmodeSupportByAPsHandler
ScanOperationBackupHandler

Thanks for your support.

Bye Philipp

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

#2 lore raw
Quoted 2 lines · Valdis Klētnieks
Quoted 1 line

Here some examples of the names I want to change.

Why? What actual improvement would accrue from doing this?

Hi Valdis,

thanks for your response.

I am working on rtl8192e in the staging area. Reason is that the hardware is commonly available and this driver will be used a long time from now.

This driver is not removed from the staging area without cleaning up checkpatch errors. Main issue with the long variable names is that the snake_case is making the names even longer. So when having a chance to shortem them this will improve readability for the bigger tasks.

Quoted 2 lines

(Hint: the code is almost certainly in drivers/staging because it has far worse issues than just using camel-case variable names...)

Yes but we need to start somewhere. Yes I do like to do more than what I did so far (remove dead code, fix checkpatch errors, remove ftrace like logging) up to now.

Do you know what issues that are and a way to improve this? I do like to know what is next.

Thanks for your support.

Bye Philipp

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies