iwlwifi: remove code repetition

Move the duplicated code into single static function.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
1 file changed