Fix compilation warning for fallthrough and unused variables.
Fix compilation warning:
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_des.c: In function 'ifx_deu_des':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_des.c:206:35: error: this statement may fall through [-Werror=implicit-fallthrough=]
206 | des->K3LR = DEU_ENDIAN_SWAP(*((u32 *) key + 5));
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_des.c:209:17: note: here
209 | case 16:
| ^~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_des.c:211:35: error: this statement may fall through [-Werror=implicit-fallthrough=]
211 | des->K2LR = DEU_ENDIAN_SWAP(*((u32 *) key + 3));
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_des.c:214:17: note: here
214 | case 8:
| ^~~~
cc1: all warnings being treated as errors
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_aes.c: In function 'ifx_deu_aes':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_aes.c:260:21: error: unused variable 'ctx' [-Werror=unused-variable]
260 | struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg;
| ^~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_aes.c: In function 'ifx_deu_aes_xts':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_aes.c:702:21: error: unused variable 'ctx' [-Werror=unused-variable]
702 | struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg;
| ^~~
cc1: all warnings being treated as errors
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_sha1.c: In function 'sha1_final':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_sha1.c:203:19: error: unused variable 'flag' [-Werror=unused-variable]
203 | unsigned long flag;
| ^~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_sha1.c:202:33: error: unused variable 'hashs' [-Werror=unused-variable]
202 | volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START;
| ^~~~~
cc1: all warnings being treated as errors
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_md5.c: In function 'md5_init':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_md5.c:146:33: error: unused variable 'hash' [-Werror=unused-variable]
146 | volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START;
| ^~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_md5.c: In function 'md5_final':
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_md5.c:204:19: error: unused variable 'flag' [-Werror=unused-variable]
204 | unsigned long flag;
| ^~~~
/home/ansuel/openwrt-ansuel/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_xway/ltq-deu-danube/ltq-deu/ifxmips_md5.c:203:33: error: unused variable 'hashs' [-Werror=unused-variable]
203 | volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START;
| ^~~~~
cc1: all warnings being treated as errors
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
volatile struct aes_t *aes = (volatile struct aes_t *) AES_START;
- struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg;
+ //struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg;
unsigned long flag;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
int i = 0;
{
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
volatile struct aes_t *aes = (volatile struct aes_t *) AES_START;
- struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg;
+ //struct aes_ctx *ctx = (struct aes_ctx *)ctx_arg;
unsigned long flag;
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
u8 oldiv[16];
des->K3HR = DEU_ENDIAN_SWAP(*((u32 *) key + 4));
des->K3LR = DEU_ENDIAN_SWAP(*((u32 *) key + 5));
/* no break; */
-
+ fallthrough;
case 16:
des->K2HR = DEU_ENDIAN_SWAP(*((u32 *) key + 2));
des->K2LR = DEU_ENDIAN_SWAP(*((u32 *) key + 3));
/* no break; */
+ fallthrough;
case 8:
des->K1HR = DEU_ENDIAN_SWAP(*((u32 *) key + 0));
des->K1LR = DEU_ENDIAN_SWAP(*((u32 *) key + 1));
static int md5_init(struct shash_desc *desc)
{
struct md5_ctx *mctx = shash_desc_ctx(desc);
- volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START;
+ //volatile struct deu_hash_t *hash = (struct deu_hash_t *) HASH_START;
mctx->byte_count = 0;
mctx->started = 0;
const unsigned int offset = mctx->byte_count & 0x3f;
char *p = (char *)mctx->block + offset;
int padding = 56 - (offset + 1);
- volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START;
- unsigned long flag;
+ //volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START;
+ //unsigned long flag;
*p++ = 0x80;
if (padding < 0) {
u64 t;
u8 bits[8] = { 0, };
static const u8 padding[64] = { 0x80, };
- volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START;
- unsigned long flag;
+ //volatile struct deu_hash_t *hashs = (struct deu_hash_t *) HASH_START;
+ //unsigned long flag;
t = sctx->count;
bits[7] = 0xff & t;