Re: [PATCH 18/26] [media] dvb: Get rid of typedev usage for enums
From: Joe Perches <hidden>
Date: 2015-06-08 20:03:12
Also in:
linux-media
On Mon, 2015-06-08 at 16:54 -0300, Mauro Carvalho Chehab wrote:
The DVB API was originally defined using typedefs. This is against
Kernel CodingStyle, and there's no good usage here. While we can't
remove its usage on userspace, we can avoid its usage in Kernelspace.
So, let's do it.
This patch was generated by this shell script:
for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; doneSeems sensible, thanks.
While here, make CodingStyle fixes on the affected lines.
Trivial note examples:
quoted hunk ↗ jump to hunk
diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c
[]
quoted hunk ↗ jump to hunk
@@ -39,7 +39,8 @@ static int flexcop_fe_request_firmware(struct dvb_frontend *fe, /* lnb control */ #if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299) -static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) +static int flexcop_set_voltage(struct dvb_frontend *fe, + enum fe_sec_voltage voltage)
Aligned to open paren.
quoted hunk ↗ jump to hunk
@@ -157,7 +158,7 @@ static int flexcop_diseqc_send_master_cmd(struct dvb_frontend *fe, } static int flexcop_diseqc_send_burst(struct dvb_frontend *fe, - fe_sec_mini_cmd_t minicmd) + enum fe_sec_mini_cmd minicmd)
Not aligned to open paren. Why some and not all?
quoted hunk ↗ jump to hunk
diff --git a/drivers/media/common/siano/smsdvb.h b/drivers/media/common/siano/smsdvb.h
[]
quoted hunk ↗ jump to hunk
@@ -40,7 +40,7 @@ struct smsdvb_client_t { struct dmxdev dmxdev; struct dvb_frontend frontend; - fe_status_t fe_status; + enum fe_status fe_status;
Maybe realign these too.